summaryrefslogtreecommitdiffstats
path: root/scripts/gimmie.pl
blob: df0102d5d5e033d651ea1d101e97a4a6bb004d5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use strict;
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "1.0";
%IRSSI = (
    authors => 'PrincessLeia2',
    contact => 'lyz\@princessleia.com ',
    name => 'gimmie',
    description => 'a bot script, using ! followed by anything the script will say (as an action): gets nickname anything',
    license => 'GNU GPL v2 or later',
    url => 'http://www.princessleia.com/'
);

sub event_privmsg {
my ($server, $data, $nick, $mask, $target) =@_;
my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
     return if ( $text !~ /^!/i );
        if ( $text =~ /^!coffee$/i ) {
        	$server->command ( "action $target hands $nick a steaming cup of coffee" );
	}
        elsif ($text =~ /^!chimay$/i ) {
        	$server->command ( "action $target hands $nick a glass of Chimay" );
	}
        elsif ($text =~ /^!pepsi$/i ) {
        	$server->command ( "action $target gives $nick a can of Star Wars Pepsi" );
	}
        elsif ($text =~ /^!ice cream$/i ) {
        	$server->command ( "action $target gives $nick a chocolate ice cream with lots of cherries" );
	}
        elsif ($text =~ /^!$nick$/i ) {
        	$server->command ( "msg $target get yourself?" );
	}
        else {
        	my ($gimmie) = $text =~ /!(.*)/;
        	$server->command ( "action $target Gets $nick $gimmie \0032<\%)");
	}
}
Irssi::signal_add('event privmsg', 'event_privmsg');