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