Browse Source

committing a bunch of stuff

ahk-v1
Mar Alegre 3 years ago
parent
commit
d2c9d7d797
  1. 12
      lib/HoldRepeat.ahk
  2. 10
      lib/Turbo.ahk
  3. 2
      lib/Wrapper.ahk
  4. 14
      src/Deep Rock Galactic.ahk
  5. 30
      src/Valheim.ahk

12
lib/HoldRepeat.ahk

@ -13,11 +13,13 @@ Hold(Primary, Secondary) {
HoldLoop(Primary, Secondary) {
if GetKeyState(Primary,"P") {
SetTimer, , Delete
return
}
for index,key in Secondary {
if GetKeyState(key,"P") {
Send {%Primary% up}
SetTimer, , Delete
return
}
}
}
@ -55,4 +57,14 @@ HoldOrRepeat(Primary, Secondary) {
} else {
Hold(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
}
}

10
lib/Turbo.ahk

@ -1,10 +0,0 @@
; 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
}
}

2
lib/Wrapper.ahk

@ -10,7 +10,7 @@ CheckWinExist(Window) {
Run %WrapperPath%
SetTitleMatchMode 3
WinWait %WrapperWindow%,,30
WinWait %WrapperWindow%,,600
; Check if window exists once per second
WrapperFunc := Func("CheckWinExist").bind(WrapperWindow)

14
src/Deep Rock Galactic.ahk

@ -7,6 +7,7 @@
; Include relevant libraries
#Include ../lib/Prelude.ahk
#Include ../lib/HoldRepeat.ahk
; Make this a wrapper script
WrapperPath:="steam://rungameid/548430"
@ -45,13 +46,10 @@ RemoveTooltip:
~*F3:: ToggleFullAuto(3)
~*F4:: ToggleFullAuto(4)
; Alt + E holds E
*!e UP::Hold("e",["e","w","a","s","d","Space","LButton","RButton"])
; Do full auto when caps lock is on for enabled weapons
#If (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState])
~*LButton::
While GetKeyState("LButton","P") {
Send, {LButton down}
Sleep 25
Send, {LButton up}
Sleep 25
}
Return
~*LButton::Turbo("LButton","LButton")

30
src/Valheim.ahk

@ -0,0 +1,30 @@
; Script can be directly run by or compiled into an .exe by the open-source software AutoHotkey
; https://www.autohotkey.com
;
; Front Matter
;
; Include relevant libraries
#Include ../lib/Prelude.ahk
#Include ../lib/HoldRepeat.ahk
; Make this a wrapper script
WrapperPath := Format("C:\Program Files (x86)\Steam\steam.exe -applaunch 892970 --doorstop-enable true --doorstop-target {1}\r2modmanPlus-local\Valheim\profiles\Medusa\BepInEx\core\BepInEx.Preloader.dll",A_AppData)
WrapperWindow:="Valheim"
#Include ../lib/Wrapper.ahk
;
; Hotkeys
;
; Hold E
*#e UP::Hold("e",["LButton", "RButton","q","r"])
; Autorun
*#w UP::Hold("w",["s"])
*#Shift UP::Hold("Shift",["Ctrl"])
; Autoclick
*#LButton UP::HoldOrRepeat("LButton",["RButton","MButton"])
*#RButton UP::HoldOrRepeat("RButton",["LButton","MButton"])
Loading…
Cancel
Save