Skip to content

Instantly share code, notes, and snippets.

@xim
Created November 9, 2010 21:39
Show Gist options
  • Save xim/669864 to your computer and use it in GitHub Desktop.
Save xim/669864 to your computer and use it in GitHub Desktop.
A short and annoying script for irssi, made on request :p
use strict;
use vars qw($VERSION %IRSSI);
$VERSION = '0.1';
%IRSSI = (
authors => 'Morten M. Neergaard',
contact => 'user xim some major IRC networks? =)',
name => 'annoy.pl',
description => '/annoy <msg> # sends <msg> to all in current channel (except me)',
license => 'Who cares',
url => 'http://gist.github.com/669864',
changed => '2010-11-09',
);
sub annoy {
my ($msg, $server, $window) = @_;
if (!$server) {
Irssi::print("Not connected to a server in this window.");
return;
}
elsif ($window->{type} ne "CHANNEL") {
Irssi::print("Not a channel window.");
return;
}
my @nicks = $window->nicks();
@nicks = map {$_->{nick}} @nicks;
@nicks = grep {$_ !~ /^xim$/} @nicks;
$msg = join(', ', @nicks) . ': ' . $msg;
$server->command('msg ' . $window->{name} . ' ' . $msg);
}
Irssi::command_bind('annoy','annoy');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment