LibraIRC.net Forums
Show clones on join - Printable Version

+- LibraIRC.net Forums (https://librairc.net/forums)
+-- Forum: Public Forums (https://librairc.net/forums/forum-47.html)
+--- Forum: IRC Discussions (https://librairc.net/forums/forum-57.html)
+---- Forum: XChat (https://librairc.net/forums/forum-12.html)
+---- Thread: Show clones on join (/thread-223.html)



Show clones on join - Omar - 24-02-2012

  • This addon will let you see the other clones from the users when one of them join the room you are already on it.

Example:

Quote: :MinDFreak and Chinshy are clones from host MinDFreak.Chanops.Org
* MinDFreak (Agent@MinDFreak.Chanops.Org) has joined #blabla

Download is at the end of the topic undername Clones On Join.pl

You Got two ways for how to load the addon on your XChat script

1- Go on XChat on the MenuBar Load Plugin or Script then choose the place of the Clones On Join.pl and then press Open .

2-Go on Window on the MenuBar Plugins and Scripts [b]Load Open[/b]

Code:

Code:
my $name = "Simple Clone Checker";
my $version = '0.2';
my $description = "Checks for multiple nicks from the same host";
Xchat::register($name, $version, $description);
Xchat::print "$name version $version loaded\n";
my $log = Xchat::get_info('xchatdir').'/clone.log';#log file
Xchat::hook_server('Join',\&onjoin);


sub onjoin {
my $getnick = ($_[0][0]);
my @gethost = split(/(.*)!(.*)\@(.*)/,$getnick);
my $host1=$gethost[3];
my $nick1=$gethost[1];
my @nick2 = split(/\:(.*)/,$nick1);
my $nick3 = $nick2[1];
my $date=localtime;
my $getchannel = ($_[0][2]);

my @users = IRC::user_list($channel1);
while (@users)
{
my ($nick4, $host2, $op, $voice, undef) = splice(@users, 0, 5);
my @host3 = split(/(.*)\@(.*)/,$host2);
my $host4 = $host3[2];

if ($host1 eq $host4)
{
if ($nick3 ne $nick4)
{

Xchat::print("$nick1 and $nick4 are clones from host $host1");
#open LOG, ">>$log";
#print LOG ("$getchannel ", "$nick1 ", "$nick4 ", "$host1 ", "$date\n");
#close LOG;

}
}

}


return Xchat::EAT_NONE;

}