罗技G hub lua脚本
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
--OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
if (event == "MOUSE_BUTTON_PRESSED" and arg == 11) then
repeat
PressAndReleaseMouseButton(1)
Sleep(1,2)
until not MOUSE_BUTTON_PRESSED("11")
end
end
我这样做了,但第一行出现错误,但我不确定问题是什么。
EnablePrimaryMouseButtonEvents(true)
function OnEvent(event, arg)
--OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
if (event == "MOUSE_BUTTON_PRESSED" and arg == 11) then
repeat
PressAndReleaseMouseButton(1)
Sleep(1,2)
until not MOUSE_BUTTON_PRESSED("11")
end
end
I did this, but an error appears on the first line, but I'm not sure what the problem is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有两个错误:
Sleep(1,2)
不正确:Sleep
需要一个参数 - 整数毫秒。例如,使用
Sleep(10)
MOUSE_BUTTON_PRESSED("11")
是未知函数如果要确定按钮 #11 是否按下:
IsMouseButtonPressed(4)
:There are two mistakes:
Sleep(1,2)
is incorrect:Sleep
expects a single argument - an integer amount of milliseconds.For example, use
Sleep(10)
MOUSE_BUTTON_PRESSED("11")
is unknown functionIf you want to determine whether button #11 is down:
IsMouseButtonPressed(4)
in the script: