|
|
酒量大的拐杖 · JavaScript API | ...· 3 月前 · |
|
|
眉毛粗的油条 · jQuery键盘事件详解· 2 月前 · |
|
|
急躁的煎鸡蛋 · XMLHttpRequest· 2 周前 · |
|
|
玩滑板的黄花菜 · GitHub - ...· 1 周前 · |
|
|
力能扛鼎的乌龙茶 · vue-cropper - 一城柳絮吹成雪 ...· 1 年前 · |
|
|
英姿勃勃的胡萝卜 · electron通过edge-js调用TSC ...· 2 年前 · |
|
|
内向的小蝌蚪 · 五秒向MySQL插入十万的数据! - 掘金· 2 年前 · |
早上好,
我目前在Logitech中录制了一个宏("Loop"),它执行以下操作:
120延迟,键1,90延迟,左击,150延迟,键2,90延迟,左击,140延迟
它被设置为切换。然后,我使用以下脚本:
local flag
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 20 then
PlayMacro("Loop")
if event == "MOUSE_BUTTON_RELEASED" and arg == 20 then
AbortMacro()
end
然而,这工作得很好。:D很明显,每次重复单击左键后的所有延迟都是相同的。我希望它们在120到160之间是随机的。遗憾的是,我是一个无可救药的LUA新手,所以我做了一些谷歌搜索,试图离开宏,并将其全部放入lua脚本中,但我做错了什么,因为它所做的一切就是不停的按下1:
local flag
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 20 then
Sleep(math.random(120, 160))
PressKey("1")
Releasekey("1")
Sleep(90)
PressMouseButton(1)
ReleaseMouseButton(1)
Sleep(math.random(120, 160))
PressKey("2")
Releasekey("2")
Sleep(90)
PressMouseButton(1)
ReleaseMouseButton(1)
if event == "MOUSE_BUTTON_RELEASED" and arg == 20 then
return
end
我遗漏了什么?
感谢您的帮助!
发布于 2021-09-18 21:29:18
步骤1.
你在游戏中使用鼠标按键4 ("Back")吗?
步骤2.
您必须将游戏操作从MB#4重新映射到其他键。
执行以下操作:
(假设当前未使用
F12
键)
F12
分配给您的物理MB#4
F12
,而不是MB#4
因此,当您按下physical MB#4时,游戏将接收
F12
并激活游戏操作。
现在跳过“步骤3”,继续执行“步骤4”。
步骤3.
转到LGS中的大鼠标图片。
从physical MB#4取消分配标准命令"Back“(从下拉菜单中选择" Unassign”)。
步骤4.
转到LGS中的大鼠标图片。
将命令"Back“分配给您的物理按钮G20。
步骤5.
设置脚本
local function InterruptableSleep(ms)
local tm = GetRunningTime() + ms
while GetRunningTime() < tm do
Sleep(5)
if not IsMouseButtonPressed(4) then return true end
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 20 then
repeat
if InterruptableSleep(math.random(120, 160)) then break end
PressKey("1")
Releasekey("1")
if InterruptableSleep(90) then break end
PressMouseButton(1)
ReleaseMouseButton(1)
if InterruptableSleep(math.random(120, 160)) then break end
PressKey("2")
Releasekey("2")
|
|
眉毛粗的油条 · jQuery键盘事件详解 2 月前 |
|
|
急躁的煎鸡蛋 · XMLHttpRequest 2 周前 |
|
|
玩滑板的黄花菜 · GitHub - bumbeishvili/d3-v6-tip: A famous d3-tip lib adapted to the latest - d3.v6 version. 1 周前 |
|
|
内向的小蝌蚪 · 五秒向MySQL插入十万的数据! - 掘金 2 年前 |