rawout($rawout);
}
-# Usage: &action(nick || chan, txt);
-sub notice{
+# Usage: ¬ice(nick || chan, txt);
+sub notice {
my ($target, $txt) = @_;
if (!defined $txt) {
&DEBUG("action: txt == NULL.");
&status("-$target- $txt");
+ my $t = time();
+
+ if ($t == $nottime) {
+ $notcount++;
+ $notsize += length $txt;
+
+ if ($notcount % 4 and $notcount) {
+ sleep 1;
+ } elsif ($notsize > 1500) {
+ sleep 1;
+ $notsize -= 1500;
+ }
+
+ } else {
+ $notcount = 0;
+ $nottime = $t;
+ $notsize = length $msg;
+ }
+
$conn->notice($target, $txt);
}
&DEBUG("ircstats...");
&DEBUG(" pubsleep: $pubsleep");
&DEBUG(" msgsleep: $msgsleep");
+ &DEBUG(" notsleep: $notsleep");
### USER FILE.
if ($utime_userfile > $wtime_userfile and time() - $wtime_userfile > 3600) {
$p =~ s/\.$//
}
- &DEBUG("connectivity => $p %");
-
if ($total_time != (time() - $ircstats{'ConnectTime'}) ) {
my $tt_format = &Time2String($total_time);
&DEBUG("tt_format => $tt_format");
} else {
$reply = "Currently I'm hooked up to $ircstats{'Server'} but only".
" for $format_time. ".
- "I had to reconnect \002$count\002 times.";
+ "I had to reconnect \002$count\002 times.".
+ " Connectivity: $p %";
}
### REASON.
$utime_chanfile $wtime_chanfile $ucount_chanfile
$pubsize $pubcount $pubtime $pubsleep
$msgsize $msgcount $msgtime $msgsleep
+ $notsize $notcount $nottime $notsleep
);
# dynamic hash.
$pubtime = 0;
$pubsize = 0;
$pubcount = $pubsleep = 0;
+$nottime = 0;
+$notsize = 0;
+$notcount = $notsleep = 0;
###
$bot_version = "blootbot cvs (20010214) -- $^O";
$noreply = "NOREPLY";