w3search => "blah for blah" fails - fixed.
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@447
c11ca15a-4712-0410-83d8-
924469b57eb5
if (defined $l and &IsChanConf("chanlimitcheck")) {
my $plus = &getChanConfDefault("chanlimitcheckPlus", 5, $chan);
my $count = scalar(keys %{ $channels{$chan}{''} });
if (defined $l and &IsChanConf("chanlimitcheck")) {
my $plus = &getChanConfDefault("chanlimitcheckPlus", 5, $chan);
my $count = scalar(keys %{ $channels{$chan}{''} });
+ my $int = &getChanConfDefault("chanlimitcheckInterval", 10, $chan);
my $delta = $count + $plus - $l;
$delta =~ s/^\-//;
my $delta = $count + $plus - $l;
$delta =~ s/^\-//;
}
if (exists $cache{ "chanlimitChange_$chan" }) {
}
if (exists $cache{ "chanlimitChange_$chan" }) {
- if (time() - $cache{ "chanlimitChange_$chan" } < 60) {
- &DEBUG("not going to change chanlimit!");
+ if (time() - $cache{ "chanlimitChange_$chan" } < $int*60) {
- delete $cache{ "chanlimitChange_$chan" };
}
### todo: check if we have ops.
}
### todo: check if we have ops.
if ($delta > 5) {
&status("clc: big change in limit; changing.");
&rawout("MODE $chan +l ".($count+$plus) );
if ($delta > 5) {
&status("clc: big change in limit; changing.");
&rawout("MODE $chan +l ".($count+$plus) );
+ $cache{ "chanlimitChange_$chan" } = time();
}
if (exists $cache{ "chanlimitChange_$chan" }) {
}
if (exists $cache{ "chanlimitChange_$chan" }) {
- if (time() - $cache{ "chanlimitChange_$chan" } < 60) {
- &DEBUG("not going to change chanlimit!");
+ my $delta = time() - $cache{ "chanlimitChange_$chan" };
+ if ($delta < $interval*60) {
+ &DEBUG("not going to change chanlimit! ($delta<$interval*60)");
- delete $cache{ "chanlimitChange_$chan" };
}
&rawout("MODE $chan +l $newlimit");
}
&rawout("MODE $chan +l $newlimit");
&rawout("PRIVMSG ChanServ :OP $chan $ident");
}
&rawout("PRIVMSG ChanServ :OP $chan $ident");
}
- if (!$conn->connected or time - $msgtime > 3600) {
+ if (!$conn->connected or time() - $msgtime > 3600) {
# todo: shouldn't we use cache{connect} somewhere?
if (exists $cache{connect}) {
&WARN("ircCheck: no msg for 3600 and disco'd! reconnecting!");
# todo: shouldn't we use cache{connect} somewhere?
if (exists $cache{connect}) {
&WARN("ircCheck: no msg for 3600 and disco'd! reconnecting!");
&DEBUG("channels END");
}
&DEBUG("channels END");
}
+ &DEBUG("ircstats...");
+ &DEBUG(" pubsleep: $pubsleep");
+ &DEBUG(" msgsleep: $msgsleep");
+
### USER FILE.
if ($utime_userfile > $wtime_userfile and time() - $wtime_userfile > 3600) {
&writeUserFile();
### USER FILE.
if ($utime_userfile > $wtime_userfile and time() - $wtime_userfile > 3600) {
&writeUserFile();
my ($where, $what, $type) = @_;
my $retval = "$where can't find \002$what\002";
my ($where, $what, $type) = @_;
my $retval = "$where can't find \002$what\002";
- return unless &::loadPerlModule("WWW::Search");
-
- if (defined $type) {
- &::DEBUG("W3S: type => $type");
- }
-
my @matches = grep { lc($_) eq lc($where) ? $_ : undef } @W3Search_engines;
if (@matches) {
$where = shift @matches;
} else {
&::msg($::who, "i don't know how to check '$where'");
my @matches = grep { lc($_) eq lc($where) ? $_ : undef } @W3Search_engines;
if (@matches) {
$where = shift @matches;
} else {
&::msg($::who, "i don't know how to check '$where'");
+ return unless &::loadPerlModule("WWW::Search");
+
my $Search = new WWW::Search($where);
my $Query = WWW::Search::escape_query($what);
$Search->native_query($Query,
my $Search = new WWW::Search($where);
my $Query = WWW::Search::escape_query($what);
$Search->native_query($Query,
$flag_quit $msgType
$utime_userfile $wtime_userfile $ucount_userfile
$utime_chanfile $wtime_chanfile $ucount_chanfile
$flag_quit $msgType
$utime_userfile $wtime_userfile $ucount_userfile
$utime_chanfile $wtime_chanfile $ucount_chanfile
- $pubsize $pubcount $pubtime
- $msgsize $msgcount $msgtime
+ $pubsize $pubcount $pubtime $pubsleep
+ $msgsize $msgcount $msgtime $msgsleep
$wtime_chanfile = 0;
$ucount_chanfile = 0;
### more variables...
$wtime_chanfile = 0;
$ucount_chanfile = 0;
### more variables...
+$msgcount = $msgsleep = 0;
$pubtime = 0;
$pubsize = 0;
$pubtime = 0;
$pubsize = 0;
+$pubcount = $pubsleep = 0;
###
$bot_version = "blootbot cvs (20010214) -- $^O";
$noreply = "NOREPLY";
###
$bot_version = "blootbot cvs (20010214) -- $^O";
$noreply = "NOREPLY";