Sign in to follow this  
Followers 0
wesley57

Randomize mouse click positions?

3 posts in this topic

Lets say for example I have this mouse click command:

MouseClick("right", 295, 353, 1, 0)

My question: Is there a way to give it a variable coordinate amount, so it can randomy click within, perhaps, plus or minus 4 pixels of the given xy coordinates?

I was hoping there was some sort of way to do this, any help would be appreciated, thanks!

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Random

--------------------------------------------------------------------------------

Generates a pseudo-random float-type number.

Random ( [Min [, Max [, Flag]]] )

Parameters

Min [optional] The smallest number to be generated. The default is 0.

Max [optional] The largest number to be generated. The default is 1.

Flag [optional] If this is set to 1 then an integer result will be returned. Default is a floating point number.

Return Value

Success: Returns a pseudo-random number between Min and Max.

Failure: Returns 0 and sets @error flag:

0 success.

1 Bad parameters.

Int

--------------------------------------------------------------------------------

Returns the integer (whole number) representation of an expression.

Int ( expression )

Parameters

expression An expression to convert into an integer.

Return Value

Returns an integer.

$startx = 295
$starty = 353

$x = Int(Random($startx - 4, $startx + 4))
$y = Int(Random($starty - 4, $starty + 4))

MouseClick("right", $x, $y, 1, 0)
Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Alirght, thats just what i needed! Thanks!

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0