The Long Dark

The Long Dark

Not enough ratings
AutoWalk Script
By Kaboom
A simple script that will make Long Dark game world easier for you to explore if you're having issues with endlessly holding down the "W" key to walk. Uses an Open Source software and is editable for your personal preference. Toggle walk key.
   
Award
Favorite
Favorited
Unfavorite
Basic idea
A script that runs in the background giving you the additional key features:

To start AutoWalk:
  • press hotkey E
  • quickly double press W

To stop AutoWalk:
  • press your Mouse Left Key
  • press hotkey E
  • press W
  • press S

If you are OK with the above features and key bindings there is no need to modify the script and you may use it as it is!

These script functions are only active while you are inside the game.

Currently the script uses basic default key bindings for walking. W is forward and S is backward. If you change these in the game settings, you must modify the script accordingly.

The script "w" and "e" input keys are case sensitive. Holding Shift while pressing any of these, will not activate the script. Having CapsLock turned on does not affect the script though. You may still use Shift to sprint while AutoWalking.

Thank you!
To the original poster of a discussion thread that made me dig deeper into this.
Original author[autohotkey.com] of the AutoHotkey script that I modified and used for this Long Dark specific guide.
AutoHotkey for existing!
Download
Free and Open Source software, licensed under the GNU GPLv2:
https://autohotkey.com/

Use the installer or the standalone version.
Installer will be easier for beginners as the .ahk script files will become associated with the software automatically.
Create the script file
Copy the code below and paste it into a text file editor (Notepad) save it anywhere on your computer as a .ahk file. For example TheLongDark.ahk

The code is formatted with tab spacing, it will be easier to read once you paste it to your text editor.

/* START OF SCRIPT */ ;THIS LINE IS A COMMENT /* THESE LINES ARE COMMENTED */ #InstallKeybdHook #InstallMouseHook ;Script runs only if the "TheLongDark" window is active #IfWinActive, TheLongDark ;HOTKEY "e" IS THE TOGGLE AutoWalk KEY - COMMENT THE NEXT LINE TO DISABLE THE "e" HOTKEY OR SIMPLY CHANGE "e" TO A KEY OF YOUR CHOICE e::AutoWalk() return ;DOUBLE TAPPING "w" WITHIN 0.3 SECONDS WILL AutoWalk - COMMENT THIS SECTION OUT TO DISABLE DOUBLE TAPPING (WRAP IT IN /* COMMENT AS ABOVE */) ;*DOUBLE TAP SECTION START* ~w:: { KeyWait, w KeyWait, w, D T0.3 ;"0.3" value defines the time in seconds to wait for another "w" keypress If (!ErrorLevel) { AutoWalk() } } return ;*DOUBLE TAP SECTION END* global AnyKey ;Declaring variable AnyKey as global variable. Variables in functions are local to that function. AutoWalk() { AnyKey:=A_ThisHotkey ;Placing last pressed hotkey in variable AnyKey. AnyKey:=StrReplace(AnyKey, "~") ;Remove the tilde character from variable Anykey, for none blocked hotkeys. If(AnyKey = "w") ;Check to see if the hotkey is also the w key. { KeyWait, w, T0.5 ;Waiting half a second for w to be physically released. If(errorlevel = 1) ;When w is still down after 0.5s errorlevel is set to 1. You're probably walking manually. { KeyWait, w ;Waiting for w key to be released. exit ;W is physically released, so we can exit here since movement is stopped. } } keywait, %AnyKey% ;Waiting for the hotkey to be released. If not W_VirtState:=GetKeyState("w") ;When the virtual status of the w key is not down, when W_VirtState is 0. Do whatever comes below. { SendInput, {w down} ;Virtually pressing w down. Virtual (logical state) is whatever your O.S. thinks the key status is in. Physical is the actual state on you're keyboard. keywait, %AnyKey% Loop { ;When any of the following: hotkey, Mouse Lbutton, s or w keys are pressed, AutoWalking will stop. If(KeyState:=GetKeyState(AnyKey, "P") || KeyState:=GetKeyState("Lbutton", "P") || KeyState:=GetKeyState("w", "P") || KeyState:=GetKeyState("s", "P")) { keywait, %AnyKey% ;Waiting for your hotkey to be released. SendInput, {w up} ;Virtually sending w up. Stop moving. break ;Breaking free from the loop. } sleep, 100 ;Wait 100ms every time the loop is repeated. Prevents the function from using too much CPU cycles. } ;You can increase the sleep length, but the function will be less responsive (character will walk longer/further after you stop the AutoWalk) } } Return /* END OF SCRIPT */
Modify the script
You may skip this section if you are OK with the basic functions explained in the first part of this guide.

The script has comments that should explain fairly well what each line or section does. Edit the script to your liking or comment sections to disable some features. Use your text editor again. If you installed AutoHotkey then right clicking on the .ahk file will give you an option "Edit Script"

Comment one line by adding ; in front of it.
Comment multiple lines by wrapping them in /* and */ for example:
;THIS LINE IS A COMMENT /* THESE LINES ARE COMMENTED */

Change this line from "e" to whichever hotkey you wish to use for toggling AutoWalking or simply comment it to disable a hotkey:
e::AutoWalk() return

Comment the double tap section or simply delete it to stop AutoWalk from toggling when you double tap the "w" key:
; DOUBLE TAPPING "w" WITHIN 0.3 SECONDS WILL AutoWalk - COMMENT THIS SECTION OUT TO DISABLE DOUBLE TAPPING (WRAP THEM IN /* */) ; *SECTION START* ~w:: { KeyWait, w KeyWait, w, D T0.3 If (!ErrorLevel) { AutoWalk() } } return ; *SECTION END*
Run the script
Run the script by simply double clicking TheLongDark.ahk!

This should start the AutoHotkey in your taskbar and with a green icon indicate that the script is running.

Start the game and start walking!
8 Comments
frenchvelvet 12 Dec, 2019 @ 12:38pm 
I use this script so much on my usual PC. Today I am not at home and I am using a Mac. Can anyone tell me how to do something similar on a Mac? I spent some time trying to do it in Karabiner but I really really don't know what I am doing!
stark 2 Nov, 2019 @ 1:28pm 
Thank you, as a disabled player this helps immensely on a game that is pretty unfriendly in its user controls for the disabled.
Gecko-[GER] 23 Sep, 2019 @ 4:01am 
Great work, I have linked your manual in my Survival Guide
ParryThrust 21 Jun, 2019 @ 8:54am 
Thanks for this. And for finally getting me to download Auto Hot Key, which I've been meaning to do forever.
Madhouse 14 Apr, 2018 @ 11:31pm 
or just shift+tab while walking

trust me it works
Hybridizer 9 Apr, 2018 @ 10:17am 
Nice work, thanks for putting this together! It works great! :steamhappy:
pbmax 27 Mar, 2018 @ 5:15pm 
Thanks. Is there a way to disable the script? Now my "e" key doesn't do anything at all.
Gimpster 6 Feb, 2018 @ 10:04pm 
orrrr you can just hold e while you open up steam browser, it'll keep you walking and if you exit steam browser you wont stop until you hit w again. as a plus, you can watch youtube while you walk and tab out every once in a while to check for predators.