From 0fe940dd53e732fc49e224dd9e341a196b1aad02 Mon Sep 17 00:00:00 2001 From: Spr_Aachen <2835946988@qq.com> Date: Thu, 10 Mar 2022 16:52:56 +0800 Subject: [PATCH] BH3_Hotkey_Simplified.ahk --- BH3_Hotkey_Simplified.ahk | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BH3_Hotkey_Simplified.ahk b/BH3_Hotkey_Simplified.ahk index e896df1..6cf125a 100644 --- a/BH3_Hotkey_Simplified.ahk +++ b/BH3_Hotkey_Simplified.ahk @@ -55,7 +55,6 @@ SwitchIME(dwLayout) ; 该段用于管理输入法,请勿删改 SendMessage, 0x50, 0, HKL, %ctl%, A } - F1:: ; 暂停/ 启用程序——若想正常使用鼠标请按该键或按住ALT键 Suspend, Toggle WinSet, AlwaysOnTop, Off, A @@ -63,11 +62,12 @@ SetTimer, ViewControlTemp, Off SendInput, {Click, Up Middle} SwitchIME(0x04090409) ; 切换至"中文(中国) 简体中文-美式键盘" ;Send, #{Space} ; [未启用命令行] 微软拼音用户可用该命令 -If (A_IsSuspended=1) +If (A_IsSuspended) ToolTip, 暂停中, 0, 999 ; [可调校数值] Else If (A_IsSuspended=0) { - M_Toggle:=!M_Toggle + If (M_Toggle) + M_Toggle:=!M_Toggle ToolTip, 已启用, 0, 999 ; [可调校数值] Sleep 210 ; [可调校数值] ToolTip @@ -122,12 +122,12 @@ Return ;--------------------------------------------------------------------------------------------------------------------------------------------------------------- ViewControl: -if WinActive("ahk_exe BH3.exe") +If WinActive("ahk_exe BH3.exe") { - SendInput, {Click, Down Middle} CoordMode, Window WinGetPos, X, Y, Width, Height, ahk_exe BH3.exe ; 获取崩坏3游戏窗口参数(同样适用于非全屏) MouseMove, Width/2, Height/2, 0 ; [建议保持数值] 使鼠标回正,居中于窗口 + SendInput, {Click, Down Middle} } Return @@ -197,9 +197,9 @@ LButton:: ; 点按鼠标左键以发动普攻 Send, {j Down} If (M_Toggle) { - While GetKeyState("LButton", "P") + If GetKeyState("LButton", "P") { - SetTimer, ViewControl, Off + SetTimer, ViewControl, Off SetTimer, ViewControlTemp, 0 ; [[可调校数值]] 设定视角跟随命令的每执行间隔时间(ms) } }