User Control Panel
Advertisements

HELP US, HELP YOU!

Lotto command

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
ph3nd
Newbie
Newbie


Joined: 07 Jun 2007
Posts: 1


PostPosted: Thu Jun 07, 2007 2:14 am    Post subject: Lotto command Reply with quote

Code:
if ($msg eq '!lottomenu')
{
   open (DATA, "./Files/menu/lottomenu.txt");
   @menu = <DATA>;
   close(DATA);
}

if ($msg eq '!drawlotto')
{
   my @numbers = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
                  "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
   $result = $numbers [int(rand(scalar(@numbers)))];
   open (FILE, ">>./Files/Lotto/draw.txt");
   print FILE "$result";
   close (FILE);
   $self->sendmsg("Lotto Number: $result");
}

if ($msg eq '!mylottonumber')
{
   if (!-e "./Files/Lotto/$username.txt")
   {
       $self->sendmsg("You Don't Have a Lotto Ticket\n To Buy One, type !buyticket");
   }
   else
   {
       open (DATA, "./Files/Lotto/$username.txt");
       @number = <DATA>;
       close(DATA);
       $self->sendmsg("Your Lotto Number: @number");
   }
}

if ($msg eq '!buyticket')
{
   if (!-e "./Files/Lotto/$username.txt")
   {
       my @numbers = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10",
                  "11", "12", "13", "14", "15", "16", "17", "18", "19", "20");
       $result = $numbers [int(rand(scalar(@numbers)))];
       open (FILE, ">>./Files/Lotto/$username.txt");
       print FILE "$result";
       close (FILE);
       $self->sendmsg("Your Lotto Number: $result");
   }
   else
   {
       $self->sendmsg("You have already bought a ticket this week");
   }
   
}
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group