+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);
+
+###
+### Start of command hooks for UserExtra.
+###
+
+&addCmdHook("main", 'chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
+&addCmdHook("main", 'cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
+&addCmdHook("main", 'factinfo', ('CODEREF' => 'factinfo',
+ 'Cmdstats' => 'Factoid Info', Module => 'factoids', ) );
+&addCmdHook("main", 'factstats?', ('CODEREF' => 'factstats',
+ 'Cmdstats' => 'Factoid Stats', Help => "factstats",
+ Forker => 1, 'Identifier' => 'factoids', ) );
+&addCmdHook("main", 'help', ('CODEREF' => 'help',
+ 'Cmdstats' => 'Help', ) );
+&addCmdHook("main", 'karma', ('CODEREF' => 'karma', ) );
+&addCmdHook("main", 'i?spell', ('CODEREF' => 'ispell',
+ Help => 'spell', Identifier => 'spell', ) );
+&addCmdHook("main", 'd?nslookup', ('CODEREF' => 'DNS',
+ Help => 'nslookup', Identifier => 'allowDNS',
+ Forker => "NULL", ) );
+&addCmdHook("main", 'tell|explain', ('CODEREF' => 'tell',
+ Help => 'tell', Identifier => 'allowTelling',
+ Cmdstats => 'Tell') );
+&addCmdHook("main", 'news', ('CODEREF' => 'News::Parse',
+ Module => 'news', 'Cmdstats' => 'News' ) );
+&addCmdHook("main", 'countrystats', ('CODEREF' => 'countryStats',
+# Forker => "NULL",
+ ) );
+
+&status("CMD: loaded ".scalar(keys %hooks_main)." MAIN command hooks.");
+
+###
+### Start of commands for hooks.
+###
+
+sub chaninfo {
+ my $chan = lc shift(@_);
+ my $mode;
+
+ if ($chan eq "") { # all channels.
+ my $i = keys %channels;
+ my $reply = "i am on \002$i\002 ".&fixPlural("channel",$i);
+ my $tucount = 0; # total user count.
+ my $uucount = 0; # unique user count.
+ my @array;