]> jfr.im git - irc/evilnet/x3.git/blobdiff - tools/mrsnoopy.pl
Couple of srvx updates.
[irc/evilnet/x3.git] / tools / mrsnoopy.pl
index b5cff741bb5a0146a6fbdd5c776c49a70e3109d0..bf561f3040ce617077c216e8fbbc436aebc450ce 100644 (file)
@@ -2,7 +2,7 @@
 
 # Author: rubin@afternet.org irc.afternet.org/#afternet
 
-$script_version = "0.2";
+$script_version = "0.3";
 $script_name = "MrSnoopy's magic color kit v$script_version";
 $version = IRC::get_info(0);
 # get a string of the form 1.2.0 or 1.3.3
@@ -78,20 +78,26 @@ sub privmsg_handler
          $note_type = $2;
          $message = $3;
 
-         if($note_type =~ /(JOIN|CREATE)/)
+         if($note_type =~ /(JOIN)/)
          {
-            $action = $1;
             $message =~ /(\S+)\sby\s(\S+)/;
             $chan = $1;
             $nick = $2;
-            IRC::print "$time \003".$color_darkyellow."   $action\t\003$color_darkyellow$chan by \003$color_yellow$nick\003\n";
+            IRC::print "$time \003".$color_darkyellow."   JOIN\t$nick joined \003$color_darkyellow$chan\003\n";
          }
-         elsif($note_type =~ /PART/)
+         elsif($note_type =~ /(CREATE)/)
          {
             $message =~ /(\S+)\sby\s(\S+)/;
             $chan = $1;
             $nick = $2;
-            IRC::print "$time \003".$color_darkmajenta."   PART\t$chan by \003$color_majenta$nick\n";
+            IRC::print "$time \003".$color_darkyellow." CREATE\t$nick joined $chan\003\n";
+         }
+        elsif($note_type =~ /PART/)
+         {
+            $message =~ /(\S+)\sby\s(\S+)/;
+            $chan = $1;
+            $nick = $2;
+            IRC::print "$time \003".$color_darkmajenta."   PART\t$nick left $chan\003\n";
          }
          elsif($note_type =~ /NICK/)
          {
@@ -99,12 +105,14 @@ sub privmsg_handler
             if($message =~ /(\S+)\s([^@]+)\@(\S+)\s\(([^)]*)\)\s\[([^]]+)\]\son\s(\S+)/)
             {
                 $nick = sprintf("%-15s", $1);
-                $user = sprintf("%10s", $2);
+                #$user = sprintf("%10s", $2);
+                $user = $2;
                 $host = $3;
                 $account = $4;
                 $ip = sprintf("%15s", $5);
                 $server = $6;
-                IRC::print "$time \003".$color_green."CONNECT\t[\003$color_blue$ip\003$color_green] as $nick \003$color_darkcyan$user\003$color_grey@\003$color_darkcyan$host \003$color_green(\003$color_yellow$account\003$color_green)  on $server\n";
+                #IRC::print "$time \003".$color_green."CONNECT\t[\003$color_blue$ip\003$color_green] as $nick \003$color_darkcyan$user\003$color_grey@\003$color_darkcyan$host \003$color_green(\003$color_yellow$account\003$color_green)  on $server\n";
+                IRC::print "$time \003".$color_green."CONNECT\t$nick (\003$color_darkcyan$user\003$color_grey@\003$color_darkcyan$host\003$color_green) \003$color_yellow*$account\003$color_green [\003$color_blue$ip\003$color_green]  on $server\003\n";
                 #if(exists $DroneNames{$1})
                 if(exists $DroneNames{$1} && exists $DroneNames{$2} && !($1 eq $2))
                 {
@@ -116,6 +124,14 @@ sub privmsg_handler
                     #IRC::print "\003".$color_green."       \t '$1' Not a drone\n";
                 #}
             }
+           #[21:32:45] NICK change Lil_JJ -> [-BDC-]J_Word
+           elsif($message =~ /change (\S+)\s\-\>\s(\S+)/)
+           {
+                   $old = $1;
+                   $new = $2;
+                   IRC::print "$time \003".$color_darkgreen."  NICK\t$old is now known as $new\003\n";
+                   return 1;
+           }
             else
             {
                return 0;
@@ -124,25 +140,78 @@ sub privmsg_handler
          elsif($note_type =~ /QUIT/)
          {
             # InvaderC1 (Chadwick@adsl-67-125-1-144.dsl.scrm01.pacbell.net, on Gamesleague.NL.Afternet.Org) (Ping timeout)
-            $message =~ /(\S+)\s\(([^@]+)\@([^,]+)\,\son\s(\S+)\)\s\(([^)]+)\)/;
-            $nick = $1;
+            #OR - QUIT Nader (supybot@CPE-72-131-73-97.mn.res.rr.com, on Pyro.US.AfterNET.Org) (Killed (Rubin (testing snoop)))
+            #OR - no "killed" at all? WTF is up with snoop and kills. 
+            $message =~ /(\S+)\s\(([^@]+)\@([^,]+)\,\son\s(\S+)\)\s\((Killed|)(.+)\)/;
+            $nick = sprintf("%-15s", $1);
             $user = $2;
             $host = $3;
             $server = $4;
-            $quitmsg = $5;
-            IRC::print "$time \003".$color_darkred."   QUIT\t\003$color_red$nick\003$color_darkred (\003$color_darkgrey$user\003$color_grey@\003$color_darkgrey$host\003$color_darkred, on $server) (\003$color_white$quitmsg\003$color_darkred)\n";
+            $killed = $5;
+            $quitmsg = $6;
+            IRC::print "$time \003".$color_darkred."   QUIT\t$nick (\003$color_darkgrey$user\003$color_grey@\003$color_darkgrey$host\003$color_darkred) on $server (\003$color_white$quitmsg\003$color_darkred)\003 [$killed]\n";
+            #return 0; # debug
          }
+        elsif($note_type=~/UMODE/)
+        {
+            #Walter +rx Walter 
+            if($message =~ /(\S+)\s+(.+)\s*(\S*)/)
+            {
+                    $nick = $1;
+                    $mode = $2;
+
+                    IRC::print "$time \003".$color_darkgrey."  UMODE\t$nick \002$mode\002 $nick\003\n";
+            }
+            else
+            {
+                    return 0;
+            }
+        }
          elsif($note_type =~/MODE/)
          {
             # afternet +l 12 by X3
-            $message =~ /\s*(\S+)\s+(.+)\sby\s(\S+)/;
-            $channel = $1;
-            $mode = $2;
-            $nick = $3;
-            IRC::print "$time \003".$color_grey."   MODE\t$channel \002$mode\002 by $nick\n";
+            if($message =~ /\s*(\S+)\s+(.+)\sby\s(\S+)/)
+           {
+                   $channel = $1;
+                   $mode = $2;
+                   $nick = $3;
+                   IRC::print "$time \003$color_grey   MODE\t$nick set \002$mode\002 on $channel\003\n";
+           }
+           else
+           {
+                   return 0;
+           }
+         }
+         elsif($note_type =~ /AUTH/)
+         {
+                 #teclis as cehb
+                 $message =~ /(\S+)\sas\s(\S+)/;
+                 $nick = $1;
+                 $account = $2;
+                 IRC::print "$time \003$color_darkgreen   AUTH\t$nick as \003$color_yellow*$account\003\n";
+         }
+         elsif($note_type =~ /KILL/)
+         {
+                 #Sore (mem0ry@Toronto-HSE-ppp3667456.sympatico.ca, on Pyro.US.AfterNET.Org) by AuthServ (Ghost kill on account Sorea (requested by Eros).)
+                 if($message =~ /(\S+)\s\(([^@]+)\@([^,]+)\,\son\s(\S+)\)\sby\s(\S+)\s(.*)\)/)
+                 {
+                     $nick = $1;
+                     $user = $2;
+                     $host = $3;
+                     $server = $4;
+                     $killer = $5;
+                     $message = $6;
+                     IRC::print "$time \003".$color_darkred."   KILL\t$nick (\003$color_darkgrey$user\003$color_grey@\003$color_darkgrey$host\003$color_darkred) on $server by $killer (\003$color_white$quitmsg\003$color_darkred)\003\n";
+
+                 }
+                 else
+                 {
+                     return 0;
+                 }
          }
          else
          {
+           #didnt understand it, just let xchat print it
             return 0;
          }
          # Successfully handled it, return handled