use strict; use vars qw($VERSION %IRSSI); use Irssi; $VERSION = "0.01"; %IRSSI = ( authors => 'Jesse Luehrs', contact => 'jluehrs2@uiuc.edu', name => 'gobots', license => 'BSD', changed => 'July 29, 2008', description => 'Filters a list of nicks (typically bots) into a separate '. '"bots" window', ); use warnings; # TODO: make this configurable my @bots = ( # 'Henzell', # 'Gretell', # 'NHBot', # 'Rodney', # 'Rodney3', # 'Doryen', # 'dataninja', # 'rubot', # 'flood', 'micro501', ); Irssi::signal_add 'message public' => sub { my ($server, $msg, $nick, $address, $target) = @_; my $window = Irssi::window_find_name 'bots'; return unless $window; for (@bots) { if ($_ eq $nick) { $window->print(sprintf("<%s> %s", $nick, $msg), MSGLEVEL_PUBLIC); Irssi::signal_stop; return; } } }; my $window = Irssi::window_find_name 'bots'; Irssi::print 'Create a window named \'bots\'' unless $window;