Complicated double function hotkey script help

Ask gaming related questions (AHK v1.1 and older)
probo_
Posts: 2
Joined: 19 Feb 2017, 22:37

Complicated double function hotkey script help

22 Oct 2017, 10:51

~y::
send, {F3}
sleep, 100
send, {F9}
sleep, 20
send, {F10}
sleep, 300
send, {F3}

This is how it looks right now and it works well, but I would like to add additional functionality to it. This might be over the top and actually not possible, but I would like it to do the following:

IF I just click the Y button normally then that is what happens. But if I should press and HOLD the Y button then I want the following to happen:

send, {F3}
sleep, 100
send, {F9}

(These are a given at this point, they will always be in the start no matter what.)

The difference is that the following part should start looping after the initial 3 lines:

sleep, 20
send, {F10}

I want This part repeated until I release button Y, at which point it should stop sending F10 (and that sleep, 20 command). Also at the release of the Y button it should also press {F3} one last time after an additional sleep, 50 command.

To reiterate, I need it to also have the full script thing as posted at the start if I only click the Y button quickly and not holding it in.

So is it possible to have 2 different functions on a hotkey depending on whether you click it or hold it in? And if so, could you help in how I should approach making this script?
crackint
Posts: 25
Joined: 07 Sep 2017, 18:32

Re: Complicated double function hotkey script help

22 Oct 2017, 23:00

Something like this?

Code: Select all

	Y::
	Sleep, 100
	send, {F3}
    sleep, 100
	send, {F9}
	    loop
		 {
		 sleep, 20
		  send, {F10}
		      GetKeyState, state, Y, P
				if state = U
				   break
		  }
    sleep, 300
	send, {F3}
	Sleep, 300
return
probo_
Posts: 2
Joined: 19 Feb 2017, 22:37

Re: Complicated double function hotkey script help

27 Oct 2017, 00:40

That's so damn good!! It works exactly as I intended, I am so grateful. Thanks :-)

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: Stpham and 64 guests