Logitech Lua 将 Rapid Fire 与喷雾结合
2020-6-23 22:15:25
收藏:0
阅读:170
评论:1
所以基本上,我脚本现在看起来像这样,它是一个快速射击宏并减少枪支后座力,但是我无法用这个脚本喷洒,因为它很慢,因为我猜它减少了后座力。我想知道是否可以像正常喷雾一样,一次射出4、5颗子弹,没有后座力(只能在按住鼠标3时自动射击,而不能在轻击鼠标时自动射击),并在已经按住鼠标3的情况下继续喷雾,没有延迟。如果有任何疑问,请帮忙解答。
EnablePrimaryMouseButtonEvents(true);
function OnEvent(event, arg)
if IsKeyLockOn("scrolllock")then
if IsMouseButtonPressed(3) then
repeat
if IsMouseButtonPressed(3) then
repeat
PressMouseButton(1)
Sleep(15)
ReleaseMouseButton(1)
until not IsMouseButtonPressed(3)
end
until not IsMouseButtonPressed(3)
end
end
end
点赞
评论区的留言会收到邮件通知哦~
推荐文章
- Lua 虚拟机加密load(string.dump(function)) 后执行失败问题如何解决
- 我想创建一个 Nginx 规则,禁止访问
- 如何将两个不同的lua文件合成一个 东西有点长 大佬请耐心看完 我是小白研究几天了都没搞定
- 如何在roblox studio中1:1导入真实世界的地形?
- 求解,lua_resume的第二次调用继续执行协程问题。
- 【上海普陀区】内向猫网络招募【Skynet游戏框架Lua后端程序员】
- SF爱好求教:如何用lua实现游戏内调用数据库函数实现账号密码注册?
- Lua实现网站后台开发
- LUA错误显式返回,社区常见的规约是怎么样的
- lua5.3下载库失败
- 请问如何实现文本框内容和某个网页搜索框内容连接,并把网页输出来的结果反馈到另外一个文本框上
- lua lanes多线程使用
- 一个kv数据库
- openresty 有没有比较轻量的 docker 镜像
- 想问一下,有大佬用过luacurl吗
- 在Lua执行过程中使用Load函数出现问题
- 为什么 neovim 里没有显示一些特殊字符?
- Lua比较两个表的值(不考虑键的顺序)
- 有个lua简单的项目,外包,有意者加微信 liuheng600456详谈,最好在成都
- 如何在 Visual Studio 2022 中运行 Lua 代码?

local rapid_fire_delay = 15 -- LMB 按下/释放模拟间隔时间 local LMB_Pressed -- 初始化 PRNG(伪随机数生成器) do local dt = 0 for c in GetDate():gmatch"." do dt = (dt % 65537 * 23456 + c:byte()) end math.randomseed(dt) end function OnEvent(event, arg) -- RMB 按下,且 Scroll Lock 键已开启 if event == "MOUSE_BUTTON_PRESSED" and arg == 2 and IsKeyLockOn("scrolllock") then -- 前 4 或 5 发使用快速连发 for j = 1, math.random(4, 5) do PressMouseButton(1) Sleep(math.random(rapid_fire_delay, 2 * rapid_fire_delay)) ReleaseMouseButton(1) Sleep(math.random(rapid_fire_delay, 2 * rapid_fire_delay)) -- 如果 RMB 没有被按下,返回 if not IsMouseButtonPressed(3) then return end end -- 剩余发数正常连发 PressMouseButton(1) LMB_Pressed = true -- RMB 释放 elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 and LMB_Pressed then ReleaseMouseButton(1) LMB_Pressed = false -- 侧键 2 按下 elseif event == "MOUSE_BUTTON_PRESSED" and arg == 5 then repeat Sleep(15) PressKey("SPACEBAR") Sleep(15) ReleaseKey("SPACEBAR") until not IsMouseButtonPressed(5) end endfor j = 1, math.random(4, 5) do的这行代码意思是“发射 4 到 5 发子弹”。如果你需要确切的 3 发子弹,将这一行代码修改为
for j = 1, 3 do。编辑:
以下是让快速连发只在 LMB 双击后才触发的指示。
单独的 LMB 按下不会触发快速连发。
local Prev_LMB_Time, LMB_Pressed = 0 function OnEvent(event, arg) if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then if IsKeyLockOn("scrolllock") then local tm = GetRunningTime() tm, Prev_LMB_Time = tm - Prev_LMB_Time, tm if tm < 200 then -- LMB 双击 for j = 1, 100 do PressMouseButton(1) Sleep(1) ReleaseMouseButton(1) Sleep(1) if not IsMouseButtonPressed(4) then return end end end end PressMouseButton(1) LMB_Pressed = true elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 and LMB_Pressed then ReleaseMouseButton(1) LMB_Pressed = false elseif event == "MOUSE_BUTTON_PRESSED" and arg == 5 then repeat Sleep(15) PressKey("SPACEBAR") Sleep(15) ReleaseKey("SPACEBAR") until not IsMouseButtonPressed(5) end end当前的 GHUB 设置为:
Primary Click = G1 Back = G4 G8应该在 GHUB 中进行以下设置(按照以下顺序):
现在鼠标的按钮 #8 现在是备用 LMB,以防 LMB 工作不正常。