All pastes #416819 Raw Edit

Untitled

public text v1 · immutable
#416819 ·published 2007-03-30 14:26 UTC
rendered paste body
#!/usr/bin/perl
use warnings;
@double=("4", "6", "8", "10", "12", "14", "16");
@five=("5", "25", "35", "45", "55", "65", "75");
@color=("1", "11", "31","51", "71", "81", "91");
@jackpot=("121");
@test=("2", "3", "6", "7", "9");
sub lucky {
	return int(rand(120) + 1);
		}
$result=lucky();
sub test {
	return int(rand(@test));
		}
$cool=test();
$double=grep $_ eq $result,@lucky;
$five=grep $_ eq $result,@five;
$color=grep $_ eq $result,@color;
$jackpot=grep $_ eq $result,@jackpot;
$dokimi=grep $_ eq $cool,@test; 
if ($double) {
	print "There you go! [$result]\n" }
	elsif ($five) {
	print "Good! Your money x 5! [$result]\n" }
	elsif ($color) {
	print "C-O-L-O-R!!! [$result]\n" }
	elsif ($jackpot) {
	print "JACKPOT WINNER SUPER DUPER PLAYER! [$result]\n " }
	elsif ($dokimi)	{
	print "epiase to test [$cool]"; }	
else { print "Was a bad number! [$result]\n" }

# THe game !
#and now comes the bot!
#!/usr/bin/perl -w
use Net::IRC;
my $irc = new Net::IRC;

#						configuration
#						-------------
@admins=("Admin");
my $nick="test";
chop (my $realname = `whoami`);
my $username = "i686";
$server="server";
$port="6667";
$channel="#test";
#						end of config
#						-------------
#useful $variables
chop (my $os=`uname -o`);

my $conn = $irc->newconn(Server =>  $server,Port =>  $port,Nick =>  $nick,Ircname =>  $realname,Username => $username);
$conn->{channel} = $channel;
$conn->add_handler('376', \&on_connect);
sub on_connect {
	my $conn = shift;
	$conn->join($conn->{channel});
	$conn->privmsg($conn->{channel}, "0,1test0r v0.1 loaded. Running on $os. My admin is @admins");
	$conn->privmsg($conn->{channel}, "Safe mode: ON and testing.");	
	$conn->{connected} = 1;
}

$irc->start();