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
- ;
- ; LAlt = Hold to walk key. Recommended: 'LAlt'
- ; F7 = (In-game) Sprint key. *Recommended: 'F7' (not recommended to use anything other than function keys)
- ; F8 = (In-game) Reload key. *Recommended: 'F8' (not recommended to use anything other than function keys)
- ; R = Alternate reload key. Recommended: 'r' (note: serves as 2nd reload key, specific to this script, because dt only has 1 reload key)
- ; Left click = Primary Fire key. Recommended: 'LButton' (mouse1)
- ; Right click = Secondary Fire. Recommended: 'RButton' (mouse2)
- ; F6 = Toggles the script on and off. Recommended: 'F6'
- ; F4 = Toggles 'psyker mode'(auto-quell). Recommended: 'F4'
- ; Middle Mouse Button = Toggles quell on. Recommended: 'MButton' (middle mouse button)
- ; LShift = Crouch key. Recommended: 'LShift'
- ; These keys are used to facilitate Psyker mode, find & replace them even if you're not using it
- ; 1 = Primary Weapon key. Recommended: '1'
- ; 2 = Secondary Weapon key. Recommended: '2'
- ; 3 = Deployable tool key. Recommended: '3'
- ; 4 = Auspex key. Recommended: '4'
- ; q = 'Blitz' key (grenade key). Recommended: 'q'
- ; e = Interact key. Recommended: 'e'
- ; z = 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 F7 and F8 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)
- f6::
- 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)
- f4::
- 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
- ~LAlt::
- sprinting := false
- Send {F7 Up}
- shooting := false
- Gosub, releasequell
- return
- ~LAlt up::
- sprinting := true
- If (shooting = false){
- Send {F7 Down}
- }
- return
- ; Use reset kickstart/restart autosprint when it jams in-game, intentionally made to coincide with crouch key so resets happen naturally and frequently
- ~*LShift::
- sprinting := false
- Send {F7 Up}
- shooting := false
- return
- ~*LShift 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
- ~*MButton::
- if (psykerMode)
- Gosub, startquell
- return
- delayedreleasequell:
- if (GetKeyState("r", "P"))
- return
- releasequell:
- Send {F8 Up}
- quelling := false
- SetTimer, releasequell, Off
- return
- startquell:
- Send {F8 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
- ~*q::
- ~*e::
- ~*1::
- ; ~*2::
- ~*3::
- ~*4::
- ~*z::
- 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)
- ~*r::
- if (!psykerMode) {
- Send {F8 down}
- return
- }
- Gosub, startquell
- If !Time
- Time := A_TickCount
- return
- ~*r up::
- if (!psykerMode) {
- Send {F8 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 {F7 up}
- Send {F7 down}
- }
- return
- #MaxThreadsPerHotkey 40
- ~*LButton:: ;Shooting
- ~*RButton:: ;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("RButton", "P")))) {
- Send {F7 Up}
- }
- return
- ~*LButton up:: ;Shooting
- ~*RButton 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 {F7 Down}
- }
- return
- #If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement