Random Clicks

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
thaumaturgy
Junior Coder
Posts: 24
Joined: Mon Nov 01, 2004 1:30 pm

Random Clicks

Post by thaumaturgy » Mon Jun 05, 2006 5:59 pm

Hello all, If one of you good people know how to make a program randomly click different places it would be a great help to me. Sample script as a starting point is below. Thanks for any help or ideas you can give me.


Dialog>Dialog1
Caption=Stuff
Width=285
Height=116
Top=622
Left=-2
Button=Start,8,8,75,25,4
Button=Pause,8,48,75,25,3
EndDialog>Dialog1

Show>Dialog1

Label>ActionLoop
wait>.0005
GetDialogAction>Dialog1,r
if>r=4,Start
if>r=3,Pause
if>r=2,Exit
Goto>ActionLoop

Label>Start
ResetDialogAction>Dialog1

Label>Loop
wait>.0005
GetDialogAction>Dialog1,r
if>r=4,Start
if>r=3,Pause
if>r=2,Exit

//// when color appears jump to "randomclicks"
GetPixelColor>456,789,a
if>%a%=645465
Goto>randomclicks
endif
Goto>Loop

Label>randomclicks
//// randomly click 10 different places here

Goto>Loop
Label>Exit

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Jun 05, 2006 6:15 pm

How about this:

Code: Select all

//// randomly click 10 different places here 
Let>x_max=1024
Let>y_max=728
Let>k=0
Repeat>k
  Random>x_max,x
  Random>y_max,y
  MouseMove>x,y
  LClick
  Let>k=k+1
Until>k=10
Modify x_max and y_max to suit your screen dimensions.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

thaumaturgy
Junior Coder
Posts: 24
Joined: Mon Nov 01, 2004 1:30 pm

Post by thaumaturgy » Mon Jun 05, 2006 8:09 pm

Thank you Very much mtettmar, you just made my day. :D

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