lua右mousebutton点击器

发布于 2025-02-07 23:55:31 字数 502 浏览 2 评论 0原文

我希望我的头衔还可以。

我有一个用于GHUB的工作脚本,当按下Mousebutton 4时,它会垃圾邮件留下mousebutton:

function OnEvent(event, arg)
   if(event == "PROFILE_ACTIVATED") then
      EnablePrimaryMouseButtonEvents(true);
   elseif(event == "PROFILE_DEACTIVATED") then
   end
   if  IsMouseButtonPressed(4)then
      repeat
         PressMouseButton(1)
         Sleep(1)
         ReleaseMouseButton(1)
      until not IsMouseButtonPressed(4)
   end
end

如何在同一脚本中添加相同的函数,但是当按下MouseButton 5时,右键单垃圾邮件?

I hope my title is okay.

I have this working script for Ghub that when mousebutton 4 is pressed, it spams Left mousebutton:

function OnEvent(event, arg)
   if(event == "PROFILE_ACTIVATED") then
      EnablePrimaryMouseButtonEvents(true);
   elseif(event == "PROFILE_DEACTIVATED") then
   end
   if  IsMouseButtonPressed(4)then
      repeat
         PressMouseButton(1)
         Sleep(1)
         ReleaseMouseButton(1)
      until not IsMouseButtonPressed(4)
   end
end

How can I add the same function in the same script but for rightclick spam when mousebutton 5 is pressed?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无妨# 2025-02-14 23:55:31

如果块类似于您已经拥有的,只需添加一个

function OnEvent(event, arg)
   if event == "PROFILE_ACTIVATED" then
      EnablePrimaryMouseButtonEvents(true)
   end
   if IsMouseButtonPressed(4) then
      repeat
         PressMouseButton(1) -- LMB
         Sleep(1)
         ReleaseMouseButton(1)
      until not IsMouseButtonPressed(4)
   end
   if IsMouseButtonPressed(5) then
      repeat
         PressMouseButton(3) -- RMB
         Sleep(1)
         ReleaseMouseButton(3)
      until not IsMouseButtonPressed(5)
   end
end

Just add one more if block similar to the one you already have:

function OnEvent(event, arg)
   if event == "PROFILE_ACTIVATED" then
      EnablePrimaryMouseButtonEvents(true)
   end
   if IsMouseButtonPressed(4) then
      repeat
         PressMouseButton(1) -- LMB
         Sleep(1)
         ReleaseMouseButton(1)
      until not IsMouseButtonPressed(4)
   end
   if IsMouseButtonPressed(5) then
      repeat
         PressMouseButton(3) -- RMB
         Sleep(1)
         ReleaseMouseButton(3)
      until not IsMouseButtonPressed(5)
   end
end
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文