From cbdb75df067c2ee5d32beceec5b7fef8ed0a21b7 Mon Sep 17 00:00:00 2001 From: Mar Alegre Date: Tue, 29 Nov 2022 16:53:00 -0500 Subject: [PATCH] improvements to DRG script --- lib/HoldRepeat.ahk | 29 +++++++++++++++++++---------- src/Deep Rock Galactic.ahk | 25 ++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/lib/HoldRepeat.ahk b/lib/HoldRepeat.ahk index ff7e776..4a768f9 100644 --- a/lib/HoldRepeat.ahk +++ b/lib/HoldRepeat.ahk @@ -2,6 +2,8 @@ ; Functions for holding and repeating keys ; +_TurboOn := [] + Hold(Primary, Secondary) { Send {%Primary% down} if ( Secondary.Length() != 0 ) { @@ -17,7 +19,7 @@ HoldLoop(Primary, Secondary) { } for index,key in Secondary { if GetKeyState(key,"P") { - Send {%Primary% up} + Send,{Blind} {%Primary% up} SetTimer, , Delete return } @@ -25,7 +27,7 @@ HoldLoop(Primary, Secondary) { } Repeat(Primary, Secondary) { - Send {%Primary% up} + Send,{Blind} {%Primary% up} Sleep 100 RepeatVar := 0 Loop { @@ -38,10 +40,10 @@ Repeat(Primary, Secondary) { } } if (RepeatVar == 1) { - Send, {%Primary% down} + Send,{Blind} {%Primary% down} RepeatVar := 0 } else { - Send, {%Primary% up} + Send,{Blind} {%Primary% up} RepeatVar := 1 } Sleep 100 @@ -50,7 +52,7 @@ Repeat(Primary, Secondary) { ; Sets key to hold if single tap, or repeat if double tap HoldOrRepeat(Primary, Secondary) { - Send {%Primary% down} + Send,{Blind} {%Primary% down} KeyWait, %Primary%, D, T0.2 if (ErrorLevel = 0) { Repeat(Primary,Secondary) @@ -61,10 +63,17 @@ HoldOrRepeat(Primary, Secondary) { ; Press Target button extremely rapidly while Hold button is held down Turbo(Target,Hold) { - While GetKeyState(Hold,"P") { - SendInput, {%Target% down} - Sleep 25 - SendInput, {%Target% up} - Sleep 25 + global _TurboOn + If (_TurboOn["%Target%_%Hold%"]) { + return + } else { + _TurboOn["%Target%_%Hold%"]:=1 + While GetKeyState(Hold,"P") { + Send,{Blind} {%Target% down} + Sleep 25 + Send,{Blind} {%Target% up} + Sleep 25 + } + _TurboOn["%Target%_%Hold%"]:=0 } } \ No newline at end of file diff --git a/src/Deep Rock Galactic.ahk b/src/Deep Rock Galactic.ahk index 2d3ce92..6fcc97b 100644 --- a/src/Deep Rock Galactic.ahk +++ b/src/Deep Rock Galactic.ahk @@ -17,6 +17,7 @@ WrapperWindow:="Deep Rock Galactic " ; Initialize variables FullAutoEnabled := [0,0,0,0] EquipState := 1 +;Depositing := 0 ToggleFullAuto(Index) { global FullAutoEnabled @@ -30,6 +31,26 @@ RemoveTooltip: ToolTip return +; FastDeposit() { +; global Depositing +; If (Depositing) { +; return +; } else { +; Depositing:=1 +; While GetKeyState("E","P") { +; Send,{Blind} {E down} +; Sleep 25 +; Send,{Blind} {E up} +; Sleep 25 +; Send,{Blind} {LCtrl down} +; Sleep 25 +; Send,{Blind} {LCtrl up} +; Sleep 25 +; } +; Depositing:=0 +; } +; } + ; ; Hotkeys ; @@ -51,5 +72,7 @@ RemoveTooltip: ; Do full auto when caps lock is on for enabled weapons #If (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState]) -~*LButton::Turbo("LButton","LButton") +*LButton::Turbo("LButton","LButton") +; Shift + E does fast deposit +;~*+E:: FastDeposit() \ No newline at end of file