.
Accurate timer
Best Answer Xtra , 13 May 2015 - 05:38 AM
SetTimer, Sub_ClickMouse, 100 ; Check every 1ms
100 = 100ms
Try it with less.
Also Click is effected by sendmode.
Put at top of script
SendMode, Input
A bit simplified:
#Persistent SetTimer, Sub_ClickMouse, 50 ; Check every 50ms Sub_ClickMouse: if (SubStr(A_Now,9) != "193416") return Sleep, 978 Click Return
How do you notice Timer being 100ms off?
If your using that link you would have to account for your internet latency.
If your using that link you would have to account for your internet latency.
Is there another way of testing it?
I get 5ms with A_Tickcount.
#Persistent SetBatchLines -1 SendMode, Input SetTimer, Sub_ClickMouse, 20 ; Check every 20ms Sub_ClickMouse: t:=A_TickCount ; Check if it's 17:00:00, or 5PM if (A_Hour = 19) ; Hour in 24h time and (A_Min = 34) and (A_Sec = 16) { Sleep, 978 Click ToolTip % A_TickCount-t-978 } return
You could also use QueryPerformanceCounter for more accuracy if needed.
Note : Fixed Typo.
Edited by Xtra, 16 May 2015 - 12:53 AM.
Should be SetTimer, Sub_ClickMouse1, 20 ; Check every 20ms
Sorry for the typo i was testing the speed of 3-4 different ways to do your script.
Remove the 1 in Sub_ClickMouse1 label or add a 1 to the settimer.