Hello all,
I've been tearing my hair out over the last few days now trying to get this script working, so I thought I'd post and see if anyone was kind enough to ease my agony.
What I am aiming to do is getting my mouse to click within a "box" of preset bounds (co-ords) on the screen. The mouse click should every time be randomly placed within these bounds.
Any help at all would be much appreciated, I have scoured the forums for a similar question so if I am repeating a common question I'm sorry.
Thanks in advance,
Yo.
Getting mouse to click random pixels within bounds?
Moderators: JRL, Dorian (MJT support)
I got angry and scrapped most of it. Heres whats left

Code: Select all
// Set Bounds
Let>X1=0
Let>X2=200
Let>Y1=0
Let>Y2=200
lol.
Last edited by Yo on Sat Jul 21, 2007 3:43 am, edited 2 times in total.
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Here's the random clicking part, you'll have to put it in a loop to do what you want.
//Clickable area is xstart,ystart to xend,yend
Let>xstart=100
Let>ystart=150
Let>xend=200
Let>yend=250
Let>xmax=xend-xstart
Let>ymax=yend-ystart
Random>xmax,xrand
Random>ymax,yrand
Let>xpos=xstart+xrand
Let>ypos=ystart+yrand
MessageModal>%xpos% %ypos%
MouseMove>xpos,ypos
LClick
//Clickable area is xstart,ystart to xend,yend
Let>xstart=100
Let>ystart=150
Let>xend=200
Let>yend=250
Let>xmax=xend-xstart
Let>ymax=yend-ystart
Random>xmax,xrand
Random>ymax,yrand
Let>xpos=xstart+xrand
Let>ypos=ystart+yrand
MessageModal>%xpos% %ypos%
MouseMove>xpos,ypos
LClick