【发布时间】:2019-05-06 23:17:32
【问题描述】:
我正在尝试制作一个 AutoHotKey 脚本,该脚本将启动游戏 Digital Combat Simulator 的所有第三方程序以及游戏本身,但我在第一次启动程序时不断收到错误消息。
将程序作为辅助脚本启动更好,还是我可以运行我需要的程序并同时从同一个脚本设置我的热键?
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
【问题讨论】:
-
这个错误到底说了什么?您可以从主脚本或辅助脚本启动所有程序;两种方式都没有明确的普遍优势,但两者都是可能的。
-
"无法执行脚本 joystick_gremlin"
-
我也收到了同样的信息。当我手动运行它时,它显示“vJoy 不存在或设置不正确”。当您手动运行它时,它对您说了什么?
-
好的,安装了vJoy,现在手动正常打开了。该程序似乎(至少部分)是用 Python 编写的。搜索“无法执行脚本”会出现很多与 Python 相关的帖子。这让我怀疑问题可能与程序有关,而不是 AHK。
标签: autohotkey