2000-10-19 15:41:05 -04:00
|
|
|
# /CLONES - display real name of nick
|
|
|
|
|
|
|
|
use Irssi;
|
2001-07-16 16:22:45 -04:00
|
|
|
use strict;
|
2000-10-19 15:41:05 -04:00
|
|
|
|
|
|
|
sub cmd_clones {
|
|
|
|
my ($data, $server, $channel) = @_;
|
2001-07-16 16:22:45 -04:00
|
|
|
my (%hostnames, $host, @nicks, $nick);
|
2000-10-19 15:41:05 -04:00
|
|
|
|
2000-12-06 00:42:13 -05:00
|
|
|
@nicks = $channel->nicks();
|
2000-10-19 15:41:05 -04:00
|
|
|
|
|
|
|
foreach $nick (@nicks) {
|
2000-12-06 00:42:13 -05:00
|
|
|
$hostnames{$nick->{host}}++;
|
2000-10-19 15:41:05 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
$channel->print("Clones:");
|
|
|
|
foreach $host (keys %hostnames) {
|
|
|
|
my $clones = $hostnames{$host};
|
|
|
|
if ($clones >= 2) {
|
|
|
|
$channel->print("$host: $clones");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-13 13:19:59 -05:00
|
|
|
Irssi::command_bind('clones', 'cmd_clones');
|