2 # User Command Extension Stubs
3 # WARN: this file does not reload on HUP.
6 #use strict; # TODO: sub { \&{ $hash{'CODEREF'} }($flatarg) };
8 use vars qw($who $msgType $conn $chan $message $ident $talkchannel
9 $bot_version $bot_data_dir);
10 use vars qw(@vernick @vernicktodo);
11 use vars qw(%channels %cache %mask %userstats %myModules %cmdstats
12 %cmdhooks %lang %ver);
13 # TODO: FIX THE FOLLOWING:
14 use vars qw($total $x $type $i $good %wingateToDo);
16 my $w3search_regex = "google";
18 ### COMMAND HOOK IMPLEMENTATION.
19 # addCmdHook('TEXT_HOOK',
22 # Module => 'blah.pl' # preload module.
23 # Identifier => 'config_label', # change to Config?
24 # Help => 'help_label',
25 # Cmdstats => 'text_label',)
30 my ($ident, %hash) = @_;
32 if (exists $cmdhooks{$ident}) {
33 &WARN("aCH: \$cmdhooks{$ident} already exists.");
37 &VERB("aCH: added $ident",2); # use $hash{'Identifier'}?
38 ### hrm... prevent warnings?
39 $cmdhooks{$ident} = \%hash;
45 $line =~ s/^\s+|\s+$//g; # again.
46 $line =~ /^(\S+)(\s+(.*))?$/;
47 my $cmd = $1; # command name is whitespaceless.
49 my @args = split(/\s+/, $flatarg || '');
54 if (!defined %cmdhooks) {
55 &WARN('%cmdhooks does not exist.');
60 &WARN("cstubs: cmd == NULL.");
64 foreach (keys %cmdhooks) {
65 # rename to something else! like $id or $label?
68 next unless ($cmd =~ /^$ident$/i);
71 &WARN("pCH: Multiple hook match: $ident");
75 &status("cmdhooks: $cmd matched '$ident' '$flatarg'");
76 my %hash = %{ $cmdhooks{$ident} };
78 if (!scalar keys %hash) {
79 &WARN("CmdHook: hash is NULL?");
83 if ($hash{NoArgs} and $flatarg) {
84 &DEBUG("cmd $ident does not take args ('$flatarg'); skipping.");
88 if (!exists $hash{CODEREF}) {
89 &ERROR("CODEREF undefined for $cmd or $ident.");
94 foreach (keys %hash) {
95 &VERB(" $cmd->$_ => '$hash{$_}'.",2);
99 if (exists $hash{'Help'} and !scalar(@args)) {
100 &help( $hash{'Help'} );
105 if (exists $hash{'Identifier'}) {
106 return 1 unless (&IsChanConfOrWarn($hash{'Identifier'}));
110 if (exists $hash{'UserFlag'}) {
111 return 1 unless (&hasFlag($hash{'UserFlag'}));
114 ### FORKER,IDENTIFIER,CODEREF.
115 if (($$ == $bot_pid) && exists $hash{'Forker'}) {
116 $hash{'Identifier'} .= "-" if ($hash{'Forker'} eq "NULL");
118 if (exists $hash{'ArrayArgs'}) {
119 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }(@args) } );
121 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }($flatarg) } );
125 if (exists $hash{'Module'}) {
126 &loadMyModule($hash{'Module'});
129 # check if CODEREF exists.
130 if (!defined &{ $hash{'CODEREF'} }) {
131 &WARN("coderef $hash{'CODEREF'} does not exist.");
133 &msg($who, "coderef does not exist for $ident.");
139 if (exists $hash{'ArrayArgs'}) {
140 &{ $hash{'CODEREF'} }(@args);
142 &{ $hash{'CODEREF'} }($flatarg);
147 if (exists $hash{'Cmdstats'}) {
148 $cmdstats{ $hash{'Cmdstats'} }++;
151 &VERB("hooks: End of command.",2);
161 if (!defined $message) {
162 &WARN("Modules: message is undefined. should never happen.");
166 my $debiancmd = 'conflicts?|depends?|desc|file|(?:d)?info|provides?';
167 $debiancmd .= '|recommends?|suggests?|maint|maintainer';
169 if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
170 return unless (&IsChanConfOrWarn('Debian'));
173 if (defined $package) {
174 &Forker('Debian', sub { &Debian::infoPackages($1, $package); } );
182 # google searching. Simon++
183 if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
184 return unless (&IsChanConfOrWarn('W3Search'));
186 &Forker('W3Search', sub { &W3Search::W3Search($1,$2); } );
188 $cmdstats{'W3Search'}++;
192 # text counters. (eg: hehstats)
194 $itc = &getChanConf('ircTextCounters');
195 $itc = &findChanConf('ircTextCounters') unless ($itc);
196 return if ($itc && &do_text_counters($itc) == 1);
197 # end of text counters.
199 # list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
200 if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
201 return unless (&IsChanConfOrWarn('Search'));
206 $thiscmd =~ s/^vals$/values/;
207 return if ($thiscmd ne 'keys' && $thiscmd ne 'values');
210 if (!defined $args or $args =~ /^\s*$/) {
211 &help('list'. $thiscmd);
215 # suggested by asuffield and \broken.
216 if ($args =~ /^["']/ and $args =~ /["']$/) {
217 &DEBUG('list*: removed quotes.');
218 $args =~ s/^["']|["']$//g;
221 if (length $args < 2 && &IsFlag('o') ne 'o') {
222 &msg($who, 'search string is too short.');
226 &Forker('Search', sub { &Search::Search($thiscmd, $args); } );
228 $cmdstats{'Factoid Search'}++;
232 # Nickometer. Adam Spiers++
233 if ($message =~ /^(?:lame|nick)ometer(?: for)? (\S+)/i) {
234 return unless (&IsChanConfOrWarn("nickometer"));
236 my $term = (lc $1 eq 'me') ? $who : $1;
238 &loadMyModule('nickometer');
240 if ($term =~ /^$mask{chan}$/) {
241 &status("Doing nickometer for chan $term.");
243 if (!&validChan($term)) {
244 &msg($who, "error: channel is invalid.");
250 foreach (keys %{ $channels{lc $term}{''} }) {
253 &WARN("nickometer: nick in chan $term undefined?");
257 my $value = &nickometer($str);
258 $nickometer{$value}{$str} = 1;
262 ### TODO: compact with map?
264 foreach (sort {$b <=> $a} keys %nickometer) {
265 my $str = join(", ", sort keys %{ $nickometer{$_} });
266 push(@list, "$str ($_%)");
269 &performStrictReply( &formListReply(0, "Nickometer list for $term ", @list) );
275 my $percentage = &nickometer($term);
277 if ($percentage =~ /NaN/) {
278 $percentage = "off the scale";
280 $percentage = sprintf("%0.4f", $percentage);
281 $percentage =~ s/(\.\d+)0+$/$1/;
285 if ($msgType eq 'public') {
286 &say("'$term' is $percentage lame, $who");
288 &msg($who, "the 'lame nick-o-meter' reading for $term is $percentage, $who");
294 # Topic management. xk++
295 # may want to add a userflags for topic. -xk
296 if ($message =~ /^topic(\s+(.*))?$/i) {
297 return unless (&IsChanConfOrWarn('Topic'));
299 my $chan = $talkchannel;
300 my @args = split / /, $2 || "";
303 &msg($who,"Try 'help topic'");
307 $chan = lc(shift @args) if ($msgType eq 'private');
308 my $thiscmd = shift @args;
311 if ($msgType eq 'public' && $thiscmd =~ /^#/) {
312 &msg($who, "error: channel argument is not required.");
313 &msg($who, "\002Usage\002: topic <CMD>");
317 # topic over private:
318 if ($msgType eq 'private' && $chan !~ /^#/) {
319 &msg($who, "error: channel argument is required.");
320 &msg($who, "\002Usage\002: topic #channel <CMD>");
324 if (&validChan($chan) == 0) {
325 &msg($who,"error: invalid channel \002$chan\002");
329 # for semi-outsiders.
330 if (!&IsNickInChan($who,$chan)) {
331 &msg($who, "Failed. You ($who) are not in $chan, hey?");
336 &loadMyModule('Topic');
337 &Topic($chan, $thiscmd, join(' ', @args));
338 $cmdstats{'Topic'}++;
343 if ($message =~ /^wingate$/i) {
344 return unless (&IsChanConfOrWarn('Wingate'));
346 my $reply = "Wingate statistics: scanned \002"
347 .scalar(keys %wingateToDo)."\002 hosts";
348 my $queue = scalar(keys %wingateToDo);
350 $reply .= ". I have \002$queue\002 hosts in the queue";
351 $reply .= ". Started the scan ".&Time2String(time() - $wingaterun)." ago";
354 &performStrictReply("$reply.");
359 # do nothing and let the other routines have a go
366 &msg($who, "- Uptime for $ident -");
367 &msg($who, "Now: ". &Time2String(&uptimeNow()) ." running $bot_version");
369 foreach (&uptimeGetInfo()) {
371 my $time = &Time2String($1);
374 &msg($who, "$count: $time $2");
381 my($person) = lc shift;
384 if (!defined $person or $person =~ /^$/) {
387 my $i = &countKeys("seen");
388 &msg($who,"there ". &fixPlural("is",$i) ." \002$i\002 ".
389 "seen ". &fixPlural("entry",$i) ." that I know of.");
396 &seenFlush(); # very evil hack. oh well, better safe than sorry.
398 # TODO: convert to &sqlSelectRowHash();
399 my $select = "nick,time,channel,host,message";
400 if ($person eq "random") {
401 @seen = &randKey("seen", $select);
403 @seen = &sqlSelect("seen", $select, { nick => $person } );
406 if (scalar @seen < 2) {
408 &DEBUG("seen: _ => '$_'.");
410 &performReply("i haven't seen '$person'");
416 ### TODO: multi channel support. may require &IsNick() to return
417 ### all channels or something.
419 my @chans = &getNickInChans($seen[0]);
421 $reply = "$seen[0] is currently on";
425 next unless (exists $userstats{lc $seen[0]}{'Join'});
426 $reply .= " (".&Time2String(time() - $userstats{lc $seen[0]}{'Join'}).")";
429 if (&IsChanConf("seenStats") > 0) {
431 $i = $userstats{lc $seen[0]}{'Count'};
432 $reply .= ". Has said a total of \002$i\002 messages" if (defined $i);
433 $i = $userstats{lc $seen[0]}{'Time'};
434 $reply .= ". Is idling for ".&Time2String(time() - $i) if (defined $i);
437 my $howlong = &Time2String(time() - $seen[1]);
438 $reply = "$seen[0] <$seen[3]> was last seen on IRC ".
439 "in channel $seen[2], $howlong ago, ".
440 "saying\002:\002 '$seen[4]'.";
443 &performStrictReply($reply);
447 # User Information Services. requested by Flugh.
449 my ($arg) = join(' ',@_);
451 if ($arg =~ /^set(\s+(.*))?$/i) {
454 &help('userinfo set');
458 &UserInfoSet(split /\s+/, $arg, 2);
459 } elsif ($arg =~ /^unset(\s+(.*))?$/i) {
462 &help('userinfo unset');
466 &UserInfoSet($arg, '');
472 # cookie (random). xk++
476 # lets find that secret cookie.
477 my $target = ($msgType ne 'public') ? $who : $talkchannel;
478 my $cookiemsg = &getRandom(keys %{ $lang{'cookie'} });
481 ### WILL CHEW TONS OF MEM.
482 ### TODO: convert this to a Forker function!
484 my @list = &searchTable("factoids", "factoid_key", "factoid_value", $arg);
485 $key = &getRandom(@list);
486 $value = &getFactInfo($key, "factoid_value");
488 ($key,$value) = &randKey("factoids","factoid_key,factoid_value");
492 s/##KEY/\002$key\002/;
495 s/\$who/$who/; # cheap fix.
496 s/(\S+)?\s*<\S+>/$1 /;
500 if ($cookiemsg =~ s/^ACTION //i) {
501 &action($target, $cookiemsg);
503 &msg($target, $cookiemsg);
508 my $arg = join(' ',@_);
509 my ($from,$to) = ('','');
511 ($from,$to) = ($1,$2) if ($arg =~ /^(.*?) to (.*)$/i);
512 ($from,$to) = ($2,$1) if ($arg =~ /^(.*?) from (.*)$/i);
514 if (!$to or !$from) {
515 &msg($who, "Invalid format!");
520 &Units::convertUnits($from, $to);
526 my ($target) = &fixString($_[0]);
528 my $chan = $talkchannel;
531 if ($msgType eq 'private') {
532 if ($target =~ /^($mask{chan})\s+(.*)$/) {
537 &msg($who, "error: invalid format or missing arguments.");
542 if ($target =~ /^(.*)(\s+for\s+.*)$/) {
547 my $line = &getRandomLineFromFile($bot_data_dir. "/blootbot.lart");
549 if ($target =~ /^(me|you|itself|\Q$ident\E)$/i) {
550 $line =~ s/WHO/$who/g;
552 $line =~ s/WHO/$target/g;
554 $line .= $for if ($for);
555 $line .= ", courtesy of $who" if ($extra);
557 &action($chan, $line);
559 &status("lart: error reading file?");
564 my $idx = "debian/Packages-sid.idx";
569 $error++ unless ( -e $idx);
570 $error++ unless ( -e "$idx-old");
573 $error = "no sid/sid-old index file found.";
574 &ERROR("Debian: $error");
580 open(IDX2, "$idx-old");
594 next if (exists $pkg{$_});
600 &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
606 if (!defined $chan) {
611 if (!&validChan($chan)) {
612 &msg($who, "chan $chan is invalid.");
616 if (scalar @vernick > scalar(keys %{ $channels{lc $chan}{''} })/4) {
617 &msg($who, "verstats already in progress for someone else.");
621 &msg($who, "Sending CTCP VERSION to $chan; results in 60s.");
622 $conn->ctcp("VERSION", $chan);
623 $cache{verstats}{chan} = $chan;
624 $cache{verstats}{who} = $who;
625 $cache{verstats}{msgType} = $msgType;
627 $conn->schedule(30, sub {
628 my $c = lc $cache{verstats}{chan};
631 foreach (keys %{ $channels{$c}{''} } ) {
632 next if (grep /^\Q$_\E$/i, @vernick);
633 push(@vernicktodo, $_);
639 $conn->schedule(60, sub {
641 my $c = lc $cache{verstats}{chan};
642 my $total = keys %{ $channels{$c}{''} };
644 $who = $cache{verstats}{who};
645 $msgType = $cache{verstats}{msgType};
646 delete $cache{verstats}; # sufficient?
648 foreach (keys %ver) {
649 $vtotal += scalar keys %{ $ver{$_} };
653 my $unknown = $total - $vtotal;
654 my $perc = sprintf("%.1f", $unknown * 100 / $total);
656 $sorted{$perc}{"unknown/cloak"} = "$unknown ($perc%)" if ($unknown);
658 foreach (keys %ver) {
659 my $count = scalar keys %{ $ver{$_} };
660 $perc = sprintf("%.01f", $count * 100 / $total);
661 $perc =~ s/.0$//; # lame compression.
663 $sorted{$perc}{$_} = "$count ($perc%)";
666 ### can be compressed to a map?
668 foreach ( sort { $b <=> $a } keys %sorted ) {
670 foreach (sort keys %{ $sorted{$perc} }) {
671 push(@list, "$_ - $sorted{$perc}{$_}");
675 # hack. this is one major downside to scheduling.
677 &performStrictReply( &formListReply(0, "IRC Client versions for $c ", @list) );
679 # clean up not-needed data structures.
689 last unless (scalar @vernicktodo);
691 my $n = shift(@vernicktodo);
692 $conn->ctcp("VERSION", $n);
695 return unless (scalar @vernicktodo);
697 $conn->schedule(3, \&verstats_flush() );
700 sub do_text_counters {
702 $itc =~ s/([^\w\s])/\\$1/g;
703 my $z = join '|', split ' ', $itc;
705 if ($msgType eq "privmsg" and $message =~ / ($mask{chan})$/) {
706 &DEBUG("ircTC: privmsg detected; chan = $1");
710 if ($message =~ /^_stats(\s+(\S+))$/i) {
716 if ($message =~ /^($z)stats(\s+(\S+))?$/i) {
723 # even more uglier with channel/time arguments.
725 # my $c = $chan || "PRIVATE";
726 my $where = "type=".&sqlQuote($type);
729 $where .= " AND channel=".&sqlQuote($c) if (defined $c);
731 &DEBUG("not using chan arg");
734 my $sum = (&sqlRawReturn("SELECT SUM(counter) FROM stats"
735 ." WHERE ".$where ))[0];
737 if (!defined $arg or $arg =~ /^\s*$/) {
740 # TODO: convert $where to hash
741 my %hash = &sqlSelectColHash("stats", "nick,counter",
743 $where." ORDER BY counter DESC LIMIT 3", 1
748 # unfortunately we have to sort it again!
750 foreach $i (sort { $b <=> $a } keys %hash) {
751 foreach (keys %{ $hash{$i} }) {
752 my $p = sprintf("%.01f", 100*$i/$sum);
754 push(@top, "\002$_\002 -- $i ($p%)");
759 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
763 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
765 &performStrictReply("zero counter for \037$type\037.");
768 # TODO: convert $where to hash and use a sqlSelect
769 my $x = (&sqlRawReturn("SELECT SUM(counter) FROM stats".
770 " WHERE $where AND nick=".&sqlQuote($arg) ))[0];
772 if (!defined $x) { # !defined.
773 &performStrictReply("$arg has not said $type yet.");
778 # TODO: convert $where to hash
779 my @array = &sqlSelect("stats", "nick", undef,
780 $where." ORDER BY counter", 1
784 for ($i=0; $i<scalar @array; $i++) {
785 next unless ($array[0] =~ /^\Q$who\E$/);
791 my $total = scalar(@array);
793 if ($total and $good) {
794 my $pct = sprintf("%.01f", 100*(1+$total-$i)/$total);
795 $xtra = ", ranked $i\002/\002$total (percentile: \002$pct\002 %)";
798 my $pct1 = sprintf("%.01f", 100*$x/$sum);
799 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
808 # even more uglier with channel/time arguments.
810 # my $c = $chan || "PRIVATE";
811 &DEBUG("not using chan arg") if (!defined $c);
813 # example of converting from RawReturn to sqlSelect.
814 my $where_href = (defined $c) ? { channel => $c } : "";
815 my $sum = &sqlSelect("stats", "SUM(counter)", $where_href);
817 if (!defined $arg or $arg =~ /^\s*$/) {
819 &DEBUG("_stats: !arg");
821 my %hash = &sqlSelectColHash("stats", "nick,counter",
823 " ORDER BY counter DESC LIMIT 3", 1
828 # unfortunately we have to sort it again!
830 foreach $i (sort { $b <=> $a } keys %hash) {
831 foreach (keys %{ $hash{$i} }) {
832 my $p = sprintf("%.01f", 100*$i/$sum);
834 push(@top, "\002$_\002 -- $i ($p%)");
840 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
844 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
846 &performStrictReply("zero counter for \037$type\037.");
852 # TODO: add nick to where_href
853 my %hash = &sqlSelectColHash("stats", "type,counter",
854 $where_href, " AND nick=".&sqlQuote($arg)
857 # this is totally messed up... needs to be fixed... and cleaned up.
863 foreach (keys %hash) {
864 &DEBUG("_stats: hash{$_} => $hash{$_}");
866 # TODO: convert $where to hash
868 my @array = &sqlSelect("stats", "nick", undef, $where." ORDER BY counter", 1);
871 for(my $i=0; $i<scalar @array; $i++) {
872 next unless ($array[0] =~ /^\Q$who\E$/);
878 $total = scalar(@array);
879 &DEBUG(" i => $i, good => $good, total => $total");
880 $x .= " ".$total."blah blah";
885 if (!defined $x) { # !defined.
886 &performStrictReply("$arg has not said $type yet.");
891 if ($total and $good) {
892 my $pct = sprintf("%.01f", 100*(1+$total-$ii)/$total);
893 $xtra = ", ranked $ii\002/\002$total (percentile: \002$pct\002 %)";
896 my $pct1 = sprintf("%.01f", 100*$x/$sum);
897 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
902 return unless (defined $arg);
904 #foreach (`$arg`) { &msg($who,$_); }
909 ### START ADDING HOOKS.
911 &addCmdHook('chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
912 &addCmdHook('cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
913 &addCmdHook('sched(stats|info)', ('CODEREF' => 'scheduleList', ) );
914 &addCmdHook('factinfo', ('CODEREF' => 'factinfo',
915 'Cmdstats' => 'Factoid Info', Module => 'Factoids', ) );
916 &addCmdHook('factstats?', ('CODEREF' => 'factstats',
917 'Cmdstats' => 'Factoid Stats', Help => "factstats",
918 Forker => 1, 'Identifier' => 'Factoids', ) );
919 &addCmdHook('help', ('CODEREF' => 'help',
920 'Cmdstats' => 'Help', ) );
921 &addCmdHook('karma', ('CODEREF' => 'karma', ) );
922 &addCmdHook('tell|explain', ('CODEREF' => 'tell',
923 Help => 'tell', Identifier => 'allowTelling',
924 Cmdstats => 'Tell') );
925 &addCmdHook('News', ('CODEREF' => 'News::Parse',
926 Module => 'News', 'Cmdstats' => 'News' ) );
927 &addCmdHook('countrystats', ('CODEREF' => 'countryStats',
931 &addCmdHook('d?bugs', ('CODEREF' => 'DebianExtra::Parse',
932 'Forker' => 1, 'Identifier' => 'DebianExtra',
933 'Cmdstats' => 'Debian Bugs') );
934 &addCmdHook('dauthor', ('CODEREF' => 'Debian::searchAuthor',
935 'Forker' => 1, 'Identifier' => 'Debian',
936 'Cmdstats' => 'Debian Author Search', 'Help' => "dauthor" ) );
937 &addCmdHook('(d|search)desc', ('CODEREF' => 'Debian::searchDescFE',
938 'Forker' => 1, 'Identifier' => 'Debian',
939 'Cmdstats' => 'Debian Desc Search', 'Help' => "ddesc" ) );
940 &addCmdHook('dnew', ('CODEREF' => 'DebianNew',
941 'Identifier' => 'Debian' ) );
942 &addCmdHook('dincoming', ('CODEREF' => 'Debian::generateIncoming',
943 'Forker' => 1, 'Identifier' => 'Debian' ) );
944 &addCmdHook('dstats', ('CODEREF' => 'Debian::infoStats',
945 'Forker' => 1, 'Identifier' => 'Debian',
946 'Cmdstats' => 'Debian Statistics' ) );
947 &addCmdHook('d?contents', ('CODEREF' => 'Debian::searchContents',
948 'Forker' => 1, 'Identifier' => 'Debian',
949 'Cmdstats' => 'Debian Contents Search', 'Help' => "contents" ) );
950 &addCmdHook('d?find', ('CODEREF' => 'Debian::DebianFind',
951 'Forker' => 1, 'Identifier' => 'Debian',
952 'Cmdstats' => 'Debian Search', 'Help' => "find" ) );
953 &addCmdHook('insult', ('CODEREF' => 'Insult::Insult',
954 'Forker' => 1, 'Identifier' => 'insult', 'Help' => "insult" ) );
955 &addCmdHook('kernel', ('CODEREF' => 'Kernel::Kernel',
956 'Forker' => 1, 'Identifier' => 'Kernel',
957 'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
958 &addCmdHook('listauth', ('CODEREF' => 'CmdListAuth',
959 'Identifier' => 'Search', Module => 'Factoids',
960 'Help' => 'listauth') );
961 &addCmdHook('quote', ('CODEREF' => 'Quote::Quote',
962 'Forker' => 1, 'Identifier' => 'Quote',
963 'Help' => 'quote', 'Cmdstats' => 'Quote') );
964 &addCmdHook('countdown', ('CODEREF' => 'countdown',
965 'Module' => 'countdown', 'Identifier' => 'countdown',
966 'Cmdstats' => 'countdown') );
967 &addCmdHook('lart', ('CODEREF' => 'lart',
968 'Identifier' => 'lart', 'Help' => 'lart') );
969 &addCmdHook('convert', ('CODEREF' => 'convert',
970 'Forker' => 1, 'Identifier' => 'Units',
971 'Help' => 'convert') );
972 &addCmdHook('(cookie|random)', ('CODEREF' => 'cookie',
973 'Forker' => 1, 'Identifier' => 'Factoids') );
974 &addCmdHook('u(ser)?info', ('CODEREF' => 'userinfo',
975 'Identifier' => 'UserInfo', 'Help' => 'userinfo',
976 'Module' => 'UserInfo') );
977 &addCmdHook('RootWarn', ('CODEREF' => 'CmdrootWarn',
978 'Identifier' => 'RootWarn', 'Module' => 'RootWarn') );
979 &addCmdHook('seen', ('CODEREF' => 'seen', 'Identifier' =>
981 &addCmdHook('Dict', ('CODEREF' => 'Dict::Dict',
982 'Identifier' => 'Dict', 'Help' => 'dict',
983 'Forker' => 1, 'Cmdstats' => 'Dict') );
984 &addCmdHook('slashdot', ('CODEREF' => 'Slashdot::Slashdot',
985 'Identifier' => 'slashdot', 'Forker' => 1,
986 'Cmdstats' => 'slashdot') );
987 &addCmdHook('Plug', ('CODEREF' => 'Plug::Plug',
988 'Identifier' => 'Plug', 'Forker' => 1,
989 'Cmdstats' => 'Plug') );
990 &addCmdHook('Uptime', ('CODEREF' => 'uptime', 'Identifier' => 'Uptime',
991 'Cmdstats' => 'Uptime') );
992 &addCmdHook('nullski', ('CODEREF' => 'nullski', ) );
993 &addCmdHook('verstats', ('CODEREF' => 'do_verstats' ) );
994 &addCmdHook('Weather', ('CODEREF' => 'Weather::Weather',
995 'Identifier' => 'Weather', 'Help' => 'weather',
996 'Cmdstats' => 'Weather', 'Forker' => 1) );
997 &addCmdHook('metar', ('CODEREF' => 'Weather::Metar',
998 'Identifier' => 'Weather', 'Help' => 'weather',
999 'Cmdstats' => 'Weather', 'Forker' => 1) );
1000 &addCmdHook('bzflist', ('CODEREF' => 'BZFlag::list',
1001 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
1003 &addCmdHook('bzflist17', ('CODEREF' => 'BZFlag::list17',
1004 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
1006 &addCmdHook('bzfquery', ('CODEREF' => 'BZFlag::query',
1007 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
1009 &addCmdHook('zfi', ('CODEREF' => 'zfi::query',
1010 'Identifier' => 'zfi', 'Cmdstats' => 'zfi',
1012 &addCmdHook('(zippy|yow)', ('CODEREF' => 'zippy::get',
1013 'Identifier' => 'Zippy', 'Cmdstats' => 'Zippy',
1015 &addCmdHook('zsi', ('CODEREF' => 'zsi::query',
1016 'Identifier' => 'zsi', 'Cmdstats' => 'zsi',
1018 &addCmdHook('(ex)?change', ('CODEREF' => 'Exchange::query',
1019 'Identifier' => 'Exchange', 'Cmdstats' => 'Exchange',
1021 &addCmdHook('(botmail|message)', ('CODEREF' => 'botmail::parse',
1022 'Identifier' => 'botmail', 'Cmdstats' => 'botmail') );
1023 &addCmdHook('HTTPDtype', ('CODEREF' => 'HTTPDtype::HTTPDtype',
1024 'Identifier' => 'HTTPDtype', 'Cmdstats' => 'HTTPDtype',
1026 &addCmdHook('scramble', ('CODEREF' => 'scramble::scramble',
1027 'Identifier' => 'scramble', 'Cmdstats' => 'scramble',
1028 'Forker' => 1, 'Module' => 'scramble') );
1029 &addCmdHook('md5(sum)?', ('CODEREF' => 'md5::md5',
1030 'Identifier' => 'md5', 'Cmdstats' => 'md5',
1032 &addCmdHook('Rss', ('CODEREF' => 'Rss::Rss',
1033 'Identifier' => 'Rss', 'Cmdstats' => 'Rss',
1034 'Forker' => 1, 'Help' => 'rss') );
1035 &addCmdHook('wiki(pedia)?', ('CODEREF' => 'wikipedia::wikipedia',
1036 'Identifier' => 'wikipedia', 'Cmdstats' => 'wikipedia',
1037 'Forker' => 1, 'Help' => 'wikipedia') );
1038 &addCmdHook('page', ('CODEREF' => 'pager::page',
1039 'Identifier' => 'pager', 'Cmdstats' => 'pager',
1040 'Forker' => 1, 'Help' => 'page') );
1041 &addCmdHook('(babel(fish)?|x|xlate|translate)', ('CODEREF' => 'babelfish::babelfish',
1042 'Identifier' => 'babelfish', 'Cmdstats' => 'babelfish',
1043 'Forker' => 1, 'Help' => 'babelfish', 'Module' => 'babelfish') );
1044 &addCmdHook('wtf', ('CODEREF' => 'wtf::query',
1045 'Identifier' => 'wtf', 'Cmdstats' => 'wtf',
1046 'Forker' => 1, 'Help' => 'wtf') );
1047 &addCmdHook('[ia]?spell', ('CODEREF' => 'spell::query',
1048 'Identifier' => 'spell', 'Cmdstats' => 'spell',
1049 'Forker' => 1, 'Help' => 'spell') );
1050 &addCmdHook('dns|d?nslookup', ('CODEREF' => 'dns::query',
1051 'Identifier' => 'dns', 'Cmdstats' => 'dns',
1052 'Forker' => 1, 'Help' => 'dns') );
1053 &addCmdHook('piglatin', ('CODEREF' => 'piglatin::piglatin',
1054 'Identifier' => 'piglatin', 'Cmdstats' => 'piglatin',
1057 ### END OF ADDING HOOKS.
1059 &status("CMD: loaded ".scalar(keys %cmdhooks)." command hooks.");