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 if (exists $hash{'ArrayArgs'}) {
115 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }(@args) } );
117 &Forker($hash{'Identifier'}, sub { \&{ $hash{'CODEREF'} }($flatarg) } );
121 if (exists $hash{'Module'}) {
122 &loadMyModule($hash{'Module'});
125 # check if CODEREF exists.
126 if (!defined &{ $hash{'CODEREF'} }) {
127 &WARN("coderef $hash{'CODEREF'} does not exist.");
129 &msg($who, "coderef does not exist for $ident.");
135 if (exists $hash{'ArrayArgs'}) {
136 &{ $hash{'CODEREF'} }(@args);
138 &{ $hash{'CODEREF'} }($flatarg);
143 if (exists $hash{'Cmdstats'}) {
144 $cmdstats{ $hash{'Cmdstats'} }++;
147 &VERB("hooks: End of command.",2);
157 if (!defined $message) {
158 &WARN("Modules: message is undefined. should never happen.");
162 my $debiancmd = 'conflicts?|depends?|desc|file|(?:d)?info|provides?';
163 $debiancmd .= '|recommends?|suggests?|maint|maintainer';
165 if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
166 return unless (&IsChanConfOrWarn('Debian'));
169 if (defined $package) {
170 &Forker('Debian', sub { &Debian::infoPackages($1, $package); } );
178 # google searching. Simon++
179 my $w3search_regex = "google";
180 if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
181 return unless (&IsChanConfOrWarn('W3Search'));
183 &Forker('W3Search', sub { &W3Search::W3Search($1,$2); } );
185 $cmdstats{'W3Search'}++;
189 # text counters. (eg: hehstats)
191 $itc = &getChanConf('ircTextCounters');
192 $itc = &findChanConf('ircTextCounters') unless ($itc);
193 return if ($itc && &do_text_counters($itc) == 1);
194 # end of text counters.
196 # list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
197 if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
198 return unless (&IsChanConfOrWarn('Search'));
203 $thiscmd =~ s/^vals$/values/;
204 return if ($thiscmd ne 'keys' && $thiscmd ne 'values');
207 if (!defined $args or $args =~ /^\s*$/) {
208 &help('list'. $thiscmd);
212 # suggested by asuffield and \broken.
213 if ($args =~ /^["']/ and $args =~ /["']$/) {
214 &DEBUG('list*: removed quotes.');
215 $args =~ s/^["']|["']$//g;
218 if (length $args < 2 && &IsFlag('o') ne 'o') {
219 &msg($who, 'search string is too short.');
223 &Forker('Search', sub { &Search::Search($thiscmd, $args); } );
225 $cmdstats{'Factoid Search'}++;
229 # Topic management. xk++
230 # may want to add a userflags for topic. -xk
231 if ($message =~ /^topic(\s+(.*))?$/i) {
232 return unless (&IsChanConfOrWarn('Topic'));
234 my $chan = $talkchannel;
235 my @args = split / /, $2 || "";
238 &msg($who,"Try 'help topic'");
242 $chan = lc(shift @args) if ($msgType eq 'private');
243 my $thiscmd = shift @args;
246 if ($msgType eq 'public' && $thiscmd =~ /^#/) {
247 &msg($who, "error: channel argument is not required.");
248 &msg($who, "\002Usage\002: topic <CMD>");
252 # topic over private:
253 if ($msgType eq 'private' && $chan !~ /^#/) {
254 &msg($who, "error: channel argument is required.");
255 &msg($who, "\002Usage\002: topic #channel <CMD>");
259 if (&validChan($chan) == 0) {
260 &msg($who,"error: invalid channel \002$chan\002");
264 # for semi-outsiders.
265 if (!&IsNickInChan($who,$chan)) {
266 &msg($who, "Failed. You ($who) are not in $chan, hey?");
271 &loadMyModule('Topic');
272 &Topic($chan, $thiscmd, join(' ', @args));
273 $cmdstats{'Topic'}++;
278 if ($message =~ /^wingate$/i) {
279 return unless (&IsChanConfOrWarn('Wingate'));
281 my $reply = "Wingate statistics: scanned \002"
282 .scalar(keys %wingateToDo)."\002 hosts";
283 my $queue = scalar(keys %wingateToDo);
285 $reply .= ". I have \002$queue\002 hosts in the queue";
286 $reply .= ". Started the scan ".&Time2String(time() - $wingaterun)." ago";
289 &performStrictReply("$reply.");
294 # do nothing and let the other routines have a go
301 &msg($who, "- Uptime for $ident -");
302 &msg($who, "Now: ". &Time2String(&uptimeNow()) ." running $bot_version");
304 foreach (&uptimeGetInfo()) {
306 my $time = &Time2String($1);
309 &msg($who, "$count: $time $2");
316 my($person) = lc shift;
319 if (!defined $person or $person =~ /^$/) {
322 my $i = &countKeys("seen");
323 &msg($who,"there ". &fixPlural("is",$i) ." \002$i\002 ".
324 "seen ". &fixPlural("entry",$i) ." that I know of.");
331 &seenFlush(); # very evil hack. oh well, better safe than sorry.
333 # TODO: convert to &sqlSelectRowHash();
334 my $select = "nick,time,channel,host,message";
335 if ($person eq "random") {
336 @seen = &randKey("seen", $select);
338 @seen = &sqlSelect("seen", $select, { nick => $person } );
341 if (scalar @seen < 2) {
343 &DEBUG("seen: _ => '$_'.");
345 &performReply("i haven't seen '$person'");
351 ### TODO: multi channel support. may require &IsNick() to return
352 ### all channels or something.
354 my @chans = &getNickInChans($seen[0]);
356 $reply = "$seen[0] is currently on";
360 next unless (exists $userstats{lc $seen[0]}{'Join'});
361 $reply .= " (".&Time2String(time() - $userstats{lc $seen[0]}{'Join'}).")";
364 if (&IsChanConf("seenStats") > 0) {
366 $i = $userstats{lc $seen[0]}{'Count'};
367 $reply .= ". Has said a total of \002$i\002 messages" if (defined $i);
368 $i = $userstats{lc $seen[0]}{'Time'};
369 $reply .= ". Is idling for ".&Time2String(time() - $i) if (defined $i);
372 my $howlong = &Time2String(time() - $seen[1]);
373 $reply = "$seen[0] <$seen[3]> was last seen on IRC ".
374 "in channel $seen[2], $howlong ago, ".
375 "saying\002:\002 '$seen[4]'.";
378 &performStrictReply($reply);
382 # User Information Services. requested by Flugh.
384 my ($arg) = join(' ',@_);
386 if ($arg =~ /^set(\s+(.*))?$/i) {
389 &help('userinfo set');
393 &UserInfoSet(split /\s+/, $arg, 2);
394 } elsif ($arg =~ /^unset(\s+(.*))?$/i) {
397 &help('userinfo unset');
401 &UserInfoSet($arg, '');
407 # cookie (random). xk++
411 # lets find that secret cookie.
412 my $target = ($msgType ne 'public') ? $who : $talkchannel;
413 my $cookiemsg = &getRandom(keys %{ $lang{'cookie'} });
416 ### WILL CHEW TONS OF MEM.
417 ### TODO: convert this to a Forker function!
419 my @list = &searchTable("factoids", "factoid_key", "factoid_value", $arg);
420 $key = &getRandom(@list);
421 $value = &getFactInfo($key, "factoid_value");
423 ($key,$value) = &randKey("factoids","factoid_key,factoid_value");
427 s/##KEY/\002$key\002/;
430 s/\$who/$who/; # cheap fix.
431 s/(\S+)?\s*<\S+>/$1 /;
435 if ($cookiemsg =~ s/^ACTION //i) {
436 &action($target, $cookiemsg);
438 &msg($target, $cookiemsg);
443 my $arg = join(' ',@_);
444 my ($from,$to) = ('','');
446 ($from,$to) = ($1,$2) if ($arg =~ /^(.*?) to (.*)$/i);
447 ($from,$to) = ($2,$1) if ($arg =~ /^(.*?) from (.*)$/i);
449 if (!$to or !$from) {
450 &msg($who, "Invalid format!");
455 &Units::convertUnits($from, $to);
461 my ($target) = &fixString($_[0]);
463 my $chan = $talkchannel;
466 if ($msgType eq 'private') {
467 if ($target =~ /^($mask{chan})\s+(.*)$/) {
472 &msg($who, "error: invalid format or missing arguments.");
477 if ($target =~ /^(.*)(\s+for\s+.*)$/) {
482 my $line = &getRandomLineFromFile($bot_data_dir. "/blootbot.lart");
484 if ($target =~ /^(me|you|itself|\Q$ident\E)$/i) {
485 $line =~ s/WHO/$who/g;
487 $line =~ s/WHO/$target/g;
489 $line .= $for if ($for);
490 $line .= ", courtesy of $who" if ($extra);
492 &action($chan, $line);
494 &status("lart: error reading file?");
499 my $idx = "debian/Packages-sid.idx";
504 $error++ unless ( -e $idx);
505 $error++ unless ( -e "$idx-old");
508 $error = "no sid/sid-old index file found.";
509 &ERROR("Debian: $error");
515 open(IDX2, "$idx-old");
529 next if (exists $pkg{$_});
535 &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
541 if (!defined $chan) {
546 if (!&validChan($chan)) {
547 &msg($who, "chan $chan is invalid.");
551 if (scalar @vernick > scalar(keys %{ $channels{lc $chan}{''} })/4) {
552 &msg($who, "verstats already in progress for someone else.");
556 &msg($who, "Sending CTCP VERSION to $chan; results in 60s.");
557 $conn->ctcp("VERSION", $chan);
558 $cache{verstats}{chan} = $chan;
559 $cache{verstats}{who} = $who;
560 $cache{verstats}{msgType} = $msgType;
562 $conn->schedule(30, sub {
563 my $c = lc $cache{verstats}{chan};
566 foreach (keys %{ $channels{$c}{''} } ) {
567 next if (grep /^\Q$_\E$/i, @vernick);
568 push(@vernicktodo, $_);
574 $conn->schedule(60, sub {
576 my $c = lc $cache{verstats}{chan};
577 my $total = keys %{ $channels{$c}{''} };
579 $who = $cache{verstats}{who};
580 $msgType = $cache{verstats}{msgType};
581 delete $cache{verstats}; # sufficient?
583 foreach (keys %ver) {
584 $vtotal += scalar keys %{ $ver{$_} };
588 my $unknown = $total - $vtotal;
589 my $perc = sprintf("%.1f", $unknown * 100 / $total);
591 $sorted{$perc}{"unknown/cloak"} = "$unknown ($perc%)" if ($unknown);
593 foreach (keys %ver) {
594 my $count = scalar keys %{ $ver{$_} };
595 $perc = sprintf("%.01f", $count * 100 / $total);
596 $perc =~ s/.0$//; # lame compression.
598 $sorted{$perc}{$_} = "$count ($perc%)";
601 ### can be compressed to a map?
603 foreach ( sort { $b <=> $a } keys %sorted ) {
605 foreach (sort keys %{ $sorted{$perc} }) {
606 push(@list, "$_ - $sorted{$perc}{$_}");
610 # hack. this is one major downside to scheduling.
612 &performStrictReply( &formListReply(0, "IRC Client versions for $c ", @list) );
614 # clean up not-needed data structures.
624 last unless (scalar @vernicktodo);
626 my $n = shift(@vernicktodo);
627 $conn->ctcp("VERSION", $n);
630 return unless (scalar @vernicktodo);
632 $conn->schedule(3, \&verstats_flush() );
635 sub do_text_counters {
637 $itc =~ s/([^\w\s])/\\$1/g;
638 my $z = join '|', split ' ', $itc;
640 if ($msgType eq "privmsg" and $message =~ / ($mask{chan})$/) {
641 &DEBUG("ircTC: privmsg detected; chan = $1");
645 if ($message =~ /^_stats(\s+(\S+))$/i) {
651 if ($message =~ /^($z)stats(\s+(\S+))?$/i) {
658 # even more uglier with channel/time arguments.
660 # my $c = $chan || "PRIVATE";
661 my $where = "type=".&sqlQuote($type);
664 $where .= " AND channel=".&sqlQuote($c) if (defined $c);
666 &DEBUG("not using chan arg");
669 my $sum = (&sqlRawReturn("SELECT SUM(counter) FROM stats"
670 ." WHERE ".$where ))[0];
672 if (!defined $arg or $arg =~ /^\s*$/) {
675 # TODO: convert $where to hash
676 my %hash = &sqlSelectColHash("stats", "nick,counter",
678 $where." ORDER BY counter DESC LIMIT 3", 1
683 # unfortunately we have to sort it again!
685 foreach $i (sort { $b <=> $a } keys %hash) {
686 foreach (keys %{ $hash{$i} }) {
687 my $p = sprintf("%.01f", 100*$i/$sum);
689 push(@top, "\002$_\002 -- $i ($p%)");
694 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
698 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
700 &performStrictReply("zero counter for \037$type\037.");
703 # TODO: convert $where to hash and use a sqlSelect
704 my $x = (&sqlRawReturn("SELECT SUM(counter) FROM stats".
705 " WHERE $where AND nick=".&sqlQuote($arg) ))[0];
707 if (!defined $x) { # !defined.
708 &performStrictReply("$arg has not said $type yet.");
713 # TODO: convert $where to hash
714 my @array = &sqlSelect("stats", "nick", undef,
715 $where." ORDER BY counter", 1
719 for ($i=0; $i<scalar @array; $i++) {
720 next unless ($array[0] =~ /^\Q$who\E$/);
726 my $total = scalar(@array);
728 if ($total and $good) {
729 my $pct = sprintf("%.01f", 100*(1+$total-$i)/$total);
730 $xtra = ", ranked $i\002/\002$total (percentile: \002$pct\002 %)";
733 my $pct1 = sprintf("%.01f", 100*$x/$sum);
734 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
743 # even more uglier with channel/time arguments.
745 # my $c = $chan || "PRIVATE";
746 &DEBUG("not using chan arg") if (!defined $c);
748 # example of converting from RawReturn to sqlSelect.
749 my $where_href = (defined $c) ? { channel => $c } : "";
750 my $sum = &sqlSelect("stats", "SUM(counter)", $where_href);
752 if (!defined $arg or $arg =~ /^\s*$/) {
754 &DEBUG("_stats: !arg");
756 my %hash = &sqlSelectColHash("stats", "nick,counter",
758 " ORDER BY counter DESC LIMIT 3", 1
763 # unfortunately we have to sort it again!
765 foreach $i (sort { $b <=> $a } keys %hash) {
766 foreach (keys %{ $hash{$i} }) {
767 my $p = sprintf("%.01f", 100*$i/$sum);
769 push(@top, "\002$_\002 -- $i ($p%)");
775 $topstr = ". Top ".scalar(@top).": ".join(', ', @top);
779 &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
781 &performStrictReply("zero counter for \037$type\037.");
787 # TODO: add nick to where_href
788 my %hash = &sqlSelectColHash("stats", "type,counter",
789 $where_href, " AND nick=".&sqlQuote($arg)
792 # this is totally messed up... needs to be fixed... and cleaned up.
798 foreach (keys %hash) {
799 &DEBUG("_stats: hash{$_} => $hash{$_}");
801 # TODO: convert $where to hash
803 my @array = &sqlSelect("stats", "nick", undef, $where." ORDER BY counter", 1);
806 for(my $i=0; $i<scalar @array; $i++) {
807 next unless ($array[0] =~ /^\Q$who\E$/);
813 $total = scalar(@array);
814 &DEBUG(" i => $i, good => $good, total => $total");
815 $x .= " ".$total."blah blah";
820 if (!defined $x) { # !defined.
821 &performStrictReply("$arg has not said $type yet.");
826 if ($total and $good) {
827 my $pct = sprintf("%.01f", 100*(1+$total-$ii)/$total);
828 $xtra = ", ranked $ii\002/\002$total (percentile: \002$pct\002 %)";
831 my $pct1 = sprintf("%.01f", 100*$x/$sum);
832 &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
837 return unless (defined $arg);
839 #foreach (`$arg`) { &msg($who,$_); }
844 ### START ADDING HOOKS.
846 &addCmdHook('(babel(fish)?|x|xlate|translate)', ('CODEREF' => 'babelfish::babelfish', 'Identifier' => 'babelfish', 'Cmdstats' => 'babelfish', 'Forker' => 1, 'Help' => 'babelfish', 'Module' => 'babelfish') );
847 &addCmdHook('(botmail|message)', ('CODEREF' => 'botmail::parse', 'Identifier' => 'botmail', 'Cmdstats' => 'botmail') );
848 &addCmdHook('bzflist17', ('CODEREF' => 'BZFlag::list17', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1) );
849 &addCmdHook('bzflist', ('CODEREF' => 'BZFlag::list', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1) );
850 &addCmdHook('bzfquery', ('CODEREF' => 'BZFlag::query', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1) );
851 &addCmdHook('chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
852 &addCmdHook('cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
853 &addCmdHook('convert', ('CODEREF' => 'convert', 'Forker' => 1, 'Identifier' => 'Units', 'Help' => 'convert') );
854 &addCmdHook('(cookie|random)', ('CODEREF' => 'cookie', 'Forker' => 1, 'Identifier' => 'Factoids') );
855 &addCmdHook('countdown', ('CODEREF' => 'countdown', 'Module' => 'countdown', 'Identifier' => 'countdown', 'Cmdstats' => 'countdown') );
856 &addCmdHook('countrystats', ('CODEREF' => 'countryStats') );
857 &addCmdHook('dauthor', ('CODEREF' => 'Debian::searchAuthor', 'Forker' => 1, 'Identifier' => 'Debian', 'Cmdstats' => 'Debian Author Search', 'Help' => "dauthor" ) );
858 &addCmdHook('d?bugs', ('CODEREF' => 'DebianExtra::Parse', 'Forker' => 1, 'Identifier' => 'DebianExtra', 'Cmdstats' => 'Debian Bugs') );
859 &addCmdHook('d?contents', ('CODEREF' => 'Debian::searchContents', 'Forker' => 1, 'Identifier' => 'Debian', 'Cmdstats' => 'Debian Contents Search', 'Help' => "contents" ) );
860 &addCmdHook('d?find', ('CODEREF' => 'Debian::DebianFind', 'Forker' => 1, 'Identifier' => 'Debian', 'Cmdstats' => 'Debian Search', 'Help' => "find" ) );
861 &addCmdHook('Dict', ('CODEREF' => 'Dict::Dict', 'Identifier' => 'Dict', 'Help' => 'dict', 'Forker' => 1, 'Cmdstats' => 'Dict') );
862 &addCmdHook('dincoming', ('CODEREF' => 'Debian::generateIncoming', 'Forker' => 1, 'Identifier' => 'Debian' ) );
863 &addCmdHook('dnew', ('CODEREF' => 'DebianNew', 'Identifier' => 'Debian' ) );
864 &addCmdHook('dns|d?nslookup', ('CODEREF' => 'dns::query', 'Identifier' => 'dns', 'Cmdstats' => 'dns', 'Forker' => 1, 'Help' => 'dns') );
865 &addCmdHook('(d|search)desc', ('CODEREF' => 'Debian::searchDescFE', 'Forker' => 1, 'Identifier' => 'Debian', 'Cmdstats' => 'Debian Desc Search', 'Help' => "ddesc" ) );
866 &addCmdHook('dstats', ('CODEREF' => 'Debian::infoStats', 'Forker' => 1, 'Identifier' => 'Debian', 'Cmdstats' => 'Debian Statistics' ) );
867 &addCmdHook('(ex)?change', ('CODEREF' => 'Exchange::query', 'Identifier' => 'Exchange', 'Cmdstats' => 'Exchange', 'Forker' => 1) );
868 &addCmdHook('factinfo', ('CODEREF' => 'factinfo', 'Cmdstats' => 'Factoid Info', Module => 'Factoids', ) );
869 &addCmdHook('factstats?', ('CODEREF' => 'factstats', 'Cmdstats' => 'Factoid Stats', Help => "factstats", Forker => 1, 'Identifier' => 'Factoids', ) );
870 &addCmdHook('help', ('CODEREF' => 'help', 'Cmdstats' => 'Help', ) );
871 &addCmdHook('HTTPDtype', ('CODEREF' => 'HTTPDtype::HTTPDtype', 'Identifier' => 'HTTPDtype', 'Cmdstats' => 'HTTPDtype', 'Forker' => 1) );
872 &addCmdHook('[ia]?spell', ('CODEREF' => 'spell::query', 'Identifier' => 'spell', 'Cmdstats' => 'spell', 'Forker' => 1, 'Help' => 'spell') );
873 &addCmdHook('insult', ('CODEREF' => 'Insult::Insult', 'Forker' => 1, 'Identifier' => 'insult', 'Help' => "insult" ) );
874 &addCmdHook('karma', ('CODEREF' => 'karma', ) );
875 &addCmdHook('kernel', ('CODEREF' => 'Kernel::Kernel', 'Forker' => 1, 'Identifier' => 'Kernel', 'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
876 &addCmdHook('lart', ('CODEREF' => 'lart', 'Identifier' => 'lart', 'Help' => 'lart') );
877 &addCmdHook('listauth', ('CODEREF' => 'CmdListAuth', 'Identifier' => 'Search', Module => 'Factoids', 'Help' => 'listauth') );
878 &addCmdHook('md5(sum)?', ('CODEREF' => 'md5::md5', 'Identifier' => 'md5', 'Cmdstats' => 'md5', 'Forker' => 1, 'Module' => 'md5') );
879 &addCmdHook('metar', ('CODEREF' => 'Weather::Metar', 'Identifier' => 'Weather', 'Help' => 'weather', 'Cmdstats' => 'Weather', 'Forker' => 1) );
880 &addCmdHook('News', ('CODEREF' => 'News::Parse', Module => 'News', 'Cmdstats' => 'News' ) );
881 &addCmdHook('(?:nick|lame)ometer(?: for)?', ('CODEREF' => 'nickometer::query', 'Identifier' => 'nickometer', 'Cmdstats' => 'nickometer', 'Forker' => 1) );
882 &addCmdHook('nullski', ('CODEREF' => 'nullski', ) );
883 &addCmdHook('page', ('CODEREF' => 'pager::page', 'Identifier' => 'pager', 'Cmdstats' => 'pager', 'Forker' => 1, 'Help' => 'page') );
884 &addCmdHook('piglatin', ('CODEREF' => 'piglatin::piglatin', 'Identifier' => 'piglatin', 'Cmdstats' => 'piglatin', 'Forker' => 1) );
885 &addCmdHook('Plug', ('CODEREF' => 'Plug::Plug', 'Identifier' => 'Plug', 'Forker' => 1, 'Cmdstats' => 'Plug') );
886 &addCmdHook('quote', ('CODEREF' => 'Quote::Quote', 'Forker' => 1, 'Identifier' => 'Quote', 'Help' => 'quote', 'Cmdstats' => 'Quote') );
887 &addCmdHook('RootWarn', ('CODEREF' => 'CmdrootWarn', 'Identifier' => 'RootWarn', 'Module' => 'RootWarn') );
888 &addCmdHook('Rss', ('CODEREF' => 'Rss::Rss', 'Identifier' => 'Rss', 'Cmdstats' => 'Rss', 'Forker' => 1, 'Help' => 'rss') );
889 &addCmdHook('sched(stats|info)', ('CODEREF' => 'scheduleList', ) );
890 &addCmdHook('scramble', ('CODEREF' => 'scramble::scramble', 'Identifier' => 'scramble', 'Cmdstats' => 'scramble', 'Forker' => 1, 'Module' => 'scramble') );
891 &addCmdHook('seen', ('CODEREF' => 'seen', 'Identifier' => 'seen') );
892 &addCmdHook('slashdot', ('CODEREF' => 'Slashdot::Slashdot', 'Identifier' => 'slashdot', 'Forker' => 1, 'Cmdstats' => 'slashdot') );
893 &addCmdHook('tell|explain', ('CODEREF' => 'tell', Help => 'tell', Identifier => 'allowTelling', Cmdstats => 'Tell') );
894 &addCmdHook('Uptime', ('CODEREF' => 'uptime', 'Identifier' => 'Uptime', 'Cmdstats' => 'Uptime') );
895 &addCmdHook('u(ser)?info', ('CODEREF' => 'userinfo', 'Identifier' => 'UserInfo', 'Help' => 'userinfo', 'Module' => 'UserInfo') );
896 &addCmdHook('verstats', ('CODEREF' => 'do_verstats' ) );
897 &addCmdHook('Weather', ('CODEREF' => 'Weather::Weather', 'Identifier' => 'Weather', 'Help' => 'weather', 'Cmdstats' => 'Weather', 'Forker' => 1) );
898 &addCmdHook('wiki(pedia)?', ('CODEREF' => 'wikipedia::wikipedia', 'Identifier' => 'wikipedia', 'Cmdstats' => 'wikipedia', 'Forker' => 1, 'Help' => 'wikipedia') );
899 &addCmdHook('wtf', ('CODEREF' => 'wtf::query', 'Identifier' => 'wtf', 'Cmdstats' => 'wtf', 'Forker' => 1, 'Help' => 'wtf') );
900 &addCmdHook('zfi', ('CODEREF' => 'zfi::query', 'Identifier' => 'zfi', 'Cmdstats' => 'zfi', 'Forker' => 1) );
901 &addCmdHook('(zippy|yow)', ('CODEREF' => 'zippy::get', 'Identifier' => 'Zippy', 'Cmdstats' => 'Zippy', 'Forker' => 1) );
902 &addCmdHook('zsi', ('CODEREF' => 'zsi::query', 'Identifier' => 'zsi', 'Cmdstats' => 'zsi', 'Forker' => 1) );
904 ### END OF ADDING HOOKS.
906 &status("CMD: loaded ".scalar(keys %cmdhooks)." command hooks.");