From f85b6322f907fc17af17c92633eb6fc4e9f39c58 Mon Sep 17 00:00:00 2001 From: dms Date: Tue, 8 May 2001 13:17:44 +0000 Subject: [PATCH] - show total commands used in "status" - 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 | 2 +- src/Factoids/Reply.pl | 3 +-- src/IRC/IrcHelpers.pl | 1 + src/IRC/IrcHooks.pl | 5 +++++ src/Modules/News.pl | 12 +++++++----- src/UserExtra.pl | 6 ++++++ 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index 3e689ab..b5c4b48 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -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; diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index 1137e76..5fda25f 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -122,8 +122,7 @@ sub getReply { if (!$real and $reply =~ s/^\s*\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*\s*(.*)/\cAACTION $1\cA/i) { diff --git a/src/IRC/IrcHelpers.pl b/src/IRC/IrcHelpers.pl index e0acbcf..bb8fe08 100644 --- a/src/IRC/IrcHelpers.pl +++ b/src/IRC/IrcHelpers.pl @@ -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}); diff --git a/src/IRC/IrcHooks.pl b/src/IRC/IrcHooks.pl index d1359d9..9519918 100644 --- a/src/IRC/IrcHooks.pl +++ b/src/IRC/IrcHooks.pl @@ -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]; } diff --git a/src/Modules/News.pl b/src/Modules/News.pl index b7cada9..9a5ed22 100644 --- a/src/Modules/News.pl +++ b/src/Modules/News.pl @@ -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; } } diff --git a/src/UserExtra.pl b/src/UserExtra.pl index db1af0a..5a117a9 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -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 ". -- 2.39.2