}
# list{keys|values}. xk++. Idea taken from #linuxwarez@EFNET
- if ($message =~ /^list(\S+)( (.*))?$/i) {
+ if ($message =~ /^list(\S+)(\s+(.*))?$/i) {
return unless (&hasParam("search"));
- my $thiscmd = lc($1);
+ my $thiscmd = lc $1;
+ my $args = $3 || "";
+
$thiscmd =~ s/^vals$/values/;
+# $args =~ s/\s+$//g;
return if ($thiscmd ne "keys" && $thiscmd ne "values");
- my $args = $3 || "";
- $args =~ s/\s+$//g;
-
# Usage:
if (!defined $args or $args =~ /^\s*$/) {
&help("list". $thiscmd);
next unless (@vals);
- &DEBUG("vals => @vals");
+# &DEBUG("vals => @vals");
&status("Question: factoid Arguments for '$str'");
# todo: use getReply() - need to modify it :(
foreach ( split(',', $1) ) {
my $val = $vals[$i];
- &DEBUG("val => $val");
+# &DEBUG("val => $val");
+
if (!defined $val) {
&status("factArgs: vals[$i] == undef; not SARing '$_' for '$str'");
next;
my $done = 0;
my $old = $result;
while (1) {
- $result = &substVars($result,1);
+# &DEBUG("Q: result => $result (1)");
+ $result = &substVars($result);
+# &DEBUG("Q: result => $result (1)");
+
last if ($old eq $result);
$old = $result;
$done++;
### $ SUBSTITUTION.
###
- $reply = &substVars($reply);
-
+# &DEBUG("Reply: reply => $reply");
+ $reply = &substVars($reply,1);
+# &DEBUG("Reply: reply => $reply");
+
$reply;
}
$i++;
}
- &status("NEWS (newsflush) {$chan}: deleted [$i/$total] news entries.");
+ &status("NEWS (newsflush) {$chan}: deleted [$i/$total] news entries.") if ($i);
$none{$chan} = 1 if ($total == $i);
}
sub shutdown {
# reverse order of &setup().
- &DEBUG("shutdown called.");
+ &status("--- shutdown called.");
$ident ||= "blootbot"; # hack.