1use strict; 2use Irssi; 3use vars qw($VERSION %IRSSI); 4 5$VERSION = "1.0"; 6%IRSSI = ( 7 authors => 'PrincessLeia2', 8 contact => 'lyz\@princessleia.com ', 9 name => 'gimmie', 10 description => 'a bot script, using ! followed by anything the script will say (as an action): gets nickname anything', 11 license => 'GNU GPL v2 or later', 12 url => 'http://www.princessleia.com/' 13); 14 15sub event_privmsg { 16my ($server, $data, $nick, $mask, $target) =@_; 17my ($target, $text) = $data =~ /^(\S*)\s:(.*)/; 18 return if ( $text !~ /^!/i ); 19 if ( $text =~ /^!coffee$/i ) { 20 $server->command ( "action $target hands $nick a steaming cup of coffee" ); 21 } 22 elsif ($text =~ /^!chimay$/i ) { 23 $server->command ( "action $target hands $nick a glass of Chimay" ); 24 } 25 elsif ($text =~ /^!pepsi$/i ) { 26 $server->command ( "action $target gives $nick a can of Star Wars Pepsi" ); 27 } 28 elsif ($text =~ /^!ice cream$/i ) { 29 $server->command ( "action $target gives $nick a chocolate ice cream with lots of cherries" ); 30 } 31 elsif ($text =~ /^!$nick$/i ) { 32 $server->command ( "msg $target get yourself?" ); 33 } 34 else { 35 my ($gimmie) = $text =~ /!(.*)/; 36 $server->command ( "action $target Gets $nick $gimmie \0032<\%)"); 37 } 38} 39Irssi::signal_add('event privmsg', 'event_privmsg'); 40