#!/usr/bin/perl # # R²D² ~ By PrincessLeia2 # # lyz@princessleia.com # # www.princessleia.com # # an irc bot created for #13thHour on the events.scifi.com chat server ... # room moderator bot # # Script Born Date: 07.01.02 # This Version Date: 07.01.02 # # __ # /-o\ # | O | # /| O |\ # ||____|| # n n # # # IRC::register("R²D²",1.0,"",""); IRC::add_message_handler("JOIN","join_handler"); IRC::add_message_handler("PRIVMSG", "privmsg_handler"); my @mom = ("pleia2","princessleia2"); my @dad = ("Time","oco"); open ( LIST, " ); close LIST; open ( CLOCKIE, " ); close CLOCKIE; open ( BALL, " ); close BALL; sub join_handler { $thing = $_[0]; $_ = $thing; ( $nick, $user, $host, $hook, $channel ) = (m/:(\S+)!(\S+)\@(\S+)\s(\w+)\s:(.*)/);# I 'borrowed' the this line from madragoran's s-list script if ($channel =~ /#13thHour/i ) { foreach $item ( @friend ) { if ($nick =~ /$item$/i) { IRC::send_raw "MODE $channel +v $nick\n"; } } foreach $mother ( @mom ) { if ($nick =~ /$mother$/i) { IRC::send_raw "MODE $channel +v $nick\n"; IRC::send_raw ( "PRIVMSG $channel :\0036, . + * \0032^ * - , \0036YAY! Hi Mommy!!! \0032, . + * \0036^ * - ,\n" ); } } foreach $father ( @dad ) { if ( $nick =~ /$father$/i ) { IRC::send_raw "MODE $channel +v $nick\n"; IRC::send_raw ( "PRIVMSG $channel :\0036, . + * \0032^ * - ,\0036YAY! Hi $nick!!! \0032, . + * \0036^ * - ,\n" ); } } } return 0; } sub privmsg_handler { $thingy = $_[0]; $_ = $thingy; ( $nick, $user, $host, $hook, $channel, $say ) = (m/:(\S+)!(\S+)\@(\S+)\s(\w+)\s(\S+)\s:(.*)/); if ( $say =~ /clockbot/i ) { $clocky = $clockbot[rand @clockbot]; IRC::send_raw ( "PRIVMSG $channel :$clocky\n" ); } if ( $say =~ /^bbl$/i ) { IRC::send_raw ( "PRIVMSG $channel :Take Care, May The Force Be With You\n" ); } if ( $say =~ /^moo$/i ) { IRC::send_raw ( "PRIVMSG $channel :Is that a coew or is $nick in here?\n" ); } if ( $say =~ /^hi R³D³/i ) { IRC::send_raw ( "PRIVMSG $channel :I love you $nick\n" ); } if ( $say =~ /^!coffee$/i ) { IRC::send_raw ( "PRIVMSG $channel :\caACTION hands $nick a cup of MykBev's Coffee\ca\n" ); } elsif ($say =~ /^!8ball$/i ) { IRC::send_raw ( "PRIVMSG $channel :You have to ask a question! Type !8ball your question?\n" ); } elsif ($say =~ /^!8ball.*\w$/i ) { IRC::send_raw ( "PRIVMSG $channel :Your question must end with a question mark. Type !8ball your question?\n" ); } elsif ($say =~ /^!8ball..*\?$/i ) { $answer = $eightball[rand @eightball]; IRC::send_raw ( "PRIVMSG $channel :$answer\n" ); } elsif ($say =~ /^!time$/i ) { foreach $mother ( @mom ) { if ($nick =~ /^$mother$/i) { IRC::send_raw ( "PRIVMSG $channel :Mom!!!\n" ); } } } elsif ($say =~ /^!part$/i ) { foreach $mother ( @mom ) { if ($nick =~ /^$mother$/i) { IRC::command ( "/PART" ); } } } elsif ($say =~ /^!princessleia2$/i ) { foreach $father ( @dad ) { if ($nick =~ /^$father$/i) { IRC::send_raw ( "PRIVMSG $channel :hehe $nick, you already HAVE PrincessLeia2\n" ); } } } elsif ($say =~ /^!myn$/i ) { foreach $father ( @dad ) { if ($nick =~ /^$father$/i) { IRC::send_raw ( "PRIVMSG $channel :\caACTION gives you PrincessLeia2\ca\n" ); } } foreach $mother ( @mom ) { if ($nick =~ /^$mother$/i) { IRC::send_raw ( "PRIVMSG $channel :\caACTION gives you Time\ca\n"); } } } elsif ( $say =~ /^!webpage$/i ) { IRC::send_raw ( "PRIVMSG $channel :www.princessleia.com\n" ); } elsif ( $say =~ /^!email$/i ) { IRC::send_raw ( "PRIVMSG $channel :lyz\@princessleia.com\n" ); } elsif ( $say =~ /^!chimay$/i ) { IRC::send_raw ( "PRIVMSG $channel :\caACTION hands $nick a glass of Chimay\ca\n" ); } elsif ( $say =~ /^!ice cream$/i ) { IRC::send_raw ( "PRIVMSG $channel :\caACTION gives $nick a chocolate ice cream with lots of cherries\ca\n" ); } elsif ( $say =~ /^!.+/) { ( $nick, $user, $host, $hook, $channel, $gimmie ) = (m/:(\S+)!(\S+)\@(\S+)\s(\w+)\s(\S+)\s:!(.*)/); IRC::send_raw ( "PRIVMSG $channel :\caACTION Gets $nick $gimmie \0032<%)\ca\n" ); } return 0; } IRC::print("\0032R²D² \0036version 1.0 loaded \0032%)!\n");