&shmFlush();
- if ( !defined %cmdhooks ) {
+ if ( !%cmdhooks ) {
&WARN('%cmdhooks does not exist.');
return 0;
}
return;
}
- # google searching. Simon++
- my $w3search_regex = 'google';
+ # google searching -- thanks Brett Cave
if ( $message =~
- /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i
+ /^(\s+)?google\s+['"]?(.*?)["']?\s*\?*$/i
)
{
- return unless ( &IsChanConfOrWarn('W3Search') );
+ return unless ( &IsChanConfOrWarn('Google') );
- &Forker( 'W3Search', sub { &W3Search::W3Search( $1, $2 ); } );
+ &Forker( 'Google', sub { &Google::GoogleSearch( $2 ); } );
- $cmdstats{'W3Search'}++;
+ $cmdstats{'Google'}++;
return;
}
return;
}
- &msg( $who, "Sending CTCP VERSION to $chan; results in 60s." );
- $conn->ctcp( 'VERSION', $chan );
+ &msg( $who, "Sending CTCP VERSION to $chan; results in 60s." );
+ &msg( $chan, "WARNING: $who has forced me to CTCP VERSION the channel!" );
+
+ # Workaround for bug in Net::Irc, provided by quin@freenode. Details at:
+ # http://rt.cpan.org/Public/Bug/Display.html?id=11421
+ # $conn->ctcp( 'VERSION', $chan );
+ $conn->sl("PRIVMSG $chan :\001VERSION\001");
+
$cache{verstats}{chan} = $chan;
$cache{verstats}{who} = $who;
$cache{verstats}{msgType} = $msgType;
my $vtotal = 0;
my $c = lc $cache{verstats}{chan};
my $total = keys %{ $channels{$c}{''} };
- $chan = $c;
$who = $cache{verstats}{who};
$msgType = $cache{verstats}{msgType};
delete $cache{verstats}; # sufficient?
}
# hack. this is one major downside to scheduling.
- $chan = $c;
- &performStrictReply(
+ &msg($c,
&formListReply( 0, "IRC Client versions for $c ", @list ) );
# clean up not-needed data structures.
last unless ( scalar @vernicktodo );
my $n = shift(@vernicktodo);
- $conn->ctcp( 'VERSION', $n );
+ #$conn->ctcp( 'VERSION', $n );
+ # See do_verstats $conn->sl for explantaion
+ $conn->sl("PRIVMSG $n :\001VERSION\001");
}
return unless ( scalar @vernicktodo );
- $conn->schedule( 3, \&verstats_flush() );
+ $conn->schedule( 3, \&verstats_flush );
}
sub do_text_counters {
###
### START ADDING HOOKS.
###
-&addCmdHook('(babel(fish)?|x|xlate|translate)', ('CODEREF' => 'babelfish::babelfish', 'Identifier' => 'babelfish', 'Cmdstats' => 'babelfish', 'Forker' => 1, 'Help' => 'babelfish', 'Module' => 'babelfish') );
+&addCmdHook('(x|xlate|translate)', ('CODEREF' => 'translate::translate', 'Identifier' => 'translate', 'Cmdstats' => 'translate', 'Forker' => 1, 'Help' => 'translate', 'Module' => 'translate') );
&addCmdHook('(botmail|message)', ('CODEREF' => 'botmail::parse', 'Identifier' => 'botmail', 'Cmdstats' => 'botmail') );
&addCmdHook('bzflist17', ('CODEREF' => 'BZFlag::list17', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1, 'Module' => 'BZFlag') );
&addCmdHook('bzflist', ('CODEREF' => 'BZFlag::list', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1, 'Module' => 'BZFlag') );
&addCmdHook('bzfquery', ('CODEREF' => 'BZFlag::query', 'Identifier' => 'BZFlag', 'Cmdstats' => 'BZFlag', 'Forker' => 1, 'Module' => 'BZFlag') );
&addCmdHook('chan(stats|info)', ('CODEREF' => 'chaninfo', ) );
+&addCmdHook('conn(stats|info)', ('CODEREF' => 'conninfo', ) );
&addCmdHook('cmd(stats|info)', ('CODEREF' => 'cmdstats', ) );
&addCmdHook('convert', ('CODEREF' => 'convert', 'Forker' => 1, 'Identifier' => 'Units', 'Help' => 'convert') );
&addCmdHook('(cookie|random)', ('CODEREF' => 'cookie', 'Forker' => 1, 'Identifier' => 'Factoids') );