rendered paste bodyuse strict;
use Irssi;
use vars qw($VERSION %IRSSI);
$VERSION = '$Id: flashbar.pl v0.1 2009/01/05 17:51:27 eim Exp $';
%IRSSI = (
authors => 'fuqinfruit',
contact => 'breakfast@partyvan.fm',
name => 'flashingbar',
description => 'Custom hilight users in active channel.',
license => 'GPLv3',
);
sub moline {
my ($data,$server,$witem) = @_;
return unless $witem;
if ($data) {
$witem->print("/flash <text> to flash users in active channel with your textline.");
$witem->print('/flash <text> $nick <text> for custom placing of flashed nickname.');
}
else {
my @nickcom = Irssi::active_win->{active}->nicks;
my @nicks;
for my $nick (@nickcom) {
push @nicks, $nick->{nick};
}
if ($data =~ /\$nick/) {
for my $nick (@nicks) {
my $dongs = $data;
$dongs =~ s/\$nick/$nick/g;
$witem->command("os oline ".$witem->{name}."$dongs +g") unless ($nick eq $server->{nick});
}
}
else {
for my $nick (@nicks) {
$witem->command("os oline $nick +g") unless ($nick eq $server->{nick});
}
}
}
}
Irssi::command_bind moline => \&moline;