当我用鼠标左键同时按住左键控制键时,我正在尝试制作一个反复点击鼠标左键的脚本
这是我到目前为止:
function OnEvent(event, arg, family)
OutputLogMessage("clicked event = %s, arg = %s\n", event, arg);
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 and Ctrl_Down == 1 then
repeat
PressMouseButton(1) //repeat while the left mouse button down
until not PressMouseButton(1)
else ReleaseMouseButton(3) //stop the repating on left mouse button up
end
end
Run Code Online (Sandbox Code Playgroud)
请注意,这是我第一次查看此类编码,因为非常感谢任何帮助
Logitech API 更新为5.4 Lua版本后,table.getn被弃用,一些帮助我的人说我可以更新代码,#但代码的逻辑似乎不再适用于此替换,我尝试做一些解决方法代码,但我对编程不太熟悉,如何修复 Logitech API 的此代码?有人可以指导我吗?
Sense = 1.4;
--Rate of FIRE (in seconds)
G36ROF = 10 --600RPM.
HKROF = 11.1 --666RPM.
ROF = {G36ROF, HK417ROF} --Rate of FIRE (seconds)
------------------------------------------------------------------
indexWeapon = 0;
indexPattern = 1;
delay = 0;
-------------------------| Recoil Patterns |-----------------------
G36 = {{x=0.0, y=0.0}, {x=-0.337486, y=0.372398}, {x=-0.308392, y=0.418948}, {x=-0.244386, y=0.474808}, {x=-0.216456, y=0.530667}, {x=-0.097755, y=0.551615}, {x=-0.070663, y=1.130321}, {x=0.201095, y=1.246789}, {x=0.361971, y=1.226679}, {x=0.372026, y=1.136187}, {x=0.33784, y=1.423752}, {x=0.180985, y=2.135629}, {x=-0.108591, …Run Code Online (Sandbox Code Playgroud) 我开始学习如何使用 Logitech 软件针对不同的游戏配置文件使用 Lua 脚本。
首先我尝试使用 onevent (我知道它不是很先进)并创建了这个攻击组合脚本
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then --set flag for mb1
mb1_pressed = true
elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then --set flag for mb1=false
mb1_pressed = false
end
end
if mb1_pressed then --using flags to determine whether to start attack or not
repeat
presskey("A")
Sleep(50)
releasekey("A")
Sleep(100)
--if MB1 is release, it will also break script. if i only tap mb1, this will only …Run Code Online (Sandbox Code Playgroud)