Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- #MaxThreads 50
- #MenuMaskKey vk07
- ; !!!! DO NOT USE THIS SCRIPT UNTIL YOU HAVE REPLACED THESE KEYS !!!!
- ; Find and replace the following with whatever you have as your in-game keybinds - some keys dont exist ingame, for these keys, use whatever you want (refer to AutoHotkey API for actual AHK-usable keynames):
- ; 1_WALK = Hold to walk. Recommended: 'LAlt'
- ; 2_SPRINT = Sprint key. *Recommended: 'F7' (not recommended to use anything other than function keys)
- ; 3_RELOAD = Reload key. *Recommended: 'F8' (not recommended to use anything other than function keys)
- ; 3_ALTRELOAD = Alternate reload key. Recommended: 'r' (note: serves as 2nd reload key, specific to this script, because dt only has 1 reload key)
- ; 4_SHOOT = Primary Fire key. Recommended: 'LButton' (mouse1)
- ; 5_SECONDARYFIRE = Secondary Fire. Recommended: 'RButton' (mouse2)
- ; 6_SUSPEND = Toggles the script on and off. Recommended: 'F6'
- ; 7_PSYKERMODE = Toggles 'psyker mode'(auto-quell). Recommended: 'F4'
- ; 8_TOGGLEQUELLON = Toggles quell on. Recommended: 'MButton' (middle mouse button)
- ; 9_CROUCH = Crouch key. Recommended: 'LShift'
- ; These keys are used to facilitate Psyker mode, find & replace them even if you're not using it
- ; A_WEAPON1 = Primary Weapon key. Recommended: '1'
- ; A_WEAPON2 = Secondary Weapon key. Recommended: '2'
- ; A_DEPLOY = Deployable tool key. Recommended: '3'
- ; A_AUSPEX = Auspex key. Recommended: '4'
- ; B_GRENADE = 'Blitz' key (grenade key). Recommended: 'q'
- ; B_INTERACT = Interact key. Recommended: 'e'
- ; B_ABILITY = Ability key. Recommended: 'z'
- ; *Reason you should only use function keys for the script's reload/sprint:
- ; The script continues sending these key-downs even if you're typing into in-game chat etc.
- ; which means the key would show up in chat (unless you use function keys like what was recommended)
- ; Note: for these situations, hit the 2_SPRINT and 3_RELOAD key on your keyboard to reset their state
- ; (you can also suspend the script to prevent it from holding it down again, good for when you alt-tab and need to know these keys aren't being held down)
- ; Use lowercase for this key (f6 not F6, don't ask me, ask AHK why this is a thing)
- 6_SUSPEND::
- suspend
- return
- ; #IfWinActive, Warhammer 40,000: Darktide
- psykerMode := false
- shooting := false
- sprinting := false
- quelling := false
- #If (WinActive("Warhammer 40,000: Darktide"))
- ; Toggle psykerMode (defaults to non-psyker mode on startup)
- ; use lowercase for this key (f4 not F4)
- 7_PSYKERMODE::
- psykerMode := !psykerMode
- if (psykerMode) {
- SoundPlay *-1
- Sleep 250
- SoundPlay *-1
- } else
- SoundPlay *-1
- return
- ; Use to kickstart/restart the script when it jams in-game
- ~1_WALK::
- sprinting := false
- Send {2_SPRINT Up}
- shooting := false
- Gosub, releasequell
- return
- ~1_WALK up::
- sprinting := true
- If (shooting = false){
- Send {2_SPRINT Down}
- }
- return
- ; Use to reset kickstart/restart autosprint when it jams in-game, intentionally made to coincide with crouch key so resets happen naturally and frequently
- ~*9_CROUCH::
- sprinting := false
- Send {F7 Up}
- shooting := false
- return
- ~*9_CROUCH up::
- sprinting := true
- If (shooting = false){
- Send {F7 Down}
- }
- return
- ; Quell/reload toggle-ON for psykers only - perfectly mashable as it doesnt toggle-off if you mash it
- ~*8_TOGGLEQUELLON::
- if (psykerMode)
- Gosub, startquell
- return
- delayedreleasequell:
- if (GetKeyState("r", "P"))
- return
- releasequell:
- Send {3_RELOAD Up}
- quelling := false
- SetTimer, releasequell, Off
- return
- startquell:
- Send {3_RELOAD down}
- quelling := true
- SetTimer, delayedreleasequell, -3000
- return
- ; Do not uncomment the 'staff'/secondary weapon key - this is so that quell carries over when you switch to staff
- ~*B_GRENADE::
- ~*B_INTERACT::
- ~*A_WEAPON1::
- ; ~*A_WEAPON2::
- ~*A_DEPLOY::
- ~*A_AUSPEX::
- ~*B_ABILITY::
- if (psykerMode)
- Gosub, releasequell
- return
- ; Alternate reload key
- ; Hold briefly to toggle-on quell, tap for normal reload, (also, do not hold for more than a second)
- ~*3_ALTRELOAD::
- if (!psykerMode) {
- Send {3_RELOAD down}
- return
- }
- Gosub, startquell
- If !Time
- Time := A_TickCount
- return
- ~*3_ALTRELOAD up::
- if (!psykerMode) {
- Send {3_RELOAD up}
- return
- }
- if ((A_TickCount - Time < 100) || (A_TickCount - Time > 1250)) {
- Gosub, releasequell
- }
- ; else do nothing and quell is held down
- Time := ""
- return
- ; #If (sprinting and WinActive("Warhammer 40,000: Darktide"))
- ~esc::
- Sleep, 100
- if(sprinting){
- Send {2_SPRINT up}
- Send {2_SPRINT down}
- }
- return
- #MaxThreadsPerHotkey 40
- ~*4_SHOOT:: ;Shooting
- ~*5_SECONDARYFIRE:: ;SecondaryFire
- if (psykerMode)
- Gosub, releasequell
- If (shooting < 2) {
- shooting := shooting + 1
- }
- ; Sprint remains held down if holding Lclick/Rclick + forward movement (i.e. strafe keys not pressed)
- If !((GetKeyState("w", "P") && !(GetKeyState("a", "P") || GetKeyState("d", "P") || GetKeyState("5_SECONDARYFIRE", "P")))) {
- Send {2_SPRINT Up}
- }
- return
- ~*4_SHOOT up:: ;Shooting
- ~*5_SECONDARYFIRE up:: ;SecondaryFire
- If (shooting > 0) {
- shooting := shooting - 1
- }
- Sleep, 650 ;Delay before sprinting again. Prevents issues where sprinting may interfere with firing or meleeing. Adjust higher if problems are encountered (values below 650 not recommended unless you know what you are doing)
- If (sprinting && (shooting = 0)){
- Send {2_SPRINT Down}
- }
- return
- #If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement