罗技鼠标宏吧 关注:373贴子:665
  • 26回复贴,共1

连点的实现

只看楼主收藏回复


EnablePrimaryMouseButtonEvents(true)
open = false
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
open = not open
if open then
OutputLogMessage("开启\n")
else
OutputLogMessage("关闭\n")
end
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and open) then
local pressed = true
repeat
Sleep(10)
if not IsMouseButtonPressed(1) then
pressed = false
else
PressMouseButton(1)
end
until not pressed
end
end
由于一直有友友要连点的代码,今天有时间就敲出来了,开启方式还是老样子按下鼠标切换dip的按键切换是否开启,而后按下左键就以每秒100下的速度连点
注:不是每个鼠标都有切换鼠标dpi的按键,需要改按键的修改第4行的数字6为1-6之间的数字,一般来说是1鼠标左键,2鼠标右键,3鼠标侧1,4鼠标侧2;以此类推慢慢试换成侧键就能平替
连点的速度修改是第15行的Sleep(x),速度为每秒1000/下,按照需求自行调节


IP属地:湖北1楼2025-02-02 05:05回复
    大佬 有的游戏这个代码不行 如果把按住1 改成按住别的键就可以


    IP属地:山东2楼2025-02-14 10:25
    收起回复
      2025-08-20 15:12:24
      广告
      不感兴趣
      开通SVIP免广告
      老哥你会做按住1连点的同时下压吗


      IP属地:江苏来自Android客户端3楼2025-02-18 18:54
      收起回复
        大佬,这个能不能直接把连发绑到侧键的,就是按侧键连发左键,松开侧键停止


        IP属地:广东来自Android客户端4楼2025-05-04 12:08
        收起回复
          kg = false --开关初始状态
          EnablePrimaryMouseButtonEvents(true)
          function OnEvent(event, arg)
          --OutputLogMessage("Event: "..event.." Arg: "..arg.."")
          if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then --如果按下鼠标4键
          kg= not kg --将开关从false切换到then或从then切换到false
          if kg then --如果开关为then是
          OutputLogMessage("on \n") --输出on
          else --否则
          OutputLogMessage("off \n") --输出off
          end
          end
          if kg then --如果开关为then
          if IsMouseButtonPressed(1) then --如果按下鼠标主键
          repeat --循环
          Sleep(50) --延迟50毫秒
          PressMouseButton(1) --按下鼠标
          Sleep(math.random(50, 150)) --随机延迟
          ReleaseMouseButton(1) --松开鼠标
          until not IsMouseButtonPressed(1) --松开鼠标主键退出循环
          end
          end
          end
          大佬能给帮着看看么,自己写的随机延迟连点的脚本,设置按下鼠标左键连发可以,设置成侧键就不行了,有时候还不退出循环,不知道哪里出了问题。


          IP属地:广东5楼2025-05-04 22:43
          收起回复
            if kg then --如果开关为then
            if IsMouseButtonPressed(5) then --如果按下鼠标主键
            repeat --循环
            Sleep(50) --延迟50毫秒
            PressMouseButton(1) --按下鼠标
            Sleep(math.random(50, 150)) --随机延迟
            ReleaseMouseButton(1) --松开鼠标
            until not IsMouseButtonPressed(5)
            下面的判断循环改成这样了


            IP属地:广东7楼2025-05-04 23:50
            回复
              请问大佬是直接复制就能用吗,格式什么的需不需要调整


              IP属地:江苏来自Android客户端8楼2025-05-11 03:36
              收起回复