## Recommended Posts

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

##### Share on other sites

```\$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

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...