Hello guys,
can someone help me with this,
i need E R to loop for like an hour every 1-2 seconds.
e::
Click 1701, 623
return
r::
Click 1042,643
Return
Thanks!
hotkeys on time loop
Re: hotkeys on time loop
Code: Select all
e::
t := A_TickCount + ((1000 * 60) * 60) ; Work out time one hour from now
while (t < A_TickCount){
Click 1701, 623
Sleep 1000
}
return
Re: hotkeys on time loop
evilC wrote:Code: Select all
e:: t := A_TickCount + ((1000 * 60) * 60) ; Work out time one hour from now while (t < A_TickCount){ Click 1701, 623 Sleep 1000 } return
Would you mind explainnig the row with t:=...?
A_tickcount is ms from when the computer was last rebooted. You then add 1000*60 * 60. Why not just write 3600000?
And how are you getting 1 hour out of when the comptuer was last rebooted? :S
Re: hotkeys on time loop
To make it clear what I am doingWhy not just write 3600000?
A_TickCount increments by 1 every ms.
So I add 1 hour's worth of ticks to the current value - when A_TickCount reaches that value, 1 hour has passed.
oops, just realized.
Code is wrong.
Should be while (A_TickCount < t)
Who is online
Users browsing this forum: marypoppins_1, OrangeCat, RussF and 129 guests