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 ### COMMAND HOOK IMPLEMENTATION.
17 # addCmdHook('TEXT_HOOK',
20 # Module => 'blah.pl' # preload module.
21 # Identifier => 'config_label', # change to Config?
22 # Help => 'help_label',
23 # Cmdstats => 'text_label',)
28 my ($ident, %hash) = @_;
30 if (exists $cmdhooks{$ident}) {
31 &WARN("aCH: \$cmdhooks{$ident} already exists.");
35 &VERB("aCH: added $ident",2); # use $hash{'Identifier'}?
36 ### hrm... prevent warnings?
37 $cmdhooks{$ident} = \%hash;
43 $line =~ s/^\s+|\s+$//g; # again.
44 $line =~ /^(\S+)(\s+(.*))?$/;
45 my $cmd = $1; # command name is whitespaceless.
47 my @args = split(/\s+/, $flatarg || '');
52 if (!defined %cmdhooks) {
53 &WARN('%cmdhooks does not exist.');
58 &WARN("cstubs: cmd == NULL.");
62 foreach (keys %cmdhooks) {
63 # rename to something else! like $id or $label?
66 next unless ($cmd =~ /^$ident$/i);
69 &WARN("pCH: Multiple hook match: $ident");
73 &status("cmdhooks: $cmd matched '$ident' '$flatarg'");
74 my %hash = %{ $cmdhooks{$ident} };
76 if (!scalar keys %hash) {
77 &WARN("CmdHook: hash is NULL?");
81 if ($hash{NoArgs} and $flatarg) {
82 &DEBUG("cmd $ident does not take args ('$flatarg'); skipping.");
86 if (!exists $hash{CODEREF}) {
87 &ERROR("CODEREF undefined for $cmd or $ident.");
92 foreach (keys %hash) {
93 &VERB(" $cmd->$_ => '$hash{$_}'.",2);
97 if (exists $hash{'Help'} and !scalar(@args)) {
98 &help( $hash{'Help'} );
103 if (exists $hash{'Identifier'}) {
104 return 1 unless (&IsChanConfOrWarn($hash{'Identifier'}));
108 if (exists $hash{'UserFlag'}) {
109 return 1 unless (&hasFlag($hash{'UserFlag'}));
112 ### FORKER,IDENTIFIER,CODEREF.
113 if (($$ == $bot_pid) && exists $hash{'Forker'}) {
114 $hash{'Identifier'} .= "-" if ($hash{'Forker'} eq "NULL");
116 if (exists $hash{'ArrayArgs'}) {
117 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }(@args) } );
119 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }($flatarg) } );
123 if (exists $hash{'Module'}) {
124 &loadMyModule($hash{'Module'});
127 # check if CODEREF exists.
128 if (!defined &{ $hash{'CODEREF'} }) {
129 &WARN("coderef $hash{'CODEREF'} does not exist.");
131 &msg($who, "coderef does not exist for $ident.");
137 if (exists $hash{'ArrayArgs'}) {
138 &{ $hash{'CODEREF'} }(@args);
140 &{ $hash{'CODEREF'} }($flatarg);
145 if (exists $hash{'Cmdstats'}) {
146 $cmdstats{ $hash{'Cmdstats'} }++;
149 &VERB("hooks: End of command.",2);
159 if (!defined $message) {
160 &WARN("Modules: message is undefined. should never happen.");
164 my $debiancmd = 'conflicts?|depends?|desc|file|(?:d)?info|provides?';
165 $debiancmd .= '|recommends?|suggests?|maint|maintainer';
167 if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
168 return unless (&IsChanConfOrWarn('Debian'));
171 if (defined $package) {
172 &Forker('Debian', sub { &Debian::infoPackages($1, $package); } );
180 # google searching. Simon++
181 my $w3search_regex = "google";
182 if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
183 return unless (&IsChanConfOrWarn('W3Search'));
185 &Forker('W3Search', sub { &W3Search::W3Search($1,$2); } );
187 $cmdstats{'W3Search'}++;
191 # text counters. (eg: hehstats)
193 $itc = &getChanConf('ircTextCounters');
194 $itc = &findChanConf('ircTextCounters') unless ($itc);
195 return if ($itc && &do_text_counters($itc) == 1);
196 # end of text counters.
198 # list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
199 if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
200 return unless (&IsChanConfOrWarn('Search'));
205 $thiscmd =~ s/^vals$/values/;
206 return if ($thiscmd ne 'keys' && $thiscmd ne 'values');
209 if (!defined $args or $args =~ /^\s*$/) {
210 &help('list'. $thiscmd);
214 # suggested by asuffield and \broken.
215 if ($args =~ /^["']/ and $args =~ /["']$/) {
216 &DEBUG('list*: removed quotes.');
217 $args =~ s/^["']|["']$//g;
220 if (length $args < 2 && &IsFlag('o') ne 'o') {
221 &msg($who, 'search string is too short.');
225 &Forker('Search', sub { &Search::Search($thiscmd, $args); } );
227 $cmdstats{'Factoid Search'}++;
231 # Topic management. xk++
232 # may want to add a userflags for topic. -xk
233 if ($message =~ /^topic(\s+(.*))?$/i) {
234 return unless (&IsChanConfOrWarn('Topic'));
236 my $chan = $talkchannel;
237 my @args = split / /, $2 || "";
240 &msg($who,"Try 'help topic'");
244 $chan = lc(shift @args) if ($msgType eq 'private');
245 my $thiscmd = shift @args;
248 if ($msgType eq 'public' && $thiscmd =~ /^#/) {
249 &msg($who, "error: channel argument is not required.");
250 &msg($who, "\002Usage\002: topic <CMD>");
254 # topic over private:
255 if ($msgType eq 'private' && $chan !~ /^#/) {
256 &msg($who, "error: channel argument is required.");
257 &msg($who, "\002Usage\002: topic #channel <CMD>");
261 if (&validChan($chan) == 0) {
262 &msg($who,"error: invalid channel \002$chan\002");
266 # for semi-outsiders.
267 if (!&IsNickInChan($who,$chan)) {
268 &msg($who, "Failed. You ($who) are not in $chan, hey?");
273 &loadMyModule('Topic');
274 &Topic($chan, $thiscmd, join(' ', @args));
275 $cmdstats{'Topic'}++;
280 if ($message =~ /^wingate$/i) {
281 return unless (&IsChanConfOrWarn('Wingate'));
283 my $reply = "Wingate statistics: scanned \002"
284 .scalar(keys %wingateToDo)."\002 hosts";
285 my $queue = scalar(keys %wingateToDo);
287 $reply .= ". I have \002$queue\002 hosts in the queue";
288 $reply .= ". Started the scan ".&Time2String(time() - $wingaterun)." ago";
291 &performStrictReply("$reply.");
296 # do nothing and let the other routines have a go
303 &msg($who, "- Uptime for $ident -");
304 &msg($who, "Now: ". &Time2String(&uptimeNow()) ." running $bot_version");
306 foreach (&uptimeGetInfo()) {
308 my $time = &Time2String($1);
311 &msg($who, "$count: $time $2");
318 my($person) = lc shift;
321 if (!defined $person or $person =~ /^$/) {
324 my $i = &countKeys("seen");
325 &msg($who,"there ". &fixPlural("is",$i) ." \002$i\002 ".
326 "seen ". &fixPlural("entry",$i) ." that I know of.");
333 &seenFlush(); # very evil hack. oh well, better safe than sorry.
335 # TODO: convert to &sqlSelectRowHash();
336 my $select = "nick,time,channel,host,message";
337 if ($person eq "random") {
338 @seen = &randKey("seen", $select);
340 @seen = &sqlSelect("seen", $select, { nick => $person } );
343 if (scalar @seen < 2) {
345 &DEBUG("seen: _ => '$_'.");
347 &performReply("i haven't seen '$person'");
353 ### TODO: multi channel support. may require &IsNick() to return
354 ### all channels or something.
356 my @chans = &getNickInChans($seen[0]);
358 $reply = "$seen[0] is currently on";
362 next unless (exists $userstats{lc $seen[0]}{'Join'});
363 $reply .= " (".&Time2String(time() - $userstats{lc $seen[0]}{'Join'}).")";
366 if (&IsChanConf("seenStats") > 0) {
368 $i = $userstats{lc $seen[0]}{'Count'};
369 $reply .= ". Has said a total of \002$i\002 messages" if (defined $i);
370 $i = $userstats{lc $seen[0]}{'Time'};
371 $reply .= ". Is idling for ".&Time2String(time() - $i) if (defined $i);
374 my $howlong = &Time2String(time() - $seen[1]);
375 $reply = "$seen[0] <$seen[3]> was last seen on IRC ".
376 "in channel $seen[2], $howlong ago, ".
377 "saying\002:\002 '$seen[4]'.";
380 &performStrictReply($reply);
384 # User Information Services. requested by Flugh.
386 my ($arg) = join(' ',@_);
388 if ($arg =~ /^set(\s+(.*))?$/i) {
391 &help('userinfo set');
395 &UserInfoSet(split /\s+/, $arg, 2);
396 } elsif ($arg =~ /^unset(\s+(.*))?$/i) {
399 &help('userinfo unset');
403 &UserInfoSet($arg, '');
409 # cookie (random). xk++
413 # lets find that secret cookie.
414 my $target = ($msgType ne 'public') ? $who : $talkchannel;
415 my $cookiemsg = &getRandom(keys %{ $lang{'cookie'} });
418 ### WILL CHEW TONS OF MEM.
419 ### TODO: convert this to a Forker function!
421 my @list = &searchTable("factoids", "factoid_key", "factoid_value", $arg);
422 $key = &getRandom(@list);
423 $value = &getFactInfo($key, "factoid_value");
425 ($key,$value) = &randKey("factoids","factoid_key,factoid_value");
429 s/##KEY/\002$key\002/;
432 s/\$who/$who/; # cheap fix.
433 s/(\S+)?\s*<\S+>/$1 /;
437 if ($cookiemsg =~ s/^ACTION //i) {
438 &action($target, $cookiemsg);
440 &msg($target, $cookiemsg);
445 my $arg = join(' ',@_);
446 my ($from,$to) = ('','');
448 ($from,$to) = ($1,$2) if ($arg =~ /^(.*?) to (.*)$/i);
449 ($from,$to) = ($2,$1) if ($arg =~ /^(.*?) from (.*)$/i);
451 if (!$to or !$from) {
452 &msg($who, "Invalid format!");
457 &Units::convertUnits($from, $to);
463 my ($target) = &fixString($_[0]);
465 my $chan = $talkchannel;
468 if ($msgType eq 'private') {
469 if ($target =~ /^($mask{chan})\s+(.*)$/) {
474 &msg($who, "error: invalid format or missing arguments.");
479 if ($target =~ /^(.*)(\s+for\s+.*)$/) {
484 my $line = &getRandomLineFromFile($bot_data_dir. "/blootbot.lart");
486 if ($target =~ /^(me|you|itself|\Q$ident\E)$/i) {
487 $line =~ s/WHO/$who/g;
489 $line =~ s/WHO/$target/g;
491 $line .= $for if ($for);
492 $line .= ", courtesy of $who" if ($extra);
494 &action($chan, $line);
496 &status("lart: error reading file?");
501 my $idx = "debian/Packages-sid.idx";
506 $error++ unless ( -e $idx);
507 $error++ unless ( -e "$idx-old");
510 $error = "no sid/sid-old index file found.";
511 &ERROR("Debian: $error");
517 open(IDX2, "$idx-old");
531 next if (exists $pkg{$_});
537 &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
543 if (!defined $chan) {
548 if (!&validChan($chan)) {
549 &msg($who, "chan $chan is invalid.");
553 if (scalar @vernick > scalar(keys %{ $channels{lc $chan}{''} })/4) {
554 &msg($who, "verstats already in progress for someone else.");
558 &msg($who, "Sending CTCP VERSION to $chan; results in 60s.");
559 $conn->ctcp("VERSION", $chan);
560 $cache{verstats}{chan} = $chan;
561 $cache{verstats}{who} = $who;
562 $cache{verstats}{msgType} = $msgType;
564 $conn->schedule(30, sub {
565 my $c = lc $cache{verstats}{chan};
568 foreach (keys %{ $channels{$c}{''} } ) {
569 next if (grep /^\Q$_\E$/i, @vernick);
570 push(@vernicktodo, $_);
576 $conn->schedule(60, sub {
578 my $c = lc $cache{verstats}{chan};
579 my $total = keys %{ $channels{$c}{''} };
581 $who = $cache{verstats}{who};
582 $msgType = $cache{verstats}{msgType};
583 delete $cache{verstats}; # sufficient?
585 foreach (keys %ver) {
586 $vtotal += scalar keys %{ $ver{$_} };
590 my $unknown = $total - $vtotal;
591 my $perc = sprintf("%.1f", $unknown * 100 / $total);
593 $sorted{$perc}{"unknown/cloak"} = "$unknown ($perc%)" if ($unknown);
595 foreach (keys %ver) {
596 my $count = scalar keys %{ $ver{$_} };
597 $perc = sprintf("%.01f", $count * 100 / $total);
598 $perc =~ s/.0$//; # lame compression.
600 $sorted{$perc}{$_} = "$count ($perc%)";
603 ### can be compressed to a map?
605 foreach ( sort { $b <=> $a } keys %sorted ) {
607 foreach (sort keys %{ $sorted{$perc} }) {
608 push(@list, "$_ - $sorted{$perc}{$_}");
612 # hack. this is one major downside to scheduling.
614 &performStrictReply( &formListReply(0, "IRC Client versions for $c ", @list) );
616 # clean up not-needed data structures.
626 last unless (scalar @vernicktodo);
628 my $n = shift(@vernicktodo);
629 $conn->ctcp("VERSION", $n);
632 return unless (scalar @vernicktodo);
634 $conn->schedule(3, \&verstats_flush() );
637 sub do_text_counters {
639 $itc =~ s/([^\w\s])/\\$1/g;
640 my $z = join '|', split ' ', $itc;
642 if ($msgType eq "privmsg" and $message =~ / ($mask{chan})$/) {
643 &DEBUG("ircTC: privmsg detected; chan = $1");
647 if ($message =~ /^_stats(\s+(\S+))$/i) {
653 if ($message =~ /^($z)stats(\s+(\S+))?$/i) {
660 # even more uglier with channel/time arguments.
662 # my $c = $chan || "PRIVATE";
663 my $where = "type=".&sqlQuote($type);
666 $where .= " AND channel=".&sqlQuote($c) if (defined $c);
668 &DEBUG("not using chan arg");
671 my $sum = (&sqlRawReturn("SELECT SUM(counter) FROM stats"
672 ." WHERE ".$where ))[0];
674 if (!defined $arg or $arg =~ /^\s*$/) {
677 # TODO: convert $where to hash
678 my %hash = &sqlSelectColHash("stats", "nick,counter",
680 $where." ORDER BY counter DESC LIMIT 3", 1
685 # unfortunately we have to sort it again!
687 foreach $i (sort { $b <=> $a } keys %hash) {
688 foreach (keys %{ $hash{$i} }) {
689 my $p = sprintf("%.01f", 100*$i/$sum);
691 push(@top, "\002$_\002 -- $i ($p%)");
696 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
700 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
702 &performStrictReply("zero counter for \037$type\037.");
705 # TODO: convert $where to hash and use a sqlSelect
706 my $x = (&sqlRawReturn("SELECT SUM(counter) FROM stats".
707 " WHERE $where AND nick=".&sqlQuote($arg) ))[0];
709 if (!defined $x) { # !defined.
710 &performStrictReply("$arg has not said $type yet.");
715 # TODO: convert $where to hash
716 my @array = &sqlSelect("stats", "nick", undef,
717 $where." ORDER BY counter", 1
721 for ($i=0; $i<scalar @array; $i++) {
722 next unless ($array[0] =~ /^\Q$who\E$/);
728 my $total = scalar(@array);
730 if ($total and $good) {
731 my $pct = sprintf("%.01f", 100*(1+$total-$i)/$total);
732 $xtra = ", ranked $i\002/\002$total (percentile: \002$pct\002 %)";
735 my $pct1 = sprintf("%.01f", 100*$x/$sum);
736 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
745 # even more uglier with channel/time arguments.
747 # my $c = $chan || "PRIVATE";
748 &DEBUG("not using chan arg") if (!defined $c);
750 # example of converting from RawReturn to sqlSelect.
751 my $where_href = (defined $c) ? { channel => $c } : "";
752 my $sum = &sqlSelect("stats", "SUM(counter)", $where_href);
754 if (!defined $arg or $arg =~ /^\s*$/) {
756 &DEBUG("_stats: !arg");
758 my %hash = &sqlSelectColHash("stats", "nick,counter",
760 " ORDER BY counter DESC LIMIT 3", 1
765 # unfortunately we have to sort it again!
767 foreach $i (sort { $b <=> $a } keys %hash) {
768 foreach (keys %{ $hash{$i} }) {
769 my $p = sprintf("%.01f", 100*$i/$sum);
771 push(@top, "\002$_\002 -- $i ($p%)");
777 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
781 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
783 &performStrictReply("zero counter for \037$type\037.");
789 # TODO: add nick to where_href
790 my %hash = &sqlSelectColHash("stats", "type,counter",
791 $where_href, " AND nick=".&sqlQuote($arg)
794 # this is totally messed up... needs to be fixed... and cleaned up.
800 foreach (keys %hash) {
801 &DEBUG("_stats: hash{$_} => $hash{$_}");
803 # TODO: convert $where to hash
805 my @array = &sqlSelect("stats", "nick", undef, $where." ORDER BY counter", 1);
808 for(my $i=0; $i<scalar @array; $i++) {
809 next unless ($array[0] =~ /^\Q$who\E$/);
815 $total = scalar(@array);
816 &DEBUG(" i => $i, good => $good, total => $total");
817 $x .= " ".$total."blah blah";
822 if (!defined $x) { # !defined.
823 &performStrictReply("$arg has not said $type yet.");
828 if ($total and $good) {
829 my $pct = sprintf("%.01f", 100*(1+$total-$ii)/$total);
830 $xtra = ", ranked $ii\002/\002$total (percentile: \002$pct\002 %)";
833 my $pct1 = sprintf("%.01f", 100*$x/$sum);
834 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
839 return unless (defined $arg);
841 #foreach (`$arg`) { &msg($who,$_); }
846 ### START ADDING HOOKS.
848 &addCmdHook('chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
849 &addCmdHook('cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
850 &addCmdHook('sched(stats|info)', ('CODEREF' => 'scheduleList', ) );
851 &addCmdHook('factinfo', ('CODEREF' => 'factinfo',
852 'Cmdstats' => 'Factoid Info', Module => 'Factoids', ) );
853 &addCmdHook('factstats?', ('CODEREF' => 'factstats',
854 'Cmdstats' => 'Factoid Stats', Help => "factstats",
855 Forker => 1, 'Identifier' => 'Factoids', ) );
856 &addCmdHook('help', ('CODEREF' => 'help',
857 'Cmdstats' => 'Help', ) );
858 &addCmdHook('karma', ('CODEREF' => 'karma', ) );
859 &addCmdHook('tell|explain', ('CODEREF' => 'tell',
860 Help => 'tell', Identifier => 'allowTelling',
861 Cmdstats => 'Tell') );
862 &addCmdHook('News', ('CODEREF' => 'News::Parse',
863 Module => 'News', 'Cmdstats' => 'News' ) );
864 &addCmdHook('countrystats', ('CODEREF' => 'countryStats',
868 &addCmdHook('d?bugs', ('CODEREF' => 'DebianExtra::Parse',
869 'Forker' => 1, 'Identifier' => 'DebianExtra',
870 'Cmdstats' => 'Debian Bugs') );
871 &addCmdHook('dauthor', ('CODEREF' => 'Debian::searchAuthor',
872 'Forker' => 1, 'Identifier' => 'Debian',
873 'Cmdstats' => 'Debian Author Search', 'Help' => "dauthor" ) );
874 &addCmdHook('(d|search)desc', ('CODEREF' => 'Debian::searchDescFE',
875 'Forker' => 1, 'Identifier' => 'Debian',
876 'Cmdstats' => 'Debian Desc Search', 'Help' => "ddesc" ) );
877 &addCmdHook('dnew', ('CODEREF' => 'DebianNew',
878 'Identifier' => 'Debian' ) );
879 &addCmdHook('dincoming', ('CODEREF' => 'Debian::generateIncoming',
880 'Forker' => 1, 'Identifier' => 'Debian' ) );
881 &addCmdHook('dstats', ('CODEREF' => 'Debian::infoStats',
882 'Forker' => 1, 'Identifier' => 'Debian',
883 'Cmdstats' => 'Debian Statistics' ) );
884 &addCmdHook('d?contents', ('CODEREF' => 'Debian::searchContents',
885 'Forker' => 1, 'Identifier' => 'Debian',
886 'Cmdstats' => 'Debian Contents Search', 'Help' => "contents" ) );
887 &addCmdHook('d?find', ('CODEREF' => 'Debian::DebianFind',
888 'Forker' => 1, 'Identifier' => 'Debian',
889 'Cmdstats' => 'Debian Search', 'Help' => "find" ) );
890 &addCmdHook('insult', ('CODEREF' => 'Insult::Insult',
891 'Forker' => 1, 'Identifier' => 'insult', 'Help' => "insult" ) );
892 &addCmdHook('kernel', ('CODEREF' => 'Kernel::Kernel',
893 'Forker' => 1, 'Identifier' => 'Kernel',
894 'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
895 &addCmdHook('listauth', ('CODEREF' => 'CmdListAuth',
896 'Identifier' => 'Search', Module => 'Factoids',
897 'Help' => 'listauth') );
898 &addCmdHook('quote', ('CODEREF' => 'Quote::Quote',
899 'Forker' => 1, 'Identifier' => 'Quote',
900 'Help' => 'quote', 'Cmdstats' => 'Quote') );
901 &addCmdHook('countdown', ('CODEREF' => 'countdown',
902 'Module' => 'countdown', 'Identifier' => 'countdown',
903 'Cmdstats' => 'countdown') );
904 &addCmdHook('lart', ('CODEREF' => 'lart',
905 'Identifier' => 'lart', 'Help' => 'lart') );
906 &addCmdHook('convert', ('CODEREF' => 'convert',
907 'Forker' => 1, 'Identifier' => 'Units',
908 'Help' => 'convert') );
909 &addCmdHook('(cookie|random)', ('CODEREF' => 'cookie',
910 'Forker' => 1, 'Identifier' => 'Factoids') );
911 &addCmdHook('u(ser)?info', ('CODEREF' => 'userinfo',
912 'Identifier' => 'UserInfo', 'Help' => 'userinfo',
913 'Module' => 'UserInfo') );
914 &addCmdHook('RootWarn', ('CODEREF' => 'CmdrootWarn',
915 'Identifier' => 'RootWarn', 'Module' => 'RootWarn') );
916 &addCmdHook('seen', ('CODEREF' => 'seen', 'Identifier' =>
918 &addCmdHook('Dict', ('CODEREF' => 'Dict::Dict',
919 'Identifier' => 'Dict', 'Help' => 'dict',
920 'Forker' => 1, 'Cmdstats' => 'Dict') );
921 &addCmdHook('slashdot', ('CODEREF' => 'Slashdot::Slashdot',
922 'Identifier' => 'slashdot', 'Forker' => 1,
923 'Cmdstats' => 'slashdot') );
924 &addCmdHook('Plug', ('CODEREF' => 'Plug::Plug',
925 'Identifier' => 'Plug', 'Forker' => 1,
926 'Cmdstats' => 'Plug') );
927 &addCmdHook('Uptime', ('CODEREF' => 'uptime', 'Identifier' => 'Uptime',
928 'Cmdstats' => 'Uptime') );
929 &addCmdHook('nullski', ('CODEREF' => 'nullski', ) );
930 &addCmdHook('verstats', ('CODEREF' => 'do_verstats' ) );
931 &addCmdHook('Weather', ('CODEREF' => 'Weather::Weather',
932 'Identifier' => 'Weather', 'Help' => 'weather',
933 'Cmdstats' => 'Weather', 'Forker' => 1) );
934 &addCmdHook('metar', ('CODEREF' => 'Weather::Metar',
935 'Identifier' => 'Weather', 'Help' => 'weather',
936 'Cmdstats' => 'Weather', 'Forker' => 1) );
937 &addCmdHook('bzflist', ('CODEREF' => 'BZFlag::list',
938 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
940 &addCmdHook('bzflist17', ('CODEREF' => 'BZFlag::list17',
941 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
943 &addCmdHook('bzfquery', ('CODEREF' => 'BZFlag::query',
944 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag',
946 &addCmdHook('zfi', ('CODEREF' => 'zfi::query',
947 'Identifier' => 'zfi', 'Cmdstats' => 'zfi',
949 &addCmdHook('(zippy|yow)', ('CODEREF' => 'zippy::get',
950 'Identifier' => 'Zippy', 'Cmdstats' => 'Zippy',
952 &addCmdHook('zsi', ('CODEREF' => 'zsi::query',
953 'Identifier' => 'zsi', 'Cmdstats' => 'zsi',
955 &addCmdHook('(ex)?change', ('CODEREF' => 'Exchange::query',
956 'Identifier' => 'Exchange', 'Cmdstats' => 'Exchange',
958 &addCmdHook('(botmail|message)', ('CODEREF' => 'botmail::parse',
959 'Identifier' => 'botmail', 'Cmdstats' => 'botmail') );
960 &addCmdHook('HTTPDtype', ('CODEREF' => 'HTTPDtype::HTTPDtype',
961 'Identifier' => 'HTTPDtype', 'Cmdstats' => 'HTTPDtype',
963 &addCmdHook('scramble', ('CODEREF' => 'scramble::scramble',
964 'Identifier' => 'scramble', 'Cmdstats' => 'scramble',
965 'Forker' => 1, 'Module' => 'scramble') );
966 &addCmdHook('md5(sum)?', ('CODEREF' => 'md5::md5',
967 'Identifier' => 'md5', 'Cmdstats' => 'md5',
969 &addCmdHook('Rss', ('CODEREF' => 'Rss::Rss',
970 'Identifier' => 'Rss', 'Cmdstats' => 'Rss',
971 'Forker' => 1, 'Help' => 'rss') );
972 &addCmdHook('wiki(pedia)?', ('CODEREF' => 'wikipedia::wikipedia',
973 'Identifier' => 'wikipedia', 'Cmdstats' => 'wikipedia',
974 'Forker' => 1, 'Help' => 'wikipedia') );
975 &addCmdHook('page', ('CODEREF' => 'pager::page',
976 'Identifier' => 'pager', 'Cmdstats' => 'pager',
977 'Forker' => 1, 'Help' => 'page') );
978 &addCmdHook('(babel(fish)?|x|xlate|translate)', ('CODEREF' => 'babelfish::babelfish',
979 'Identifier' => 'babelfish', 'Cmdstats' => 'babelfish',
980 'Forker' => 1, 'Help' => 'babelfish', 'Module' => 'babelfish') );
981 &addCmdHook('wtf', ('CODEREF' => 'wtf::query',
982 'Identifier' => 'wtf', 'Cmdstats' => 'wtf',
983 'Forker' => 1, 'Help' => 'wtf') );
984 &addCmdHook('[ia]?spell', ('CODEREF' => 'spell::query',
985 'Identifier' => 'spell', 'Cmdstats' => 'spell',
986 'Forker' => 1, 'Help' => 'spell') );
987 &addCmdHook('dns|d?nslookup', ('CODEREF' => 'dns::query',
988 'Identifier' => 'dns', 'Cmdstats' => 'dns',
989 'Forker' => 1, 'Help' => 'dns') );
990 &addCmdHook('piglatin', ('CODEREF' => 'piglatin::piglatin',
991 'Identifier' => 'piglatin', 'Cmdstats' => 'piglatin',
993 &addCmdHook('(?:lame|nick)ometer(?: for)?', ('CODEREF' => 'nickometer::query',
994 'Identifier' => 'nickometer', 'Cmdstats' => 'nickometer',
997 ### END OF ADDING HOOKS.
999 &status("CMD: loaded ".scalar(keys %cmdhooks)." command hooks.");