]> git.donarmstrong.com Git - infobot.git/commitdiff
- fixed listvals. why did this break anyway?
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 23 May 2001 14:46:19 +0000 (14:46 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 23 May 2001 14:46:19 +0000 (14:46 +0000)
- fixed $who usage in factoid args plus standard factoids.
- minor output changes.

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@495 c11ca15a-4712-0410-83d8-924469b57eb5

src/CommandStubs.pl
src/Factoids/Question.pl
src/Factoids/Reply.pl
src/IRC/Schedulers.pl
src/core.pl

index 249449cb1f218e365352ea5a75c5f6fb0a4bfd0b..8ee0f27c8c625a8ba23a06e07cd973f26d22377a 100644 (file)
@@ -309,16 +309,16 @@ sub Modules {
     }
 
     # 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);
index fa73b9f80ec849f132c4afd16c0f93d07e8bfc28..eab0d5f050ffd4feef8e1b69acd22d420b0d6784 100644 (file)
@@ -195,7 +195,7 @@ sub factoidArgs {
 
        next unless (@vals);
 
-       &DEBUG("vals => @vals");
+#      &DEBUG("vals => @vals");
 
        &status("Question: factoid Arguments for '$str'");
        # todo: use getReply() - need to modify it :(
@@ -205,7 +205,8 @@ sub factoidArgs {
 
        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;
@@ -214,7 +215,10 @@ sub factoidArgs {
            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++;
index dbe933644db5861370640a663796c33110adce9f..745b7dc72b85cd805d6ae437659de938e59f5b81 100644 (file)
@@ -136,8 +136,10 @@ sub getReply {
     ### $ SUBSTITUTION.
     ###
 
-    $reply = &substVars($reply);
-    
+#    &DEBUG("Reply: reply => $reply");
+    $reply = &substVars($reply,1);
+#    &DEBUG("Reply: reply => $reply");
+
     $reply;
 }
 
index f884fe1ad31a68686c668d2f34f8f803a5340f2a..eee0c5918af87452d17a07261201628ff4b12381 100644 (file)
@@ -322,7 +322,7 @@ sub newsFlush {
            $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);
     }
 
index 714c1250475a85001e100f6102e0b6ac98e18331..87ebb64c184f621308af49c8da16f81810bd3d5f 100644 (file)
@@ -422,7 +422,7 @@ sub startup {
 
 sub shutdown {
     # reverse order of &setup().
-    &DEBUG("shutdown called.");
+    &status("--- shutdown called.");
 
     $ident ||= "blootbot";     # hack.