use Irssi; use vars qw($VERSION %IRSSI); $VERSION = "0.0.1"; %IRSSI = ( authors => 'PrincessLeia2', contact => 'lyz\@princessleia.com ', name => 'r2d2', description => 'r2d2 moderator bot for scifi server', license => 'GNU GPL', url => 'http://www.princessleia.com/' ); my @mom = ("pleia2","princessleia2"); my @dad = ("Time","oco"); open ( LIST, " ); close LIST; open ( CLOCKIE, " ); close CLOCKIE; open ( BALL, " ); close BALL; sub event_join { my ($server, $data, $nick, $host) = @_; my ($target) = $data =~ /^:(.*)/; return if ( $target !~ /#r2d2/i ); foreach $person (@friend ) { if ($nick =~ /^$person$/i) { $server->command ( "mode $target +v $nick" ); } } foreach $mother (@mom ) { if ($nick =~ /^$mother$/i) { $server->command ( "mode $target +v $nick" ); $server->command ( "MSG $target \0036, . + * \0032^ * -,\0036YAY! Hi Mommy!!! \0032, . + * \0036^ * - ," ); } } foreach $father (@dad ) { if ($nick =~ /^$father$/i) { $server->command ( "mode $target +v $nick" ); $server->command ( "MSG $target \0036, . + * \0032^ * -,\0036YAY! Hi $nick!!! \0032, . + * \0036^ * - ," ); } } } sub event_privmsg { my ($server, $data, $nick, $mask, $target) =@_; my ($target, $text) = $data =~ /^(\S*)\s:(.*)/; return if ( $text !~ /^bbl$/i ); $server->command ( "MSG $target Take Care, May The Force Be With You" ); } sub event_privmsg2 { my ($server, $data, $nick, $mask, $target) =@_; my ($target, $text) = $data =~ /^(\S*)\s:(.*)/; return if ( $text !~ /^moo$/i ); $server->command ( "MSG $target Is that $nick or is there a coew in here?"); } sub event_privmsg3 { my ($server, $data, $nick, $mask, $target) =@_; my ($target, $text) = $data =~ /^(\S*)\s:(.*)/; return if ( $text !~ /^hi RēDē/i ); $server->command ( "MSG $target I love you $nick"); } sub event_privmsg4 { my ($server, $data, $nick, $mask, $target) =@_; my ($target, $text) = $data =~ /^(\S*)\s:(.*)/; return if ( $text !~ /clockbot/i ); $clocky = $clockbot[rand @clockbot]; $server->command ( "msg $target $clocky" ); } sub event_privmsg5 { 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 cup of MykBev's Coffee" ); } elsif ($text =~ /^!email$/i ) { $server->command ( "action $target lyz\@princessleia.com" ); } elsif ($text =~ /^!webpage$/i ) { $server->command ( "action $target www.princessleia.com" ); } elsif ($text =~ /^!chimay$/i ) { $server->command ( "action $target hands $nick a glass of Chimay" ); } elsif ($text =~ /^!ice cream$/i ) { $server->command ( "action $target gives $nick a chocolate ice cream with lots of cherries" ); } elsif ($text =~ /^!soda$/i ) { $server->command ( "action $target gives $nick a soda" ); } elsif ($text =~ /^!8ball$/i ) { $server->command ( "msg $target You have to ask a question! Type !8ball your question?" ); } elsif ($text =~ /^!8ball.*\w$/i ) { $server->command ( "msg $target Your question must end with a question mark. Type !8ball your question? " ); } elsif ($text =~ /^!8ball..*\?$/i ) { $answer = $eightball[rand @eightball]; $server->command ( "msg $target $answer" ); } elsif ($text =~ /^!$nick$/i ) { $server->command ( "msg $target get yourself?" ); } elsif ($text =~ /^!Time$/i ) { foreach $mother (@mom ) { if ($nick =~ /$mother$/i) { $server->command ( "msg $target Mom!!!" ); } } } elsif ($text =~ /^!PrincessLeia2$/i ) { foreach $father (@dad ) { if ($nick =~ /$father$/i) { $server->command ( "msg $target hehe $nick, you already HAVE PrincessLeia2" ); } } } elsif ($text =~ /^!myn$/i ) { foreach $mother (@mom ) { if ($nick =~ /$mother$/i) { $server->command ( "action $target gives $nick her Timeski" ); } } foreach $father ( @dad ) { if ( $nick =~ /$father$/i ) { $server->command ( "action $target gives $nick his PrincessLeia2" ); } } } else { my ($gimmie) = $text =~ /!(.*)/; $server->command ( "action $target Gets $nick $gimmie \0032<\%)"); } } Irssi::signal_add('event join', 'event_join'); Irssi::signal_add('event privmsg', 'event_privmsg'); Irssi::signal_add('event privmsg', 'event_privmsg2'); Irssi::signal_add('event privmsg', 'event_privmsg3'); Irssi::signal_add('event privmsg', 'event_privmsg4'); Irssi::signal_add('event privmsg', 'event_privmsg5');