return if (exists $bots{$nuh});
}
+ if ($query =~ s/^literal\s+//i) {
+ &status("literal ask of '$query'.");
+ $literal = 1;
+ }
+
# convert to canonical reference form
my $x;
my @query;
my $fix = $_;
$fix =~ s/ #DEL#$//g;
my $agestr = &Time2String($time - $age);
- &DEBUG("safedel: Removing '$_' for good. [$agestr old]");
+ &status("safedel: Removing '$_' for good. [$agestr old]");
&delFactoid($_);
}
my $warnmode = &getChanConf("rootWarnMode");
if ($attempt == 0) { # first timer.
- if ($warnmode =~ /aggressive/i) {
- &status(">>> Detected root user; notifying nick and channel.");
+ if (defined $warnmode and $warnmode =~ /aggressive/i) {
+ &status("rootwarn: Detected root user; notifying nick and channel.");
rawout("PRIVMSG $chan :R".("O" x int(rand 80 + 2))."T has landed!");
} else {
- &status(">>> Detected root user; notifying user");
+ &status("rootwarn: Detected root user; notifying user");
}
if ($_ = &getFactoid("root")) {
### bot commands...
###
- if ($message =~ s/^literal\s+//i) {
- &status("literal ask of '$message'.");
- $literal = 1;
- }
-
# karma. set...
if ($message =~ /^(\S+)(--|\+\+)\s*$/ and $addressed) {
return '' unless (&hasParam("karma"));
$message = $tell_obj;
$done++ unless (&Modules());
- &VERB("teel: setting old values of who and msgType.",2);
+ &VERB("tell: setting old values of who and msgType.",2);
$who = $oldwho;
$msgType = $oldmtype;
my $dns = shift;
my($match, $x, $y, $result);
my $pid;
+ $dns =~ s/^\s+|\s+$//g;
if ($dns =~ /(\d+\.\d+\.\d+\.\d+)/) {
&status("DNS query by IP address: $in");
} else {
- &status("DNS query by name: $in");
- $x = join('.',unpack('C4',(gethostbyname($in))[4]));
+ &status("DNS query by name: $dns");
+ $x = join('.',unpack('C4',(gethostbyname($dns))[4]));
if ($x !~ /^\s*$/) {
- $result = $in." is ".$x;
+ $result = $dns." is ".$x;
} else {
$result = "I can\'t find that machine name";
}
# About: Retrieve value for 'param' value in current/default chan.
# Return: scalar for success, undef for failure.
sub getChanConf {
- my($param,$chan) = @_;
+ my($param,$c) = @_;
if (!defined $param) {
&WARN("param == NULL.");
return 0;
}
- $chan ||= "_default";
- my @c = grep /^$chan$/i, keys %chanconf;
+ # this looks evil...
+ if (0 and !defined $chan) {
+ &DEBUG("gCC: ok !chan... doing _default instead.");
+ }
+
+ $c ||= $chan;
+ $c ||= "_default";
+ my @c = grep /^$c$/i, keys %chanconf;
if (@c) {
- if ($c[0] ne $chan) {
+ if (0 and $c[0] ne $c) {
&WARN("c ne chan ($c[0] ne $chan)");
}
return $chanconf{$c[0]}{$param};
}
+# &DEBUG("gCC: returning _default... ");
return $chanconf{"_default"}{$param};
}
}
}
+ if (0) {
+ &DEBUG("REPLACE INTO $table (".join(',',@keys).
+ ") VALUES (". join(',',@vals). ")" );
+ }
+
&dbRaw("Replace($table)", "REPLACE INTO $table (".join(',',@keys).
") VALUES (". join(',',@vals). ")"
);