-if (&IsParam("useStrict")) { use strict; }
-
-use vars qw($message $arg $qWord $verb $lobotomized);
-use vars qw(%channels %chanstats %cmdstats);
+use strict;
+use vars qw($message $arg $qWord $verb $lobotomized $who $result $chan
+ $conn $msgType $query $talkchannel $ident $memusage);
+use vars qw(%channels %chanstats %cmdstats %count %ircstats %param
+ %cache %mask %userstats %hooks_main);
&addCmdHook("main", 'factinfo', ('CODEREF' => 'factinfo',
'Cmdstats' => 'Factoid Info', Module => 'factoids', ) );
&addCmdHook("main", 'factstats?', ('CODEREF' => 'factstats',
&addCmdHook("main", 'factinfo', ('CODEREF' => 'factinfo',
'Cmdstats' => 'Factoid Info', Module => 'factoids', ) );
&addCmdHook("main", 'factstats?', ('CODEREF' => 'factstats',
Forker => 1, 'Identifier' => 'factoids', ) );
&addCmdHook("main", 'help', ('CODEREF' => 'help',
'Cmdstats' => 'Help', ) );
Forker => 1, 'Identifier' => 'factoids', ) );
&addCmdHook("main", 'help', ('CODEREF' => 'help',
'Cmdstats' => 'Help', ) );
- push(@array, "$_ (".scalar(keys %{ $channels{$_}{''} }).")");
+ next if (/^_default$/);
+
+ my $str = sprintf("%s (%d)", $_, scalar(keys %{ $channels{$_}{''} }));
+ push(@array, $str);
- my $karma = &dbGet("stats", "counter", "nick=".
- &dbQuote($target)." AND type='karma'") || 0;
+ my $karma = &sqlSelect("stats", "counter",
+ { nick => $target, type => "karma" }) || 0;
$cache{countryStats}{chan} = $chan;
$cache{countryStats}{mtype} = $msgType;
$cache{countryStats}{who} = $who;
$cache{countryStats}{chan} = $chan;
$cache{countryStats}{mtype} = $msgType;
$cache{countryStats}{who} = $who;
"Since $startString, there have been".
" \002$count{'Update'}\002 ".
&fixPlural("modification", $count{'Update'}).
"Since $startString, there have been".
" \002$count{'Update'}\002 ".
&fixPlural("modification", $count{'Update'}).
&fixPlural("moron",$count{'Moron'}).
" and \002$count{'Commands'}\002 ".
&fixPlural("command",$count{'Commands'}).
". I have been awake for $upString this session, and ".
&fixPlural("moron",$count{'Moron'}).
" and \002$count{'Commands'}\002 ".
&fixPlural("command",$count{'Commands'}).
". I have been awake for $upString this session, and ".
- # todo: make dbGetColNiceHash().
- my %hash = &dbGetCol("stats", "nick,counter", "type='cmdstats'".
-# " ORDER BY counter DESC LIMIT 3", 1);
- " ORDER BY counter DESC", 1);
+ return;
+
+ my %hash = &sqlSelectColHash("stats", "nick,counter",
+ { type => "cmdstats" }, 1);
+# ORDER won't be retained in a hash
+# " ORDER BY counter DESC", 1);
if ($param{'ircNick'} eq $ident) {
&msg($who, "I hope you're right. I'll try anyway.");
}
if ($param{'ircNick'} eq $ident) {
&msg($who, "I hope you're right. I'll try anyway.");
}
if (! &IsNickInAnyChan( $param{ircNick} ) ) {
my $str = "attempting to change nick to $param{'ircNick'}";
if (! &IsNickInAnyChan( $param{ircNick} ) ) {
my $str = "attempting to change nick to $param{'ircNick'}";