summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-10-19 19:41:05 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-10-19 19:41:05 +0000
commita7c364addbc1f8d04229adaad5b8dcd8308348ba (patch)
treea750b59c42bf319299172673710fbdc66c106732 /scripts
parenta712a5c11a23c7b7de000b166e00a3942e7bbafb (diff)
downloadirssi-a7c364addbc1f8d04229adaad5b8dcd8308348ba.zip
Added /CLONES script
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@776 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am1
-rw-r--r--scripts/clones.pl26
2 files changed, 27 insertions, 0 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index f528e4d9..542c4700 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,6 +1,7 @@
EXTRA_DIST = \
autoop.pl \
autorejoin.pl \
+ clones.pl \
hello.pl \
privmsg.pl \
realname.pl \
diff --git a/scripts/clones.pl b/scripts/clones.pl
new file mode 100644
index 00000000..a562b968
--- /dev/null
+++ b/scripts/clones.pl
@@ -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');