]> git.donarmstrong.com Git - infobot.git/commitdiff
- show total commands used in "status"
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 8 May 2001 13:17:44 +0000 (13:17 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 8 May 2001 13:17:44 +0000 (13:17 +0000)
- more conversion of DEBUG to VERB/other
- send nickserv our pass if we notice $nickserv = 0

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

src/Factoids/Question.pl
src/Factoids/Reply.pl
src/IRC/IrcHelpers.pl
src/IRC/IrcHooks.pl
src/Modules/News.pl
src/UserExtra.pl

index 3e689ab5bc86f40ee347e83199b1f1671ff0e2ae..b5c4b484387012818b087c6047da1fdf4cf8000c 100644 (file)
@@ -112,7 +112,7 @@ sub doQuestion {
        }
 
        if ($i != 0) {
-           &DEBUG("Question: '$query[0]' did not exist; '$query[$i]' ($i) did");
+           &VERB("Question.pl: '$query[0]' did not exist; '$query[$i]' ($i) did",2);
        }
 
        return $result;
index 1137e7637816c25409c8d0c55132834a8e24d4a5..5fda25f1c0dbe2b7b36e8f15d80645fce9da23e5 100644 (file)
@@ -122,8 +122,7 @@ sub getReply {
        if (!$real and $reply =~ s/^\s*<reply>\s*//i) {
            # 'are' fix.
            if ($reply =~ s/^are /$lhs are /i) {
-               &DEBUG("Reply.pl: el-cheapo 'are' fix executed.");
-               $mhs = "are";   # what's this for?
+               &VERB("Reply.pl: el-cheapo 'are' fix executed.",2);
            }
 
        } elsif (!$real and $reply =~ s/^\s*<action>\s*(.*)/\cAACTION $1\cA/i) {
index e0acbcf5584a12e94a66c02d20e36c416ec8b88b..bb8fe089c561f17c942d97a2fe1ebc5174d872f1 100644 (file)
@@ -319,6 +319,7 @@ sub chanServCheck {
 
     if ( &IsParam("nickServ_pass") and !$nickserv) {
        &DEBUG("chanServ_ops($chan): nickserv enabled but not alive? (ircCheck)");
+       &rawout("WHO NickServ");
        return 0;
     }
     return 0 if (exists $channels{$chan}{'o'}{$ident});
index d1359d901d3cbef6642b56aff504d09273c517a8..951991855d1d7853027f2ba959742f87974218d4 100644 (file)
@@ -997,6 +997,11 @@ sub on_who {
        return;
     }
 
+    if ($args[5] =~ /^nickserv$/i and !$nickserv) {
+       &DEBUG("ok... we did a who for nickserv.");
+       &rawout("PRIVMSG NickServ :IDENTIFY $param{'nickServ_pass'}");
+    }
+
     $nuh{lc $args[5]} = $args[5]."!".$args[2]."\@".$args[3];
 }
 
index b7cada9b84d2adb37f74f4369b70bf877cb54302..9a5ed226555289815f7866c29819f795452181b2 100644 (file)
@@ -90,7 +90,6 @@ sub Parse {
        &latest($3 || $chan, 1);
 
     } elsif ($what =~ /^list$/i) {
-       &::DEBUG("list longcut called.");
        &list();
 
     } elsif ($what =~ /^(expire|text|desc)(\s+(.*))?$/i) {
@@ -136,7 +135,7 @@ sub Parse {
        }
 
     } else {
-       &::DEBUG("could not parse '$what'.");
+       &::DEBUG("could not parse '$what'");
        &::notice($::who, "unknown command: $what");
     }
 }
@@ -187,8 +186,11 @@ sub readNews {
     close NEWS;
 
     my $cn = scalar(keys %::news);
-    &::status("News: Read $ci items for $cn chans, $cu users cache")
-               if ($ci or $cn or $cu);
+    &::status("News: Read ".
+       $ci. &::fixPlural(" item", $ci). " for ".
+       $cn. &::fixPlural(" chan", $cn). ", ".
+       $cu. &::fixPlural(" user", $cu), " cache"
+    ) if ($ci or $cn or $cu);
 }
 
 sub writeNews {
@@ -873,7 +875,7 @@ sub getNewsItem {
            &::DEBUG("gNI: part_string->full_string: $what->$items[0]");
            return $items[0];
        } else {
-           &::DEBUG("gNI: No match.");
+           &::DEBUG("gNI: No match for '$what'");
            return;
        }
     }
index db1af0a25ec93b793a3061335c7ff84ea4b38a5d..5a117a978b1d3159702a05e3c242c9852fb15443 100644 (file)
@@ -750,6 +750,10 @@ sub userCommands {
        my $startString = scalar(localtime $^T);
        my $upString    = &Time2String(time() - $^T);
        my $count       = &countKeys("factoids");
+       $count{'Commands'}      = 0;
+       foreach (keys %cmdstats) {
+           $count{'Commands'} += $cmdstats{$_};
+       }
 
        &pSReply(
        "Since $startString, there have been".
@@ -761,6 +765,8 @@ sub userCommands {
                &fixPlural("dunno",$count{'Dunno'}).
          " and \002$count{'Moron'}\002 ".
                &fixPlural("moron",$count{'Moron'}).
+         " and \002$count{'Commands'}\002 ".
+               &fixPlural("command",$count{'Commands'}).
          ".  I have been awake for $upString this session, and ".
          "currently reference \002$count\002 factoids.  ".
          "I'm using about \002$memusage\002 ".