### IDENTIFIER.
if (exists $hash{'Identifier'}) {
- return 1 unless (&hasParam($hash{'Identifier'}));
+ return 1 unless (&IsChanConfOrWarn($hash{'Identifier'}));
}
### USER FLAGS.
&addCmdHook("extra", 'dns|d?nslookup|host', ('CODEREF' => 'dns::query',
'Identifier' => 'dns', 'Cmdstats' => 'dns',
'Forker' => 1, 'Help' => 'dns') );
+&addCmdHook("extra", 'piglatin', ('CODEREF' => 'piglatin::piglatin',
+ 'Identifier' => 'piglatin', 'Cmdstats' => 'piglatin',
+ 'Forker' => 1) );
###
### END OF ADDING HOOKS.
###
$debiancmd .= '|recommends?|suggests?|maint|maintainer';
if ($message =~ /^($debiancmd)(\s+(.*))?$/i) {
- return unless (&hasParam('Debian'));
+ return unless (&IsChanConfOrWarn('Debian'));
my $package = lc $3;
if (defined $package) {
# google searching. Simon++
if ($message =~ /^(?:search\s+)?($w3search_regex)\s+(?:for\s+)?['"]?(.*?)["']?\s*\?*$/i) {
- return unless (&hasParam('W3Search'));
+ return unless (&IsChanConfOrWarn('W3Search'));
&Forker('W3Search', sub { &W3Search::W3Search($1,$2); } );
# list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
- return unless (&hasParam('Search'));
+ return unless (&IsChanConfOrWarn('Search'));
my $thiscmd = lc $1;
my $args = $3 || "";
# Nickometer. Adam Spiers++
if ($message =~ /^(?:lame|nick)ometer(?: for)? (\S+)/i) {
- return unless (&hasParam("nickometer"));
+ return unless (&IsChanConfOrWarn("nickometer"));
my $term = (lc $1 eq 'me') ? $who : $1;
push(@list, "$str ($_%)");
}
- &pSReply( &formListReply(0, "Nickometer list for $term ", @list) );
+ &performStrictReply( &formListReply(0, "Nickometer list for $term ", @list) );
&DEBUG("test.");
return;
# Topic management. xk++
# may want to add a userflags for topic. -xk
if ($message =~ /^topic(\s+(.*))?$/i) {
- return unless (&hasParam('Topic'));
+ return unless (&IsChanConfOrWarn('Topic'));
my $chan = $talkchannel;
my @args = split / /, $2 || "";
# wingate.
if ($message =~ /^wingate$/i) {
- return unless (&hasParam('Wingate'));
+ return unless (&IsChanConfOrWarn('Wingate'));
my $reply = "Wingate statistics: scanned \002"
.scalar(keys %wingate)."\002 hosts";
$reply .= ". Started the scan ".&Time2String(time() - $wingaterun)." ago";
}
- &pSReply("$reply.");
+ &performStrictReply("$reply.");
return;
}
"saying\002:\002 '$seen[4]'.";
}
- &pSReply($reply);
+ &performStrictReply($reply);
return;
}
}
close IDX1;
- &::pSReply( &::formListReply(0, "New debian packages:", @new) );
+ &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
}
sub do_verstats {
# hack. this is one major downside to scheduling.
$chan = $c;
- &pSReply( &formListReply(0, "IRC Client versions for $c ", @list) );
+ &performStrictReply( &formListReply(0, "IRC Client versions for $c ", @list) );
# clean up not-needed data structures.
undef %ver;
}
if (defined $sum) {
- &pSReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
+ &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
} else {
- &pSReply("zero counter for \037$type\037.");
+ &performStrictReply("zero counter for \037$type\037.");
}
} else {
# TODO: convert $where to hash and use a sqlSelect
" WHERE $where AND nick=".&sqlQuote($arg) ))[0];
if (!defined $x) { # !defined.
- &pSReply("$arg has not said $type yet.");
+ &performStrictReply("$arg has not said $type yet.");
return 1;
}
}
my $pct1 = sprintf("%.01f", 100*$x/$sum);
- &pSReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
+ &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
}
return 1;
}
if (defined $sum) {
- &pSReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
+ &performStrictReply("total count of \037$type\037 on \002$c\002: $sum$topstr");
} else {
- &pSReply("zero counter for \037$type\037.");
+ &performStrictReply("zero counter for \037$type\037.");
}
return;
# return;
if (!defined $x) { # !defined.
- &pSReply("$arg has not said $type yet.");
+ &performStrictReply("$arg has not said $type yet.");
return;
}
}
my $pct1 = sprintf("%.01f", 100*$x/$sum);
- &pSReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
+ &performStrictReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
}
sub nullski {