Having trouble making the hotkey script

Ask gaming related questions
Rlentless
Posts: 11
Joined: 19 Apr 2018, 06:16

Having trouble making the hotkey script

01 Nov 2018, 05:11

I'm trying to create a simple hotkey for a game I'm playing, but it won't work at all.

Im trying to get the hotkey to hold space all the time, while pressing F4, z and 1 every second or half a second.

I would like it to run in the background when the window is not active so that I can do other things on the computer.

This is what I have:

ControlSend,,my.exe

#Persistent
SetTimer, PressTheKey, 500
Return


#o::Pause ;


IfWinActive, my.exe

PressTheKey:

if (WinActive("ahk_exe my.exe"))

{
Send, {space down}
Send, {F4 down}
Sleep 3
Send, {F4 up}
Send, {z down}
Sleep 4
Send, {z up}
Send, {1 down}
Sleep 1
Send, {1 up}

}
Return

Could someone help me out with this?

Thank you!

Return to “Gaming”

Who is online

Users browsing this forum: Evil-e, swagfag and 21 guests