Page 1 of 1

Random Area Around MouseGetPos?

Posted: 24 Feb 2018, 10:10
by WhatsThat88
I'm looking for something to record mouse position and randomize that area into a variable.
I'm not sure if I'm describing that properly, as I couldn't find anything that suited my needs looking for variations of that thought.
Anyway, this code doesn't work but could anyone help me morph that into something that works?

Code: Select all

MouseGetPos, ax, ay

Random, axRandom, (%ax%-5), (%ax%+5)
Random, ayRandom, (%ay%-5), (%ay%+5)

MouseMove, %axRandom%, %ayRandom%, 1

Re: Random Area Around MouseGetPos?  Topic is solved

Posted: 24 Feb 2018, 10:14
by Odlanir

Code: Select all

Random, axRandom, % ax-5, % ax+5
Random, ayRandom, % ay-5, % ay+5

Re: Random Area Around MouseGetPos?

Posted: 24 Feb 2018, 10:17
by WhatsThat88
That is perfect, thank you.