Getting mouse to click random pixels within bounds?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Yo
Newbie
Posts: 3
Joined: Sat Jul 21, 2007 3:09 am

Getting mouse to click random pixels within bounds?

Post by Yo » Sat Jul 21, 2007 3:17 am

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.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Jul 21, 2007 3:24 am

Can you post what you have so far?

mod mork
Newbie
Posts: 1
Joined: Sat Jul 21, 2007 3:23 am

Post by mod mork » Sat Jul 21, 2007 3:34 am

yes i have been wondering this for a long time too :D

Yo
Newbie
Posts: 3
Joined: Sat Jul 21, 2007 3:09 am

Post by Yo » Sat Jul 21, 2007 3:42 am

I got angry and scrapped most of it. Heres whats left :oops:

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.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sat Jul 21, 2007 3:42 am

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

Yo
Newbie
Posts: 3
Joined: Sat Jul 21, 2007 3:09 am

Post by Yo » Sat Jul 21, 2007 3:44 am

Woo at least I was on the right track
You truly are the automation wizard

Ta muchly kind sir

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts