send loop until i release

Get help with using AutoHotkey and its commands and hotkeys
Aso
Posts: 17
Joined: 10 Nov 2016, 14:00

send loop until i release

24 Apr 2017, 11:54

hi buddys,

i need to make a macro

when i press F1 and hold it down

it does

send 1
sleep 1000
send 2
sleep 1000
send 3
sleep 1000



it should be in a loop

but when i relase after 2seconds for example it should not send the 3
when i relase after 1 second it should not send the 2

you know what i mean, releasing F1 should interrupt the macro and when i push F1 again it should start from the beginning again as long as i hold it.
Rohwedder
Posts: 2116
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: send loop until i release

24 Apr 2017, 14:28

Hallo,
within the loop before each send:

Code: Select all

If !GetKeyState("F1" , "P")
		Break
Aso
Posts: 17
Joined: 10 Nov 2016, 14:00

Re: send loop until i release

24 Apr 2017, 15:10

can someone make a example code? i dont understand the break
Rohwedder
Posts: 2116
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: send loop until i release

24 Apr 2017, 23:36

Hallo,
example code with the first Send

Code: Select all

F1::
	Loop
	{
		If !GetKeyState("F1" , "P")
			Break
		send 1
		sleep 1000
	}
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: Paddy9888 and 153 guests