将2个Lua Logitech脚本合并为1

问题描述 投票:0回答:1

有人可以帮我将这两个脚本合而为一吗?我尝试过,但是无法正常工作。我不是很擅长我想在Logitech脚本上使用它们来玩游戏,我想让它们一起工作。

function OnEvent(event, arg)
    while (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed(fast_loot_key) and fastloot) do
        Sleep(10)
        PressMouseButton(1)
        Sleep(10)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        Sleep(2)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        Sleep(2)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        Sleep(2)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        Sleep(2)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        MoveMouseRelative(move, 0)
        Sleep(10)
        ReleaseMouseButton(1)
        Sleep(10)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        Sleep(2)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        Sleep(2)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        Sleep(2)
        MoveMouseRelative(-move, 0)
        Sleep(2)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        MoveMouseRelative(-move, 0)
        Sleep(10)            
        if not IsModifierPressed(fast_loot_key) then
            break
        end
    end
end 
function OnEvent(event, arg)
    if IsKeyLockOn("numlock" )then
        if IsMouseButtonPressed(1) then
            repeat
                MoveMouseRelative(0,1)
                Sleep(1)
            until not IsMouseButtonPressed(1)
        end             
    end
end
lua logitech logitech-gaming-software
1个回答
0
投票
function OnEvent(event, arg)
   if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
      if IsModifierPressed(fast_loot_key) and fastloot then
         repeat
            Sleep(10)
            PressMouseButton(1)
            Sleep(10)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            Sleep(2)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            Sleep(2)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            Sleep(2)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            Sleep(2)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            MoveMouseRelative(move, 0)
            Sleep(10)
            ReleaseMouseButton(1)
            Sleep(10)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            Sleep(2)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            Sleep(2)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            Sleep(2)
            MoveMouseRelative(-move, 0)
            Sleep(2)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            MoveMouseRelative(-move, 0)
            Sleep(10)         
         until not IsModifierPressed(fast_loot_key)
      elseif IsKeyLockOn("numlock") then
         repeat
            MoveMouseRelative(0, 1)
            Sleep(1)
         until not IsMouseButtonPressed(1)
      end
   end
end
© www.soinside.com 2019 - 2024. All rights reserved.