use Irssi; use Irssi::Irc; use strict; use vars qw($VERSION %IRSSI); $VERSION="0.1.0"; %IRSSI = ( authors=> 'BC-bd', contact=> 'bd@bc-bd.org', name=> 'reslap', description=> 'Autoreslaps people', license=> 'GPL v2', url=> 'https://bc-bd.org/svn/repos/irssi/reslap', ); # $Id$ # for irssi 0.8.5 by bd@bc-bd.org # ######### # USAGE ### # ######### # OPTIONS ######### # ### ################ ### # # Changelog # # Version 0.1.0 # - initial release # ### ################ sub sig_action() { my ($server,$msg,$nick,$address,$target) = @_; my $window = $server->window_find_item($target); my $match = "slaps $server->{nick} around a bit with a "; my $fish = $msg; $fish =~ s/\Q$match\E//e; if ($fish ne $msg) { $window->command("/me slaps $nick around a bit with a ".$fish." (autoreslap successfull)"); return 0; } $match = "drives over $server->{nick}"; my $jump = $msg; $jump =~ s/\Q$match\E//e; if ($jump ne $msg) { $window->command("/me jumps away (autoavoidance successfull)"); return 0; } } # "message irc action", SERVER_REC, char *msg, char *nick, char *address, char *target Irssi::signal_add_last('message irc action', 'sig_action');