I'm a big noob with scripting things and i need some help.
How can i make these numbers below as randoms ones
MouseClick, left, 841, 560
SLeep, 300
Thanks in advance :]
I'm a big noob with scripting things and i need some help.
How can i make these numbers below as randoms ones
MouseClick, left, 841, 560
SLeep, 300
Thanks in advance :]
I've never used autohotkey before, but a quick google search brought me to here: Random
So, to do something like that, you should make 2 variables. RandX and RandY. Then simply use the format below:Code:Random, OutputVar [, Min, Max] Random, , NewSeed
.Code:Random, rand, 1, 10
So, for the coords in your post, something like:
Again, I've never used autohotkey, so I can't test that. But it should be working. Cheers!Code:Random, RandX, 839, 844 Random, RandY, 555, 565 MouseClick, left, RandX, RandY Sleep, 300
As SpamBears says, plus:
if I wish to have the bot click on a random location on a button, I find the coordinates of:
The button's top left X, Y coordinates, e.g. 85, 401
The button's bottom right X, Y coordinates, e.g. 367, 438
Then generate the X and Y coordinates I wish the script to use:
Random, Xcoord, 85, 367
Random, Ycoord, 401, 438
And finally make the click
MouseClick, left, Xcoord, Ycoord
The above example is for the START button in a game window with resolution of 800, 600
For the sleep part, you could just:
Random, randSleep, 250, 350
Sleep, randSleep