if ($chan eq "") { # all channels.
my $i = keys %channels;
- my $reply = "i am on \002$i\002 ".&fixPlural("channel",$i);
+ my $reply = "I'm on \002$i\002 ".&fixPlural("channel",$i);
my $tucount = 0; # total user count.
my $uucount = 0; # unique user count.
my @array;
}
next if (/^_default$/);
- my $str = sprintf("%s (%d)", $_, scalar(keys %{ $channels{$_}{''} }));
+ my $str = sprintf("%s/%d", $_, scalar(keys %{ $channels{$_}{''} }));
push(@array, $str);
}
- &pSReply($reply.": ".join(', ', @array));
- &ircCheck();
+ &performStrictReply($reply.": ".join(', ', @array));
### total user count.
foreach $chan (keys %channels) {
}
### unique user count.
- my @nicks;
+ my %nicks = ();
foreach $chan (keys %channels) {
- foreach (keys %{ $channels{$chan}{''} }) {
- next if (grep /^\Q$_\E$/, @nicks);
- $uucount++;
- push(@nicks, $_);
+ my $nick;
+ foreach $nick (keys %{ $channels{$chan}{''} }) {
+ $nicks{$nick}++;
}
}
-
- if (scalar @nicks != $uucount) {
- &DEBUG("nicks != uucount...");
- }
+ $uucount = scalar(keys %nicks);
my $chans = scalar(keys %channels);
- &pSReply(
+ &performStrictReply(
"i've cached \002$tucount\002 ". &fixPlural("user",$tucount).
", \002$uucount\002 unique ". &fixPlural("user",$uucount).
", distributed over \002$chans\002 ".
&fixPlural("channel", $chans)."."
);
+ &ircCheck();
return;
}
if ($count) {
$reply .= ". \002$count\002 has said the most with a total of \002$new{$count}\002 messages";
}
- &pSReply("$reply.");
+ &performStrictReply("$reply.");
}
# Command statistics.
push(@array, "\002$int\002 of $_");
}
}
- &pSReply("command usage include ". &IJoin(@array).".");
+ &performStrictReply("command usage include ". &IJoin(@array).".");
}
# Factoid extension info. xk++
my $type = shift(@_);
&Forker("factoids", sub {
- &pSReply( &CmdFactStats($type) );
+ &performStrictReply( &CmdFactStats($type) );
} );
}
{ nick => $target, type => "karma" }) || 0;
if ($karma != 0) {
- &pSReply("$target has karma of $karma");
+ &performStrictReply("$target has karma of $karma");
} else {
- &pSReply("$target has neutral karma");
+ &performStrictReply("$target has neutral karma");
}
}
push(@list, "$str ($_, $perc %)");
}
- # TODO: move this into a scheduler like nickometer
+ # TODO: move this into a scheduler
$msgType = "private";
- &pSReply( &formListReply(0, "Country Stats ", @list) );
+ &performStrictReply( &formListReply(0, "Country Stats ", @list) );
delete $cache{countryStats};
delete $cache{on_who_Hack};
# conversion: ascii.
if ($message =~ /^(asci*|chr) (\d+)$/) {
&DEBUG("ascii/chr called ...");
- return unless (&hasParam("allowConv"));
+ return unless (&IsChanConfOrWarn("allowConv"));
&DEBUG("ascii/chr called");
# conversion: ord.
if ($message =~ /^ord(\s+(.*))$/) {
- return unless (&hasParam("allowConv"));
+ return unless (&IsChanConfOrWarn("allowConv"));
$arg = $2;
# hex.
if ($message =~ /^hex(\s+(.*))?$/i) {
- return unless (&hasParam("allowConv"));
+ return unless (&IsChanConfOrWarn("allowConv"));
my $arg = $2;
if (!defined $arg) {
$retval .= sprintf(" %X", ord($_));
}
- &pSReply("$arg is$retval");
+ &performStrictReply("$arg is$retval");
return;
}
# return;
# }
- &pSReply( crypt($args[1], $args[0]) );
+ &performStrictReply( crypt($args[1], $args[0]) );
} else {
- &pSReply( &mkcrypt($args[0]) );
+ &performStrictReply( &mkcrypt($args[0]) );
}
return;
return unless (&hasFlag("n"));
&status("USER reload $who");
- &pSReply("reloading...");
+ &performStrictReply("reloading...");
my $modules = &reloadAllModules();
- &pSReply("reloaded:$modules");
+ &performStrictReply("reloaded:$modules");
return;
}
}
$reply =~ y/A-Za-z/N-ZA-Mn-za-m/;
- &pSReply($reply);
+ &performStrictReply($reply);
return;
}
}
$ratio = sprintf("%.01f", 100*$perc/($perc+$perc2) );
- &pSReply("Total CPU usage: \002$cpu_usage\002 s ... ".
+ &performStrictReply("Total CPU usage: \002$cpu_usage\002 s ... ".
"Total used: \002$total\002 % ".
"(parent/child ratio: $ratio %)"
);
$reply .= ". I was last disconnected for '$reason'.";
}
- &pSReply($reply);
+ &performStrictReply($reply);
return;
}
$count{'Commands'} += $cmdstats{$_};
}
- &pSReply(
+ &performStrictReply(
"Since $startString, there have been".
" \002$count{'Update'}\002 ".
&fixPlural("modification", $count{'Update'}).