1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00
irssi/scripts/clones.pl

26 lines
462 B
Perl
Raw Normal View History

# /CLONES - display real name of nick
use Irssi;
use strict;
sub cmd_clones {
my ($data, $server, $channel) = @_;
my (%hostnames, $host, @nicks, $nick);
@nicks = $channel->nicks();
foreach $nick (@nicks) {
$hostnames{$nick->{host}}++;
}
$channel->print("Clones:");
foreach $host (keys %hostnames) {
my $clones = $hostnames{$host};
if ($clones >= 2) {
$channel->print("$host: $clones");
}
}
}
Irssi::command_bind('clones', 'cmd_clones');