#!/usr/bin/perl -w # # Implements auto-identify in PTnet (The Portuguese IRC network, at irc.ptnet.org:6667) # Now supports multiple nicks/passwords. # # IRC::print ":: Auto-Ident for PTnet is loaded ::\n"; IRC::register ("PTnet Auto-Ident", "1.2", "", ""); IRC::add_message_handler("NOTICE", "identify"); # Enter your nicks/passwords here # The format should be quite clear in the example! (at least, I hope so) # Theoretically, there's no limit to the number of nicks. %my_passwords= ( "Nick1" => "password1", "Nick2" => "password2", "Nick3" => "password3"); # This is useful when you have one password you use by default. It's optional, # so you can simply comment it out. # If it exists, it'll be used whenever a nick isn't found in the above table. $defaultpass = "mydefaultpassword"; # don't edit under this line (unless you're adapting this to another network :)) # This is part of the string sent by the nickserv when asking for a # password. Change it at will to use this script in other networks. $nsidentstr = "Nick registado e protegido"; sub identify { $my_nick = IRC::get_info(1); my $line = shift(@_); $line =~ /:(.*)!(.*@.*) .*:(.*)/; if (($1 =~ /NickServ/) && (($my_passwords{$my_nick}) || $defaultpass) ) { if ($line =~ /$nsidentstr/) { $sentpass=$my_passwords{$my_nick}?$my_passwords{$my_nick}:$defaultpass; IRC::command("/RAW NickServ :identify $sentpass"); return 1; } } return 0; }