mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Added /CLONES script
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@776 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
a712a5c11a
commit
a7c364addb
@ -1,6 +1,7 @@
|
|||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
autoop.pl \
|
autoop.pl \
|
||||||
autorejoin.pl \
|
autorejoin.pl \
|
||||||
|
clones.pl \
|
||||||
hello.pl \
|
hello.pl \
|
||||||
privmsg.pl \
|
privmsg.pl \
|
||||||
realname.pl \
|
realname.pl \
|
||||||
|
26
scripts/clones.pl
Normal file
26
scripts/clones.pl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# /CLONES - display real name of nick
|
||||||
|
|
||||||
|
use Irssi;
|
||||||
|
use Irssi::Irc;
|
||||||
|
|
||||||
|
sub cmd_clones {
|
||||||
|
my ($data, $server, $channel) = @_;
|
||||||
|
my %hostnames, $host, @nicks, $nick;
|
||||||
|
|
||||||
|
@nicks = $channel->nicklist_getnicks();
|
||||||
|
|
||||||
|
foreach $nick (@nicks) {
|
||||||
|
$hostnames{$nick->values()->{'host'}}++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$channel->print("Clones:");
|
||||||
|
foreach $host (keys %hostnames) {
|
||||||
|
my $clones = $hostnames{$host};
|
||||||
|
if ($clones >= 2) {
|
||||||
|
$channel->print("$host: $clones");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Irssi::command_bind('clones', '', 'cmd_clones');
|
Loading…
Reference in New Issue
Block a user