Subroutine basics?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
joe7dust
Posts: 20
Joined: 17 Jun 2018, 15:05

Subroutine basics?

17 Jun 2018, 15:30

Code: Select all

Loop
{
click
sleep #
click
sleep #
}
return

I also want to add a subroutine that is only active after toggling a 2nd hotkey. This one would look for a specific pixel pattern and click it if found. Anyone know how to do this in a beginner friendly way?
Last edited by joe7dust on 22 Jul 2018, 17:17, edited 1 time in total.
imustbeamoron
Posts: 44
Joined: 18 Aug 2016, 22:56

Re: Subroutine basics?

17 Jun 2018, 17:04

i would go with a timer, as opposed to a loop.

something more like this.

Code: Select all

f8::								;press F8 to 
myTimer := !myTimer					;toggle the timer
if (myTimer)
	SetTimer, clickIT, 150
else 
	SetTimer, clickIT, off
return

clickIT:							;when timer is turned on, this label
Click								;gets called once every 150ms.
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, OrangeCat and 164 guests