To start, hold ctrl, shift or alt and click anywhere on the screen to store the position you would like to repeatedly click. You can use all three to cycle through multiple positions (i.e. "File">"Save">"Okay">"File">"Save">"Okay">...)
Finally ctrl+shift+click will set a position to be clicked a lot. (it will be clicked as many times as you've defined %repeats% at the top)
more so for games, you can use ctrl+click to define a start point followed by shift+click to define an end point and you can either click along the x or y between them.
Hotkeys:
F6:: starts the clicker loop, cycling ctrl > shift > alt positions then farming.
F7:: will click repeatedly, vertically, between ctrl and shift positions
Shift+F7:: will do the same, horizontally, between ctrl to shift positions
Holding [F5] during runtime will stop it saving the stored locations, allowing you to change one or more
[Pause] (held during runtime) will reload the script
Code: Select all
CoordMode, Mouse, Screen
increment := 10 ;distance between clicks in the space of clickRow and clickColumn
repeats := 100
^LButton::
MouseGetPos cx, cy
return
^+LButton::
MouseGetPos csx, csy
return
+LButton::
MouseGetPos sx, sy
return
!LButton::
MouseGetPos ax, ay
return
pause::reload
F6::
sleep 250
loop {
if GetKeyState("F5")
break
if (cx > 0)
click %cx%, %cy%
if (sx > 0)
click %sx%, %sy%
if (ax > 0)
click %ax%, %ay%
if (csx > 0)
click %csx%, %csy%, %repeats%
}
return
clickColumn:
~F7::
sleep 250
index := cy
loop {
if GetKeyState("F5")
break
click %cx%, %index%
index+=increment
if (index > sy)
goto clickColumn
}
return
clickRow:
+F7::
sleep 250
index := cx
loop {
if GetKeyState("F5")
break
click %index%, %cy%
index+=increment
if (index > sx)
goto clickRow
}
return
I would also like to be able to click in a sweeping grid with ctrl+shift+F7. I'm positive I can nest a loop in a loop like anyone else but I'd be curious if anyone has some sneaky deaky tricks that could make my code neater, or show off some Autohotkey prowess.
Thanks for taking the time to take a look at my script!