Loop command and sleep precision

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mclovinahk
Posts: 1
Joined: 25 Jul 2017, 20:26

Loop command and sleep precision

25 Jul 2017, 20:39

Hi , I have this code right here where it double clicks every 600 milisecond, however I need it to be precise.
The problem is that I have my double click delay to 120 ms, after a few seconds it will not sync with the 600 ms double click that I'm achieving.

how would I get

Code: Select all

	Click, 
sleep, 120
Click,
to run every 600ms, without taking into account the 120 second delay that I put?
The whole comman runs at 720ms because of the 120 ms delay. But I really need that in there.

Code: Select all

F10::
If (toggle := !toggle)
	SetTimer, Timer, -1
return
 
timer:
while toggle

{
	Click, 
sleep, 120
Click,
sleep, 600	
}

User avatar
Spawnova
Posts: 554
Joined: 08 Jul 2015, 00:12
Contact:

Re: Loop command and sleep precision

25 Jul 2017, 20:43

Just take off 120 from 600 = 480

Code: Select all

F10::
If (toggle := !toggle)
	SetTimer, Timer, -1
return
 
timer:
while toggle

{
	Click, 
sleep, 120
Click,
sleep, 480
}


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 327 guests