From 9f3b17dba0149a10a5fdfaf91938051120ad5d23 Mon Sep 17 00:00:00 2001 From: mar Date: Mon, 17 Jun 2024 17:32:33 -0400 Subject: [PATCH] update scripts for new library format --- lib/HoldRepeat.ahk | 9 +++++++-- scripts/AutorunAutoclick.ahk | 8 ++++---- scripts/Deep Rock Galactic.ahk | 4 ++-- scripts/Minecraft Bedrock Edition.ahk | 16 ++++++++-------- scripts/Stardew Valley.ahk | 4 ++-- scripts/Subnautica.ahk | 21 ++++++++++++--------- scripts/Valheim.ahk | 12 +++++++----- 7 files changed, 42 insertions(+), 32 deletions(-) diff --git a/lib/HoldRepeat.ahk b/lib/HoldRepeat.ahk index b25e583..29eccd1 100644 --- a/lib/HoldRepeat.ahk +++ b/lib/HoldRepeat.ahk @@ -74,7 +74,7 @@ Hold := _HoldRepeat_Handler.Bind(true) Repeat := _HoldRepeat_Handler.Bind(false) ; Sets key to hold if single tap, or repeat if double tap -HoldOrRepeat(TargetKey, CancelKeys?, HoldKey?) { +HoldOrRepeat(TargetKey, CancelKeys:=[]) { global HoldRepeat_BlindMode Send HoldRepeat_BlindMode "{" TargetKey " down}" @@ -83,5 +83,10 @@ HoldOrRepeat(TargetKey, CancelKeys?, HoldKey?) { } else { isHold := true } - _HoldRepeat_Handler(isHold, TargetKey, CancelKeys, HoldKey) + + if (CancelKeys.Length == 0) { + CancelKeys := [TargetKey] + } + + _HoldRepeat_Handler(isHold, TargetKey, CancelKeys) } \ No newline at end of file diff --git a/scripts/AutorunAutoclick.ahk b/scripts/AutorunAutoclick.ahk index 2cf84ab..331b600 100644 --- a/scripts/AutorunAutoclick.ahk +++ b/scripts/AutorunAutoclick.ahk @@ -19,7 +19,7 @@ *!Space UP::HoldOrRepeat("Space") ; Autorun -*!w UP::Hold("w",["s"]) -*!s UP::Hold("s",["w"]) -*!a UP::Hold("a",["d","w","s"]) -*!d UP::Hold("d",["a","w","s"]) \ No newline at end of file +*!w UP::Hold("w",["w","s"]) +*!s UP::Hold("s",["w","s"]) +*!a UP::Hold("a",["a","d","w","s"]) +*!d UP::Hold("d",["d","a","w","s"]) \ No newline at end of file diff --git a/scripts/Deep Rock Galactic.ahk b/scripts/Deep Rock Galactic.ahk index bd98b9e..6741fc7 100644 --- a/scripts/Deep Rock Galactic.ahk +++ b/scripts/Deep Rock Galactic.ahk @@ -54,7 +54,7 @@ RemoveTooltip() { ; Do full auto when caps lock is on for enabled weapons #HotIf (GetKeyState("CapsLock","T") and FullAutoEnabled[EquipState]) -*LButton::Repeat("LButton",,"LButton") +*LButton::Repeat("LButton") ; ; Distruptive macros @@ -79,7 +79,7 @@ RemoveTooltip() { #HotIf ; Alt + E holds E -*!e UP::Hold("e",["w","a","s","d","Space","LButton","RButton"]) +*!e UP::Hold("e",["e","w","a","s","d","Space","LButton","RButton"]) ; Press shift to sprint, only toggles on *LShift::{ diff --git a/scripts/Minecraft Bedrock Edition.ahk b/scripts/Minecraft Bedrock Edition.ahk index 491ae3a..9268ab7 100644 --- a/scripts/Minecraft Bedrock Edition.ahk +++ b/scripts/Minecraft Bedrock Edition.ahk @@ -40,20 +40,20 @@ return ; Hold/Autoclick mouse buttons ; Holds if single click, autoclicks if double click -vkFF & LButton UP::HoldOrRepeat("LButton",["RButton","MButton"]) -vkFF & RButton UP::HoldOrRepeat("RButton",["LButton","MButton"]) +vkFF & LButton UP::HoldOrRepeat("LButton",["LButton","RButton","MButton"]) +vkFF & RButton UP::HoldOrRepeat("RButton",["RButton","LButton","MButton"]) ; Autorun -vkFF & w UP::Hold("w",["s"]) -vkFF & s UP::Hold("s",["w"]) -vkFF & a UP::Hold("a",["d","w","s"]) -vkFF & d UP::Hold("d",["a","w","s"]) +vkFF & w UP::Hold("w",["w","s"]) +vkFF & s UP::Hold("s",["w","s"]) +vkFF & a UP::Hold("a",["a","d","w","s"]) +vkFF & d UP::Hold("d",["d","a","w","s"]) ; Hold crouch -vkFF & Shift UP::Hold("Shift",["Ctrl"]) +vkFF & Shift UP::Hold("Shift",["Shift","Ctrl"]) ; Autojump/auto-ascend -vkFF & Space UP::Hold("Space",["Shift"]) +vkFF & Space UP::Hold("Space",["Space","Shift"]) ; Mouse button 4: auto-takeoff ; Macro assumes you have your fireworks in the first hotbar slot diff --git a/scripts/Stardew Valley.ahk b/scripts/Stardew Valley.ahk index 783c6cc..2f76b6f 100644 --- a/scripts/Stardew Valley.ahk +++ b/scripts/Stardew Valley.ahk @@ -26,5 +26,5 @@ WrapperWindow:="Stardew Valley 1.6.8 - running SMAPI" } ; Alt to hold or repeat mouse buttons -*!LButton UP::HoldOrRepeat("LButton",["RButton","MButton"]) -*!RButton UP::HoldOrRepeat("RButton",["LButton","MButton"]) \ No newline at end of file +*!LButton UP::HoldOrRepeat("LButton",["LButton","RButton","MButton"]) +*!RButton UP::HoldOrRepeat("RButton",["RButton","LButton","MButton"]) \ No newline at end of file diff --git a/scripts/Subnautica.ahk b/scripts/Subnautica.ahk index ebdf69c..5fa64df 100644 --- a/scripts/Subnautica.ahk +++ b/scripts/Subnautica.ahk @@ -14,18 +14,21 @@ WrapperWindow:="Subnautica" ; Hotkeys ; +SendMode "Event" +HoldRepeat_TimerPeriod:=20 + ; Alt + direction: automove -*!w UP::Hold("w",["s"]) -*!s UP::Hold("s",["w"]) -*!a UP::Hold("a",["d","w","s"]) -*!d UP::Hold("d",["a","w","s"]) -*!Space UP::Hold("Space",["LShift"]) -*!LShift Up::Hold("LShift",["Space"]) +*!w UP::Hold("w",["w","s"]) +*!s UP::Hold("s",["w","s"]) +*!a UP::Hold("a",["a","d","w","s"]) +*!d UP::Hold("d",["d","a","w","s"]) +*!Space UP::Hold("Space",["Space","LShift"]) +*!LShift Up::Hold("LShift",["LShift","Space"]) ; Alt + mouse key: hold key -*!LButton UP::Hold("LButton",["RButton","MButton"]) -*!RButton UP::Hold("RButton",["LButton","MButton"]) +*!LButton UP::Hold("LButton",["LButton","RButton","MButton"]) +*!RButton UP::Hold("RButton",["RButton","LButton","MButton"]) ; Turbo click to break rocks when caps lock on #HotIf GetKeyState("CapsLock","T") -*LButton::Turbo("LButton") \ No newline at end of file +*LButton::Repeat("LButton",,"LButton") \ No newline at end of file diff --git a/scripts/Valheim.ahk b/scripts/Valheim.ahk index e3b7e67..d21457e 100644 --- a/scripts/Valheim.ahk +++ b/scripts/Valheim.ahk @@ -15,13 +15,15 @@ WrapperWindow:="Valheim" ; Hotkeys ; +HoldRepeat_BlindMode:="" + ; Hold E -*#e UP::Hold("e",["LButton", "RButton","q","r"],,false) +*#e UP::Hold("e",["e","LButton", "RButton","q","r"]) ; Autorun -*#w UP::Hold("w",["s"],,false) -*#Shift UP::Hold("Shift",["Ctrl"],["w"],false) +*#w UP::Hold("w",["w","s"]) +*#Shift UP::Hold("Shift",["Shift","Ctrl"],["w"]) ; Autoclick -*#LButton UP::HoldOrRepeat("LButton",["RButton","MButton"],false) -*#RButton UP::HoldOrRepeat("RButton",["LButton","MButton"],false) \ No newline at end of file +*#LButton UP::HoldOrRepeat("LButton",["LButton","RButton","MButton"]) +*#RButton UP::HoldOrRepeat("RButton",["RButton","LButton","MButton"]) \ No newline at end of file