Jump to content

Randomize mouse click positions?

Recommended Posts

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!

Link to post
Share on other sites



Generates a pseudo-random float-type number.

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


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.



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

Int ( expression )


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

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...