how to set a timer with a loop?

Get help with using AutoHotkey and its commands and hotkeys
dig4z
Posts: 3
Joined: 14 Jun 2018, 19:45

how to set a timer with a loop?

14 Jun 2018, 19:56

Hello guys,

Sorry to bother but I suck at scripting and would love some guidance on how to set a timer between inputs, with a loop in the ending.
It should go like this.


"word1"
5 seconds interval
"word2"
2:30 mins interval
"word3"
2:30 mins interval
"word4"
2:30 mins interval
loop to the beginning

Also how would I stop it?
Would really appreciate some help!
dig4z
Posts: 3
Joined: 14 Jun 2018, 19:45

Re: how to set a timer with a loop?

15 Jun 2018, 12:31

bumping, really need some help
swagfag
Posts: 1225
Joined: 11 Jan 2017, 17:59

Re: how to set a timer with a loop?

15 Jun 2018, 12:48

what is interval? a delay counted from the last executed command onwards, or something that needs to occur independently of other commands

Code: Select all

Loop
{
	if toggle
	{
		; word1
		Sleep 5 * 1000
		; word2
		Sleep 150 * 1000
		; word3
		Sleep 150 * 1000
		; word4
		Sleep 150 * 1000		
	}
}

q::toggle := !toggle
Esc:ExitApp
dig4z
Posts: 3
Joined: 14 Jun 2018, 19:45

Re: how to set a timer with a loop?

16 Jun 2018, 13:23

swagfag wrote:what is interval? a delay counted from the last executed command onwards, or something that needs to occur independently of other commands

Code: Select all

Loop
{
	if toggle
	{
		; word1
		Sleep 5 * 1000
		; word2
		Sleep 150 * 1000
		; word3
		Sleep 150 * 1000
		; word4
		Sleep 150 * 1000		
	}
}

q::toggle := !toggle
Esc:ExitApp
Interval as in, time between inputs, I'm gonna try this see if it works. Thanks a lot!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], colt, Google [Bot], JoeWinograd, KarlP, Rohwedder, sisa, TheDewd and 86 guests