hotkeys on time loop Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Rayr

hotkeys on time loop

20 Oct 2017, 07:18

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!
Johana
Posts: 189
Joined: 02 May 2017, 02:34

Re: hotkeys on time loop

20 Oct 2017, 11:29

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
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: hotkeys on time loop  Topic is solved

20 Oct 2017, 13:08

Why not just write 3600000?
To make it clear what I am doing

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)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot] and 123 guests