Browse Source

improvements to DRG script

ahk-v1
Mar Alegre 3 years ago
parent
commit
cbdb75df06
  1. 29
      lib/HoldRepeat.ahk
  2. 25
      src/Deep Rock Galactic.ahk

29
lib/HoldRepeat.ahk

@ -2,6 +2,8 @@
; Functions for holding and repeating keys ; Functions for holding and repeating keys
; ;
_TurboOn := []
Hold(Primary, Secondary) { Hold(Primary, Secondary) {
Send {%Primary% down} Send {%Primary% down}
if ( Secondary.Length() != 0 ) { if ( Secondary.Length() != 0 ) {
@ -17,7 +19,7 @@ HoldLoop(Primary, Secondary) {
} }
for index,key in Secondary { for index,key in Secondary {
if GetKeyState(key,"P") { if GetKeyState(key,"P") {
Send {%Primary% up} Send,{Blind} {%Primary% up}
SetTimer, , Delete SetTimer, , Delete
return return
} }
@ -25,7 +27,7 @@ HoldLoop(Primary, Secondary) {
} }
Repeat(Primary, Secondary) { Repeat(Primary, Secondary) {
Send {%Primary% up} Send,{Blind} {%Primary% up}
Sleep 100 Sleep 100
RepeatVar := 0 RepeatVar := 0
Loop { Loop {
@ -38,10 +40,10 @@ Repeat(Primary, Secondary) {
} }
} }
if (RepeatVar == 1) { if (RepeatVar == 1) {
Send, {%Primary% down} Send,{Blind} {%Primary% down}
RepeatVar := 0 RepeatVar := 0
} else { } else {
Send, {%Primary% up} Send,{Blind} {%Primary% up}
RepeatVar := 1 RepeatVar := 1
} }
Sleep 100 Sleep 100
@ -50,7 +52,7 @@ Repeat(Primary, Secondary) {
; Sets key to hold if single tap, or repeat if double tap ; Sets key to hold if single tap, or repeat if double tap
HoldOrRepeat(Primary, Secondary) { HoldOrRepeat(Primary, Secondary) {
Send {%Primary% down} Send,{Blind} {%Primary% down}
KeyWait, %Primary%, D, T0.2 KeyWait, %Primary%, D, T0.2
if (ErrorLevel = 0) { if (ErrorLevel = 0) {
Repeat(Primary,Secondary) Repeat(Primary,Secondary)
@ -61,10 +63,17 @@ HoldOrRepeat(Primary, Secondary) {
; Press Target button extremely rapidly while Hold button is held down ; Press Target button extremely rapidly while Hold button is held down
Turbo(Target,Hold) { Turbo(Target,Hold) {
While GetKeyState(Hold,"P") { global _TurboOn
SendInput, {%Target% down} If (_TurboOn["%Target%_%Hold%"]) {
Sleep 25 return
SendInput, {%Target% up} } else {
Sleep 25 _TurboOn["%Target%_%Hold%"]:=1
While GetKeyState(Hold,"P") {
Send,{Blind} {%Target% down}
Sleep 25
Send,{Blind} {%Target% up}
Sleep 25
}
_TurboOn["%Target%_%Hold%"]:=0
} }
} }

25
src/Deep Rock Galactic.ahk

@ -17,6 +17,7 @@ WrapperWindow:="Deep Rock Galactic "
; Initialize variables ; Initialize variables
FullAutoEnabled := [0,0,0,0] FullAutoEnabled := [0,0,0,0]
EquipState := 1 EquipState := 1
;Depositing := 0
ToggleFullAuto(Index) { ToggleFullAuto(Index) {
global FullAutoEnabled global FullAutoEnabled
@ -30,6 +31,26 @@ RemoveTooltip:
ToolTip ToolTip
return 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 ; Hotkeys
; ;
@ -51,5 +72,7 @@ RemoveTooltip:
; Do full auto when caps lock is on for enabled weapons ; Do full auto when caps lock is on for enabled weapons
#If (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState]) #If (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState])
~*LButton::Turbo("LButton","LButton") *LButton::Turbo("LButton","LButton")
; Shift + E does fast deposit
;~*+E:: FastDeposit()
Loading…
Cancel
Save