我怎样才能做到这一点,以便当按下鼠标按钮 4 时它将停止脚本工作,基本上是一个终止开关

发布于 2025-01-10 03:02:47 字数 383 浏览 3 评论 0原文

我想知道如何做到这一点,以便当按下鼠标按钮 4 时它会停止或添加很长的休息时间。基本上是一个终止开关,可以禁用自动答题器工作

function OnEvent(event, arg)
   --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
   if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then 
      repeat 
         PressAndReleaseMouseButton(1)
         Sleep(math.random(40, 135)) 
      until not IsMouseButtonPressed(5)
   end
end

I am Wondering how to make it so when mouse button 4 is pressed it stops or adds a very long rest. basically a kill switch that disables the auto clicker from working

function OnEvent(event, arg)
   --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
   if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then 
      repeat 
         PressAndReleaseMouseButton(1)
         Sleep(math.random(40, 135)) 
      until not IsMouseButtonPressed(5)
   end
end

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

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

发布评论

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

评论(2

我三岁 2025-01-17 03:02:47

Lua中的until定义了repeat-until循环的退出条件。
尝试替换

until not IsMouseButtonPressed(5)

until not IsMouseButtonPressed(5) or IsMouseButtonPressed(4)

until in Lua defines exit condition of the repeat-until loop.
Try to replace

until not IsMouseButtonPressed(5)

with

until not IsMouseButtonPressed(5) or IsMouseButtonPressed(4)
一个人的夜不怕黑 2025-01-17 03:02:47

试试这个!

function OnEvent(event, arg)
   --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
if (event == "PROFILE_ACTIVATED") then 
        EnablePrimaryMouseButtonEvents(true) 
elseif event == "PROFILE_DEACTIVATED" then 
 ReleaseMouseButton(1)
 ReleaseMouseButton(2) --prevent stuck
end 
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then 
        enable = not 
        enable point = not point 
end    
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) and enable then 
      repeat 
         PressAndReleaseMouseButton(1)
         Sleep(math.random(40, 135)) 
      until not IsMouseButtonPressed(5)
   end
end

MBTN 7 将成为您的交换机

Try this!

function OnEvent(event, arg)
   --OutputLogMessage("Event: "..event.." Arg: "..arg.."\n")
if (event == "PROFILE_ACTIVATED") then 
        EnablePrimaryMouseButtonEvents(true) 
elseif event == "PROFILE_DEACTIVATED" then 
 ReleaseMouseButton(1)
 ReleaseMouseButton(2) --prevent stuck
end 
if (event == "MOUSE_BUTTON_PRESSED" and arg == 7) then 
        enable = not 
        enable point = not point 
end    
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) and enable then 
      repeat 
         PressAndReleaseMouseButton(1)
         Sleep(math.random(40, 135)) 
      until not IsMouseButtonPressed(5)
   end
end

MBTN 7 ll be ur switch

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文