X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FProcess.pl;h=75499a23770993099d5bacaa520d7f4c954bcc74;hb=8a79d430aef83402420b5a8378e78cfa01051c93;hp=05f297b95b7cd345fd6b81066d6d0151edae9d7f;hpb=d09c7d3563f2a2c44065847a96bb51942d9c1d8f;p=infobot.git diff --git a/src/Process.pl b/src/Process.pl index 05f297b..75499a2 100644 --- a/src/Process.pl +++ b/src/Process.pl @@ -6,7 +6,13 @@ # process the incoming message # -#use strict; +use strict; + +use vars qw($who $msgType $addressed $message $ident $user $host $chan + $learnok $talkok $force_public_reply $noreply $addrchar + $literal $addressedother $userHandle $lobotomized); +use vars qw(%channels %users %param %cache %chanconf %mask %orig %lang + ); sub process { $learnok = 0; # Able to learn? @@ -292,6 +298,9 @@ sub process { # karma. set... if ($message =~ /^(\S+)(--|\+\+)\s*$/ and $addressed) { return '' unless (&hasParam("karma")); + # well... since it is policy to do bot functions before factoids + # karma gets hit if, for example, "g++" is issued. + # only way to request it is to put a question mark at the end. my($term,$inc) = (lc $1,$2); @@ -305,8 +314,8 @@ sub process { return; } - my $karma = &dbGet("stats", "counter", "nick=".&dbQuote($term). - " AND type='karma'") || 0; + my $karma = &dbGet("stats", "counter", + "nick=".&dbQuote($term)." AND type='karma'") || 0; if ($inc eq '++') { $karma++; } else { @@ -314,8 +323,9 @@ sub process { } &dbSet("stats", - { nick => $term, type => "karma" }, - { counter => $karma } + { nick => $term, type => "karma" }, # WHERE +# { counter => $karma } # WHAT + { -counter => "counter+1" } ); return;