Page 1 of 1

send loop until i release

Posted: 24 Apr 2017, 11:54
by Aso
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.

Re: send loop until i release

Posted: 24 Apr 2017, 14:28
by Rohwedder
Hallo,
within the loop before each send:

Code: Select all

If !GetKeyState("F1" , "P")
		Break

Re: send loop until i release

Posted: 24 Apr 2017, 15:10
by Aso
can someone make a example code? i dont understand the break

Re: send loop until i release

Posted: 24 Apr 2017, 23:36
by Rohwedder
Hallo,
example code with the first Send

Code: Select all

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