我该如何组合这两个 AHK 脚本?请帮忙

我该如何组合这两个 AHK 脚本?请帮忙

有人能帮我吗?我试图将这两个脚本合并为一个,但一直出错。我以为只要把它们结合起来就可以了,但遗憾的是没有哈哈。这两个脚本如下。

#NoEnv
SendMode Input

~F6::Suspend
~End::ExitApp
~F5::Reload

LCtrl & ~LButton::
Loop
If GetKeyState("LButton", "LCtrl") {
    Sleep, 6
    moveAmount := (moveAmount = 2) ? 1 : 0
    mouseXY(moveAmount,7.5)

}
else
break

Return



mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}

第二个脚本是这个 -

f2::Suspend
;Script

~$*LButton::
{
Loop
{
SetMouseDelay 69
MouseClick, Left
If (GetKeyState("LButton","P")=0)
{
Break
Return
}
}
}

答案1

这应该可以解决问题:

#NoEnv
SendMode Input
~F6::Suspend
~F5::Reload
~End::ExitApp

LCtrl & ~LButton::
    SetTimer, pulldown, 6
    SetTimer, click, 69
Return

$LButton::
    SetTimer, click, 69
return

pulldown:
    If (GetKeyState("LButton", "P") && GetKeyState("LCtrl","P"))
    {
        mouseXY(0,7.5)
    } else {
        SetTimer, pulldown, Off
    }
return

click:
    SetMouseDelay 69
    MouseClick, Left
    If (!GetKeyState("LButton","P"))
    {
        SetTimer, click, off
    }
return

mouseXY(x,y)
{
    DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}

相关内容