User Control Panel
Advertisements

HELP US, HELP YOU!

Dos Bot Guess My Number

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
Cheater
Senior Member
Senior Member


Joined: 10 Jun 2005
Posts: 236

Reputation: 15.8Reputation: 15.8

PostPosted: Fri Jul 29, 2005 10:16 pm    Post subject: Dos Bot Guess My Number Reply with quote

This is a simple Guess My Number command for Dos Bot. Please see the Dos Bot post in the Bots forum for info on how to install it.

Usage: !number

Example (correct guess):

Quote:

!number
Please enter the highest possible number I can choose
50
Please guess a number 1-50
37
You guessed my number correct, nice job



Example (wrong guess):

Quote:

!number
Please enter the highest possible number I can choose
50
Please guess a number 1-50
37
Your Guess: 37
My Number: 15
Better luck next time


Here is the code:

Code:

&number;
sub number {
   print "Please enter the highest possible number I can choose\n";

   my $max = <STDIN>;
   chomp $max;

   print "Please guess a number 1-$max\n";

   my $guess = <STDIN>;
   chomp $guess;

   my $number = int (rand($max)) + 1;

   if ($guess eq $number) {
      print "You guessed my number correct, nice job\n";
   }

   else {
      print "Your Guess: $guess\n";
      print "My Number: $number\n";
      print "Better luck next time\n";
   }
}


Save it as number.pl in your commands folder.

Note: You should leave the &number; part at the top of the sub there. I might use it in a later version (might not though)
Back to top
draget
Not Yet a God
Not Yet a God


Joined: 29 Dec 2004
Posts: 367
Location: Australia
Reputation: 32.2Reputation: 32.2Reputation: 32.2

PostPosted: Sat Jul 30, 2005 12:49 am    Post subject: Reply with quote

why bother with the sub?
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