gghf icon

Sea of Thieves - Reduce Hold on Items Fix (Advanced)

gghf | PRO | 10/23/21 02:46:08 AM UTC (Edited) | 0 ⭐ | 11925 👁️ | Never ⏰ | []
Autohotkey |

5.21 KB

|

None

|

0 👍

/

0 👎

/* 
CHANGELOG:
2021-10-23
  - removed keys that are used inside barrel menus, to avoid unwanted 2nd clicks in them:
    "q::", "r::", "f::"
2021-10-22
  - commented out "q::" 
2021-10-21
  - added function "UndoActiveToggle()"
  - inserted function "UndoActiveToggle()" to relevant keys
  - minor refactor to toggle off keys
  - changed "k" to "NumpadDiv" (/) to avoid toggle while text-chatting
2021-10-18
  - added "Enter::" toggle off when pressing chat
  - added "r::", "LAlt::" toggle off when interacting
2021-10-16
  - added "LWin::" toggle off when tabbing out
2021-10-10
  - removed #UseHook
  - added extra sprint hotkey "LCtrl::LShift" so that I can sprint with my thumb too
  - "k" has been changed to "toggle := 1", "g" remains as is
 
***************************************************************************************
 
This script exists to help people with repetitive strain injuries to their hands.
It's a better Reduce Hold on Items, essentially.
 
Each ingame shortcut has its own keybind below, clearly commented. 
Change these as fits you. See AHK documentation List of Keys for button names:
https://www.autohotkey.com/docs/KeyList.htm
 
Some of these keybinds will toggle Click-to-Hold on, others will not. 
You can customize by changing the "0" and "1" of each "toggle :="
 
Sometimes you may wish to cancel the hold for a shortcut that turns it on.
Both "g" and "NumpadDiv" serve this purpose, with "g" also stowing the item ingame.
These will both deactivate the toggle and also undo an ongoing hold.
Remember that you can customize these to be whatever key you want instead.
 
While holding with one button, you can click the other button without losing that hold.
 
 
******************************************************
MAKE SURE YOU TURN OFF "Reduce Hold on Items" IN GAME!
******************************************************
 
***********
TO INSTALL, 
***********
download and install AutoHotkey from https://www.autohotkey.com/
Then rightclick desktop, create new AHK script, and paste everything into it.
You can then double click the script, every time you play SoT, or add a shortcut
to the script into your Startup folder to have it start with Windows.
 
*****
NOTES
*****
I use ESDF to move instead of WASD, as this gives me additional keys for shortcuts.
 
One problem with using this script is that you can't adjust ingame what keys you want to
navigate barrels with, and these navigation keys should not be keys used in the script,
as they may cause unwanted clicks inside those barrels. 
 
For example, "r" opens barrels, but also shifts single items between the inventories. 
If i bind "r" in the script, then clicking "r" within a barrel will send a second click, 
moving two items instead of one. Not really a major issue, but can be annoying.
*/
 
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
 
/*
**********************************************************************************
*/
 
~LWin:: ;tab out - toggle off in called function
  UndoActiveToggle()
return
 
#If WinActive("ahk_exe SoTGame.exe") ;all keys below only work while SoT is focused
 
~Ctrl::LShift ;second sprint keybind for thumb on custom keyboards, can still sprint with LShift
 
~NumpadDiv:: ;unconditional toggle on, active holds not interrupted
  toggle := 1
return
 
~LAlt:: ;interact - toggle off in called function
  UndoActiveToggle()
return
 
~Enter:: ;chat - toggle off in called function
  UndoActiveToggle()
return
 
~g:: ;stow item - toggle off in called function
  UndoActiveToggle()
return
 
~1:: ;fishing rod
  toggle := 0
  MBStateCheck()
return
 
~2:: ;shovel
  toggle := 0
  MBStateCheck()
return
 
~3:: ;instrument
  toggle := 1
  MBStateCheck()
return
 
~4:: ;compass
  toggle := 1
  MBStateCheck()
return
 
~5:: ;clock
  toggle := 1
  MBStateCheck()
return
 
~w:: ;food
  toggle := 0
  MBStateCheck()
return
 
~t:: ;lantern
  toggle := 1
  MBStateCheck()
return
 
~a:: ;bucket
  toggle := 0
  MBStateCheck()
return
 
~z:: ;spy glass
  toggle := 1
  MBStateCheck()
return
 
~x:: ;plank
  toggle := 0
  MBStateCheck()
return
 
~v:: ;megaphone
  toggle := 1
  MBStateCheck()
return
 
~b:: ;tankard
  toggle := 1
  MBStateCheck()
return
 
~WheelUp:: ;throwables
  toggle := 0
  MBStateCheck()
return
 
~WheelDown:: ;cannonballs
  toggle := 1
  MBStateCheck()
return
 
~XButton1:: ;Weapon 1
  toggle := 0
  MBStateCheck()
return
 
~XButton2:: ;Weapon 2
  toggle := 0
  MBStateCheck()
return
 
/*
************************************
DO NOT MAKE CHANGES BELOW THIS LINE, unless you perfectly understand this macro.
************************************
*/
 
;handle toggled behavior for left and right click
#if toggle && WinActive("ahk_exe SoTGame.exe")
  LButton::
    Send, {LButton Down}
    toggle := 0
  return
  RButton::
    Send, {RButton Down}
    toggle := 0
  return
#if
 
;if left/right mouse button NOT held physically, macro stop holding now.
MBStateCheck() {
  if !GetKeyState("LButton", "P")
    Send, {LButton Up}
  if !GetKeyState("RButton", "P")
    Send, {RButton Up}
return
}
 
;undo active toggle
UndoActiveToggle() {
  if toggle
    toggle := 0
    Send, {LButton Up}
    Send, {RButton Up}
return
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎