Here is version 6 of the script.
What's new in v6?
1) Mouse wheel sensitivity (number of steps up or down) is no longer a thing. Just move the mouse wheel up one or more steps in a row to accelerate. Move the mouse wheel down one or more steps in a row to decelerate.
2) You can again navigate the inventory, turn pages, numbered dials and move objects you are holding back and forth by using Parry/Manipulate plus the mouse wheel.
Please pay attention to the configuration.
------------------------------------
ADJUST PLAYER SPEED WITH THE MOUSE WHEEL v6.0
Credits: Obsttorte, snatcher.
Description: Err... adjust player speed with mouse wheel?
Topic: Adjust player speed with mouse wheel
Installation and execution:
Download AutoHotkey, install it, open Notepad, paste the below script inside, save it as TDM.ahk and double click on the file you just saved. The script will run in the background.
To end the script, go to the Windows taskbar, look for a green icon with an "H", right click on it and select Exit.
Configuration:
Settings > Controls > Weapons: Remove mouse wheel bindings from Next Weapon and Previous Weapon (or from any other setting you may have set the mouse wheel to)
Settings > Controls > General: Make sure Toggle Crouch is enabled and Always Run is disabled
Settings > Controls > Movement: The Forward, Backwards, Left, Right, Run and Creep keys must match in both TDM and the script.
Settings > Controls > Actions: The Parry/Manipulate key must match in both TDM and the script.
Settings > Controls > Inventory: The Next Inv. Item and Prev Inv. Item must match in both TDM and the script.
Recommended controls:
Forward / Backward / Left / Right: W, S, A, D
Run: Z
Creep: C
Parry/Manipulate: Right Mouse Button
Next Inv. Item / Prev Inv. Item: Right Arrow, Left Arrow
Known limitations and workarounds:
You can move through the inventory, turn pages, numbered dials and move objects you are holding back and forth using Next / Prev Inv. Item or Parry/Manipulate + the mouse wheel.
To prepare for a long jump from idle, move the mouse wheel up before executing your move.
Remember the script will switch you automatically from running to walking after one second of inactivity.
You cannot lean forward and switch speeds at the same time, for some reason...
; =====================================
; Adjust player speed with mouse wheel
; -------------------------------------
; An AutoHotkey script for The Dark Mod
; version 6.0 by Obsttorte & snatcher
; =====================================
; -------------------------------------
; Configure your keys below
; -------------------------------------
; In-game movement keys
key_left = a
key_right = d
key_forward = w
key_backward = s
; In-game run and creep keys
key_run = z
key_creep = c
; In-game manipulate key (recommended right mouse button: RButton)
key_manipulate = RButton
; In-game Next/Prev inventory keys
key_next = Right
key_prev = Left
; -------------------------------------
; Do not edit anything past this point
; -------------------------------------
delay = 1000 ; delay in miliseconds between running > walking [default = 1000]
speed = 0 ; init speed (-1 = creep | 0 = walk [default] | 1 = run)
state = speed; counter for state switch
#IfWinActive ahk_exe TheDarkModx64.exe ; run only when TDM is focused
HotKey, *~%key_forward% up, keyForwardHandler
return
keyForwardHandler:
if (speed == 1) ; we are running
{
sleep, delay
if (!GetKeyState(key_forward) && !GetKeyState(key_backward) && !GetKeyState(key_right) && !GetKeyState(key_left))
{
speed = 0 ; walk
Send {%key_run% up}
}
}
return
*wheelup::
if (GetKeyState(key_manipulate))
{
Send {%key_next%}
}
else
{
state += 1
if (speed == -1) ; we are creeping
{
speed = 0 ; walk
Send {%key_creep% up}
}
else if (speed == 0) ; we are walking
{
speed = 1 ; run
Send {%key_run% down}
}
state = 0
Sleep, 300
}
return
*wheeldown::
if (GetKeyState(key_manipulate))
{
Send {%key_prev%}
}
else
{
state -= 1
if (speed == 0) ; we are walking
{
speed = -1 ; creep
Send {%key_creep% down}
}
else if (speed == 1) ; we are running
{
speed = 0 ; walk
Send {%key_run% up}
}
state = 0
Sleep, 300
}
return
Change-log:
v6.0: You can now use as many mouse wheel steps as you like to switch speeds. You can navigate the inventory, turn pages, numbered dials and move objects you are holding back and forth by using Parry/Manipulate plus the mouse wheel.
v5.0: To prevents sudden halts when running, a one-second delay has been added between the moment the player stops going forward and the script takes you automatically back to walking mode. To allow for a greater freedom of movement, the script requires to know now your backwards, right and left keys.
v4.0: Altered so that when player is running and stops, you are back to walking mode.
v3.0: The script only runs when TDM is in focus (tested in Win 10)
v2.0: Second version by Obsttorte
v1.0: First version by Obsttorte
Cheers!