A number guessing game for AutoIt.

I played around with AutoIt and came up with, yes, another number guessing game. This was a great way to get a feel for what making AutoIt scripts will be like. It’s not too difficult and is quite similar to programming in BASIC. Again, this following script is for AutoIt and shouldn’t be confused with VBScript, although the two scripts do look similar.

$IntNumber=Int(Random(1, 100, 1))
$answer=Int(0)

while $answer $IntNumber

$answer = InputBox(“Guess the Number”, “What is your guess?”)

If $answer=”” then
Exit
ElseIf $answer > $IntNumber Then
MsgBox(4096,”Incorrect”, “Too high.”)
ElseIf $answer < $IntNumber Then MsgBox(4096,”Incorrect”, “Too low.”) EndIf wend MsgBox(4096,”W00t!”, “You guessed it!”)

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s