Autohotkey

#SingleInstance Force
setKeyDelay, 50

CSG := 1
HC := 2
PR := 3
RocketLancher := 4
SSG := 5
Ballista := 6
Vulcan := 7
BFG := 8
Chainsaw := "c"
SlayerCrucible := "v"
WSwap := "f"
wwheel := "q"
PB := False
SB := False
Fire := "o"

global A_tick := 0

; Long-range weapon list
lrwl := [4, 6, 1]
lrwl_index := 0
gun_switch := 0

::cod::
    SendInput removeinventoryitem weapon/player/crucible
    Sleep, 200
    Send, {enter}
    Sleep, 200
    SendInput give weapon/player/hammer
    Sleep, 200
    Send, {enter}
return


#IfWinActive, ahk_exe DOOMEternalx64vk.exe
    Lbutton::
            Send {%Fire% Down}
    Return

    Lbutton Up::
            Send {%Fire% Up}
    Return

    1::
        Send, {%Ballista%}
    Return

    3::
        Send, {%Vulcan%}
    Return

    $CapsLock::
        SetCapsLockState, Off
        Send, {%wwheel% Down}
    return

    v::
        Send, {%wwheel% Down}
    return

    $CapsLock Up::
        SetCapsLockState, Off
        Send, {%wwheel% up}
    return
    
    ctrl::
        func_(-1)
        KeyWait, Ctrl
    Return
    
    ctrl up::
        func_(1)
    Return
    
    func_(a){
        if a < 0
            A_tick := A_TickCount
        else
        {
            A_tick := A_TickCount - A_tick
            if A_tick < 200
            {
                Send, {Ctrl}
                Send, {g}
            }
            Else
                Send, {g}
            A_tick := 0
        }
    }

    ; 弩炮/双毁灭者之刃
    *F3::
        KeyWait, F3, T0.2
        if not(ErrorLevel)
        {
            if GetKeyState("Rbutton", "P")
            {
                Send, {%Fire%}
                Send, {%wwheel% down}
                Sleep, 70
                DllCall("mouse_event", "UInt", 1, "UInt", -100, "UInt", 0)
                Sleep, 10
                Send, {%WSwap%}
                Sleep, 100
                Send, {%wwheel% Up}
                Sleep, 100
                Send, {RButton Up}
                Sleep, 500
                Send, {%WSwap%}
                KeyWait, F3
            }
            Else
                Send, {%PR%}
        }
        else
        {
            Send, {%Ballista%}
            KeyWait, F3
        }
    Return

    z::
        Send, {%BFG%}
    Return

    ; 长按e,裁决剑或者守卫之锤
    *e::
        KeyWait, e, T0.2
        if not(ErrorLevel) 
        {
            Send, {e}
        }
        else ;长按裁决剑或者守卫之锤
        {
            Send, {%SlayerCrucible%}
            KeyWait, e
        }
    Return
 
    $f::
        KeyWait, f, T0.2
        if not(ErrorLevel) ;单击电锯
        {
            Send, {%Chainsaw%}
        }
        else
        {
            Send, {%WSwap%}
            KeyWait, f
        }
    Return

    ~*WheelUp::
        Send, {%SSG%}
    Return

    q::
        KeyWait, q, T0.2
        if not(ErrorLevel) ;单击电锯
        {
            Send, {%Vulcan%}
        }
        else
        {
            Send, {%RocketLancher%}
            KeyWait, q
        }
    Return
    
    ; 滚轮下切狙->火->狙->弩->狙->黏
    $WheelDown::
        Send, {%HC%}
        Sleep, 150
        Send, {Rbutton Down}
        Sleep, 100
        Send, {%Fire% Down}
        key := lrwl[lrwl_index]
        if key = 1
        {
            Send, {%Fire% Up}
            Send, {%key%}
            Sleep, 200
            Send, {%Fire% Down}
            Send, {%HC%}
            Send, {%Fire% Up}
        }
        else
        {
            Send, {%key%}
            Sleep, 50
            Send, {Rbutton Up}
            Sleep, 450
            Send, {%Fire% Up}
            Send, {%HC%}
        }
        lrwl_index := lrwl_index + 1
        if lrwl_index > 3
            lrwl_index := 1
    Return

    *x::
        DllCall("mouse_event", "UInt", 1, "UInt", -1870, "UInt", 0)
    return

    F1::
        Send {%wwheel% Down}
    Return

    F1 Up::
        Send {%wwheel% Up}
    Return

    ;返身弩炮加速
    F2::
        Send {%Ballista%}
        Sleep, 200
        DllCall("mouse_event", "UInt", 1, "UInt", -1870, "UInt", 0)
        Sleep, 200
        Send {%Fire%}
        Sleep, 200
        DllCall("mouse_event", "UInt", 1, "UInt", -1870, "UInt", 0)
    return
#IfWinActive

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值