pieujff 发表于 2021-8-10 16:37

这个宏代码在LGS里可以用,放到GHUB里就不循环了

EnablePrimaryMouseButtonEvents (true)
local click = false
local recoil = false
local step = 2.0
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
    EnablePrimaryMouseButtonEvents(true)
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 3) then
    recoil = false
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
    recoil = false
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
    if (recoil == false) then
                step = 2.0
                recoil = true
        else
                    step = step * 0.8
        end
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
        if (recoil == false) then
                step = 2.0
                recoil = true
        else
                    step = step * 1.25
        end
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil and not IsModifierPressed("lalt")) then
                click = true
                SetMKeyState(3)
end

        if (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
                click = false
        end
        if (event == "M_RELEASED" and arg == 3 and click) then
                        PressMouseButton(1)
                        Sleep(30)
                        ReleaseMouseButton(1)
                        MoveMouseRelative(0, step)

                        if click then
                        SetMKeyState(3)
                        end
        end
end
页: [1]
查看完整版本: 这个宏代码在LGS里可以用,放到GHUB里就不循环了