AHK ControlSend {s Down}在游戏中不起作用

时间:2014-11-01 12:32:38

标签: autohotkey

有没有人对以下情况有任何好运

我正在为Mortal Online编写代码,它需要在游戏未集中时按下键。所有其他命令在此代码中完美运行,除了“controlSend ,, {s Down},ahk_id%id%”& “controlSend ,, {s Up},ahk_id%id%”。

training() {
    ;set variabls to global
    global

    id := getMortalID()

    while(Continue()) { 
        if(toolTipToggle) {
            ToolTip, Auto Train, 15, 85         
        }

        ;Take out weapon and run forward
        controlSend, ,%sheath%, ahk_id %id%     
        sleep 2000              
        controlSend, ,%autorun%, ahk_id %id%            
        loop 100 {
            if(!Continue()) {                   
                    controlSend, ,%autorun%, ahk_id %id%
                    sleep 50
                    controlSend, ,%sheath%, ahk_id %id%
                    Return
            }
            controlSend, ,{LShift}, ahk_id %id%
            sleep 100
        }

        ;stop running forward and jump backward
        Sleep 50
        controlSend, ,%autorun%, ahk_id %id%
        Sleep 50        
        loop 10 {               
            if(!Continue()) {       
                ControlSend, ,%sheath%, ahk_id %id%
                Return
            }       

            controlSend, ,{s Down}, ahk_id %id%
            sleep 10000
            controlSend, ,{s Up}, ahk_id %id%

        }

        ;stop jumping back and sheath weapon then sleep for 15s
        Sleep 50
        controlSend, ,%sheath%, ahk_id %id%
        sleep 2000      
        if(!Continue()) 
                Return                      
        controlSend, ,%sleeping%, ahk_id %id%
        Sleep 15000
    }   ; repeat

    AnyScreen = 0
}

有人对此有任何解决方案吗?我尝试过keydelays,设置#InstallKeybdHook。

感谢您提前考虑。

0 个答案:

没有答案