我正在尝试运行一些macrio,它允许我模拟Left MOuse按钮单击,直到按下鼠标左键。但我不知道如何强制脚本停止当我物理释放鼠标左键并再次按下LButton时再次开始sript。我的代码如下所示:
SetTimer, keyStates, 100
LeftClick:="LButton"
KeyStates: ; SubRoutine
if GetKeyState(LeftClick, "P") {
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
}
}
我是这个脚本语言的新手,所以我会感谢任何帮助
答案 0 :(得分:0)
您的代码无法编译,因为最后一个右括号}
没有相应的开括号。删除它。
添加以下行:
#Persistent
位于脚本顶部,因此程序不会立即关闭。
通过这些更正程序可以正常运行。