I'm trying to make an AutoHotKey script that will launch all the third party programs for the game Digital Combat Simulator, as well as the game itself, but I keep getting an error on my first program launch.
Is it better to launch the programs as a secondary script, or can I run the programs I need and also set up my hotkeys all from the same script?
SendMode Input
SetWorkingDir %A_ScriptDir%
#UseHook On
Run, C:\Program Files (x86)\H2ik\Joystick Gremlin\joystick_gremlin.exe, ,min
q0 = 0
#IfWinActive Digital Combat Simulator
;===========================================================
;For toggle switches
;X is the key the toggle presses while in the ON position
;===========================================================
x::
if (q0 == 1)
return
if (q0 == 0) {
SendEvent {q 2}
q0 = 1
return
}
x Up::
SendEvent {Lshift down}{q 2}{Lshift up}
q0 = 0
return
;===========================================================
;End X toggle switch block
;===========================================================
#IfWinActive
;===========================================================
;Control + Escape exits script
;===========================================================
^Escape::
ExitApp
Return