Hello, ned these two codes in 1 ahk file, thank you Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
FlickZ
Posts: 28
Joined: 06 Oct 2020, 17:02

Hello, ned these two codes in 1 ahk file, thank you

24 Sep 2021, 07:17

So basically I have 2 Ahk files, and I dont know how to get it done with only 1 ahk file
thank you very much

Code 1:

Code: Select all

$f4::
       Loop
	{
		Send, {w down}
		Sleep 500
		Send, {d down}
		Sleep 250
		Send, {d up}
	}

return

y::ExitApp
Code 2:

Code: Select all

$f5::

destroy:=!destroy

 While (destroy=1)
    {
	Send, {k down}
	Sleep 1789263891
	send, {k up}
    }
destroy=0

return

y::ExitApp
Again, if you know how to do it, thank you very much :) Have a nice day!
User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Hello, ned these two codes in 1 ahk file, thank you  Topic is solved

24 Sep 2021, 07:40

Code: Select all

OnExit("done")

F4::
Send {w down}
Sleep, 500
SetKeyDelay,, 250
Loop
 Send d

F5::
If !on := !on {
 SetTimer, Go, Off
 Send {k up}
 SoundBeep, 1000
 Return
} Else SetTimer, Go, 1789263891
SoundBeep, 1500
Go:
Send {k up}{k down}
Return

y::ExitApp

done(ExitReason, ExitCode) {
 Send {w up}{k up}
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bobak and 291 guests