• Home
  • Servers
  • Chat
  • Channels
  • Commands
  • Forum
  • FAQ
  • Software
  • Quotes
Topic Options
Rate This Topic
#5172 - 06/11/09 10:43 AM Auto Identify to NickServ
iAlex Offline
Over 100 posts

Registered: 09/01/08
Posts: 100
Loc: Kongsvinger, 2209 Norway.
Of course, XChat auto identies you when you connect to the server when the password is given in the Network list. But it does not identify you on nickchange. So, here is some perl magic for you:
Code:
#!/usr/bin/perl
no warnings;

my $pass = 'Enter Nickserv Password here';

Xchat::register('ns','v0.1','Auto-identify yourself');
Xchat::hook_server('NOTICE',notice);


sub notice {
    my $data = "@{$_[0]}";
    my $tmpnick = Xchat::get_info('nick');
    if ($data =~ /:(\S+)!(\S+)@(\S+) NOTICE $tmpnick :(.*)/i) {
        ($id,$ident,$host,$msg) = ($1,$2,$3,$4);
        if ($id eq 'NickServ') {
            if ($msg =~ /This nickname is registered and protected. If it is your/i) {
                Xchat::command("ns IDENTIFY $pass")
            }
        }
    }
    Xchat::EAT_NONE
}


Edited by iAlex (06/11/09 10:51 AM)
_________________________
http://ialex.info
ialex94wr@gmail.com
alex@ialex.info

Top
Sponsored Links
Sponsored Links
Member
*****

Registered: 27/08/04
Posts: 10136
Loc: Mountain View, CA
Top


Moderator:  mandy