Jump to content

Recommended Posts

Posted

Ok so lets say I want something like this. It would have you pick a number, EG: (pick a number between: (10-30)), and then the input of that would be like $input1

so you could put it in something like Int(Random(1,$input1)) When you open the prog it would ask, "picka number between blah blah blah" then the program would start after you inputed that.

Any ideas on how to do that?

thx for great support on autoit forums

Posted (edited)

$min=10
$max=30

Do
$guess=int(InputBox ("Pick a number","between " & $min & " and " &$max) )
Until $guess>=$min and $guess<=$max
$ran=int(random($min,$max+1))
MsgBox(1,"Your guess was " & $guess,"The number I was thinking was "&$ran)

or if you want a game,

$min=10
$max=30

$ran=int(random($min,$max+1))

Do
$guess=int(InputBox ("Pick a number","between " & $min & " and " &$max) )
If $guess>$ran Then MsgBox(1,"Nice guess but..","my number is lower")
If $guess<$ran Then MsgBox(1,"Nice guess but..","my number is higher")
Until $guess=$ran
MsgBox(1,"Hurray!!" ,"You guessed the number I was thinking "&$ran)
Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...