CODE
#!/usr/bin/perl
# $user kai $pass ta allazoume :)
# opws kai tin @channels list
no warnings;
my $nick = 'To-nick-mas-edw';
my $pass = 'kai-o-kwdikos';
Xchat::register('ns','v0.1','Auto-identify/recover nick');
Xchat::hook_server('433',r433);
Xchat::hook_server('376',r376);
Xchat::hook_server('NOTICE',notice);
my @channels = ('#channel1','#channel2','#channel3');
sub r433 {
Xchat::command("MSG nickserv ghost $nick $pass");
}
sub r376 {
Xchat::command("NICK $nick")
}
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' && $ident eq 'service' && $host eq 'irc.gr') {
if ($msg =~ /This nickname is registered and protected. If it is your/i) {
Xchat::command("MSG $id IDENTIFY $pass")
}
if ($msg =~ /Ghost with your nick has been killed/i) {
Xchat::command("NICK $nick")
}
if ($msg =~ /Password accepted - you are now recognized/) {
if (Xchat::get_info('nick') eq $nick) {
foreach my $x (0..$#channels) {
Xchat::command("JOIN $channels[$x]")
}
}
}
}
}
Xchat::EAT_NONE
}
# $user kai $pass ta allazoume :)
# opws kai tin @channels list
no warnings;
my $nick = 'To-nick-mas-edw';
my $pass = 'kai-o-kwdikos';
Xchat::register('ns','v0.1','Auto-identify/recover nick');
Xchat::hook_server('433',r433);
Xchat::hook_server('376',r376);
Xchat::hook_server('NOTICE',notice);
my @channels = ('#channel1','#channel2','#channel3');
sub r433 {
Xchat::command("MSG nickserv ghost $nick $pass");
}
sub r376 {
Xchat::command("NICK $nick")
}
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' && $ident eq 'service' && $host eq 'irc.gr') {
if ($msg =~ /This nickname is registered and protected. If it is your/i) {
Xchat::command("MSG $id IDENTIFY $pass")
}
if ($msg =~ /Ghost with your nick has been killed/i) {
Xchat::command("NICK $nick")
}
if ($msg =~ /Password accepted - you are now recognized/) {
if (Xchat::get_info('nick') eq $nick) {
foreach my $x (0..$#channels) {
Xchat::command("JOIN $channels[$x]")
}
}
}
}
}
Xchat::EAT_NONE
}
Gia lazy idlers :)