skittles irc script
Platform: Perl
Published Jan 14, 2010
Updated Jan 15, 2010
basically connects to whatever irc server you choose and hands out skittles when the command is used :).. i realize that it would be much easier to make a script like this in msl but i need experience with perl. apologies for any problems with it.
#!/usr/bin/perl
$server = "irc.whateverserver.net"; # you change everything from server to pass
$port = 6667;
$nick = "yournick";
$ident = "yourident";
$realname = "yourrealname";
$chan = "#yourchannel";
$pass = "yourpass";
use IO::Socket;
$irc=IO::Socket::INET->new(
PeerAddr=>$server,
PeerPort=>$port,
Proto=>'tcp')or die "DEAD!";
print "$nick has connected to $server on $chan\n";
print $irc "USER $ident $ident $ident $ident :$realname\n";
print $irc "NICK $nick\n";
print $irc "PRIVMSG nickserv/@/services.yournetwork.net :identify $pass\n"; #you change this
print $irc "join $chan\n";
while(defined($in=<$irc>)){
if($in=~/PING(.*)/){print $irc "PONG :$1\n";}
print "$in\n";
if($in=~/!skittle/){
$x = int(1 + rand 20);
if ($x == 1){ print $irc "PRIVMSG $chan :gives a 9lime skittle to $'\n";}
elsif ($x == 2){ print $irc "PRIVMSG $chan :gives a 6grape skittle to $'\n";}
elsif ($x == 3){ print $irc "PRIVMSG $chan :gives a 8lemon skittle to $'\n";}
elsif ($x == 4){ print $irc "PRIVMSG $chan :gives a 7orange skittle to $'\n";}
elsif ($x == 5){ print $irc "PRIVMSG $chan :gives a 12raspberry skittle to $'\n";}
elsif ($x == 6){ print $irc "PRIVMSG $chan :gives a 5wild cherry skittle to $'\n";}
elsif ($x == 7){ print $irc "PRIVMSG $chan :gives a 5berry punch skittle to $'\n";}
elsif ($x == 8){ print $irc "PRIVMSG $chan :gives a 3melon berry skittle to $'\n";}
elsif ($x == 9){ print $irc "PRIVMSG $chan :gives a 8banana berry skittle to $'\n";}
elsif ($x == 10){ print $irc "PRIVMSG $chan :gives a 9kiwi lime skittle to $'\n";}
elsif ($x == 11){ print $irc "PRIVMSG $chan :gives a 7mango tangelo skittle to $'\n";}
elsif ($x == 12){ print $irc "PRIVMSG $chan :gives a 11pineapple passionfruit skittle to $'\n";}
elsif ($x == 13){ print $irc "PRIVMSG $chan :gives a 4strawberry starfruit skittle to $'\n";}
elsif ($x == 14){ print $irc "PRIVMSG $chan :gives a 8lemon berry skittle to $'\n";}
elsif ($x == 15){ print $irc "PRIVMSG $chan :gives a 14mixed berry skittle to $'\n";}
elsif ($x == 16){ print $irc "PRIVMSG $chan :gives a 13peach pear skittle to $'\n";}
elsif ($x == 17){ print $irc "PRIVMSG $chan :gives a 7orange mango skittle to $'\n";}
elsif ($x == 18){ print $irc "PRIVMSG $chan :gives a 13strawberry banana skittle to $'\n";}
elsif ($x == 19){ print $irc "PRIVMSG $chan :gives a 5chocolate skittle to $'\n";}
else { print $irc "PRIVMSG $chan :gives a 4strawberry skittle to $'\n";}
}
}
close($irc);