From 8d7314de678605edf951720a8698706d0ac3b733 Mon Sep 17 00:00:00 2001 From: Mar Alegre Date: Sat, 16 Apr 2022 20:47:28 -0400 Subject: [PATCH] improvements to DRG script --- lib/HoldRepeat.ahk | 6 +++--- lib/Turbo.ahk | 5 +++-- src/Deep Rock Galactic.ahk | 39 +++++++++++++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lib/HoldRepeat.ahk b/lib/HoldRepeat.ahk index 536d30b..8e25af6 100644 --- a/lib/HoldRepeat.ahk +++ b/lib/HoldRepeat.ahk @@ -36,13 +36,13 @@ Repeat(Primary, Secondary) { } } if (RepeatVar == 1) { - SendEvent, {%Primary% down} + Send, {%Primary% down} RepeatVar := 0 } else { - SendEvent, {%Primary% up} + Send, {%Primary% up} RepeatVar := 1 } - Sleep 50 + Sleep 100 } } diff --git a/lib/Turbo.ahk b/lib/Turbo.ahk index 92534cb..91d1308 100644 --- a/lib/Turbo.ahk +++ b/lib/Turbo.ahk @@ -3,7 +3,8 @@ Turbo(Target,Hold) { While GetKeyState(Hold,"P") { SendInput, {%Target% down} - Sleep 50 + Sleep 25 + SendInput, {%Target% up} + Sleep 25 } - SendInput, {%Target% up} } \ No newline at end of file diff --git a/src/Deep Rock Galactic.ahk b/src/Deep Rock Galactic.ahk index f769f1a..2a0329c 100644 --- a/src/Deep Rock Galactic.ahk +++ b/src/Deep Rock Galactic.ahk @@ -13,16 +13,45 @@ WrapperPath:="steam://rungameid/548430" WrapperWindow:="Deep Rock Galactic " #Include ../lib/Wrapper.ahk +; Initialize variables +FullAutoEnabled := [0,0,0,0] +EquipState := 1 + +ToggleFullAuto(Index) { + global FullAutoEnabled + FullAutoEnabled[Index] := !FullAutoEnabled[Index] + EnabledDisabled := % (FullAutoEnabled[Index] ? "enabled" : "disabled") + ToolTip, Full Auto %EnabledDisabled% for %Index%, % A_ScreenWidth // 2, % A_ScreenHeight // 2 + SetTimer, RemoveTooltip, -1000 +} + +RemoveTooltip: + ToolTip + return + ; ; Hotkeys ; -; When Caps lock is on, every gun is full auto -#If GetKeyState("CapsLock","T") +; Keep track of what is equipped +~*1:: EquipState := 1 +~*2:: EquipState := 2 +~*3:: EquipState := 3 +~*4:: EquipState := 4 + +; FN toggles full auto for weapon N +~*F1:: ToggleFullAuto(1) +~*F2:: ToggleFullAuto(2) +~*F3:: ToggleFullAuto(3) +~*F4:: ToggleFullAuto(4) + +; Do full auto when caps lock is on for enabled weapons +#If (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState]) ~*LButton:: While GetKeyState("LButton","P") { - SendInput, {LButton down} - Sleep 50 + Send, {LButton down} + Sleep 25 + Send, {LButton up} + Sleep 25 } -SendInput, {LButton up} Return \ No newline at end of file