如何在 Logitech G Hub 上随机化 xy 运动

发布于 2025-01-20 07:48:31 字数 1173 浏览 0 评论 0原文

我是初学者,我正在尝试在Logitech Ghub中制作宏。 我设法编程了所有内容,但是我随机移动。 是否可以将随机移动添加到此宏?

我在许多地方进行了搜索,但没有找到与我的问题相似的东西。

我希望他们随机移动,而与脚本中的移动不一样。

谢谢你!

function OnEvent(event, arg)
 if event == "MOUSE_BUTTON_PRESSED" and arg == 3 then
 PressKey("lshift")
            MoveMouseTo(34650, 26299)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(34650,30854)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(32755,30854)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30860,30794)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30911,26360)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30911,21865)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30))          
            MoveMouseTo(32780,21805)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(34650,21926)
            PressAndReleaseMouseButton(3)
ReleaseKey("lshift")
            end               
end

I'm a beginner and I'm trying to make a macro in Logitech GHub.
I managed to program everything, but I randomly movements .
Is it possible to add random moves to this macro?

I searched in many places and didn't find anything similar to my question.

I want them to move randomly and not the same as in the script.

Thank you!

function OnEvent(event, arg)
 if event == "MOUSE_BUTTON_PRESSED" and arg == 3 then
 PressKey("lshift")
            MoveMouseTo(34650, 26299)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(34650,30854)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(32755,30854)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30860,30794)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30911,26360)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(30911,21865)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30))          
            MoveMouseTo(32780,21805)
            PressAndReleaseMouseButton(3)
Sleep(math.random(13, 30)) 
            MoveMouseTo(34650,21926)
            PressAndReleaseMouseButton(3)
ReleaseKey("lshift")
            end               
end

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文