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
;
_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
}
}

25
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()
Loading…
Cancel
Save