Results 1 to 2 of 2
  1. #1
    UntoldMystery's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Australia
    Posts
    16
    Reputation
    10
    Thanks
    0

    Can I combine these 2 logitech lua scripts?

    Hey everyone,
    I have designed 2 anti recoil scripts for my G900 which are activated/deactivated by 2 different buttons and was wondering could I combine them? I have implemented the use of G-Max as well to play a sound when they are turned on and off, but cannot figure out how to put the 2 codes together. I tried a simple cut and paste, one into another but that did not work. I am guessing some sort of statement is needed to join the 2? Any help would be greatly appreciated. If it cannot be done and I need to keep it separate, please do let me know.

    Script 1
    Code:
    EnablePrimaryMouseButtonEvents(true)
    local recoil = not true;
    OutputLogMessage("PROFILE LOADED ")
     
    function OnEvent(event, arg)
     
        if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
            mb1_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
            mb1_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
            mb2_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
            mb2_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 and recoil then
            recoil = not true
                OutputLogMessage("NR-OFF ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 then
            recoil = not recoil
                OutputLogMessage("NR-ON ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/M4A1.wav" )]])
     
        end
           
    --
     
        if mb1_pressed and recoil then
        repeat
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
                    if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(3,31)
                    if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-11,32)
                if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(13,42)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-17,47)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-9,53)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(32,31)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(21,25)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(43,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-8,22)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-35,12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-60,-9)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-48,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-52,-12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,8)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(18,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-22,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-30,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(6,4)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(69,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(20,13)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(53,5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(18,4)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(23,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-22,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(11,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(8,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(6,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(9,-2)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
        until not IsMouseButtonPressed(1)
     
    --
     
           
    --
     
        end
    end
    Script 2

    Code:
    EnablePrimaryMouseButtonEvents(true)
    local recoil = not true;
    OutputLogMessage("PROFILE LOADED ")
     
    function OnEvent(event, arg)
     
        if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
            mb1_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
            mb1_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
            mb2_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
            mb2_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 and recoil then
            recoil = not true
                OutputLogMessage("NR-OFF ")
            OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 then
            recoil = not recoil
                OutputLogMessage("NR-ON ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/AK47.wav" )]])
        end
           
    --
     
        if mb1_pressed and recoil then
        repeat
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(7,51)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-5,58)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-2,61)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(25,65)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(16,55)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(26,39)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-33,29)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-84,-8)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-44,5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(26,22)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-31,12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-52,-17)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-6,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(80,3)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(38,14)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(28,21)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(54,-3)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(66,-18)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-41,-5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(12,6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-12,19)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-18,7)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(38,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(13,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-42,-1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-65,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-91,-42)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-28,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            MoveMouseRelative(0,-1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
        until not IsMouseButtonPressed(1)
     
    --
     
       
    --
     
        end
    end
    Last edited by UntoldMystery; 08-02-2016 at 06:02 PM.

  2. #2
    Danielle123's Avatar
    Join Date
    Jun 2016
    Gender
    male
    Posts
    4
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by UntoldMystery View Post
    Hey everyone,
    I have designed 2 anti recoil scripts for my G900 which are activated/deactivated by 2 different buttons and was wondering could I combine them? I have implemented the use of G-Max as well to play a sound when they are turned on and off, but cannot figure out how to put the 2 codes together. I tried a simple cut and paste, one into another but that did not work. I am guessing some sort of statement is needed to join the 2? Any help would be greatly appreciated. If it cannot be done and I need to keep it separate, please do let me know.

    Script 1
    Code:
    EnablePrimaryMouseButtonEvents(true)
    local recoil = not true;
    OutputLogMessage("PROFILE LOADED ")
     
    function OnEvent(event, arg)
     
        if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
            mb1_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
            mb1_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
            mb2_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
            mb2_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 and recoil then
            recoil = not true
                OutputLogMessage("NR-OFF ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 6 then
            recoil = not recoil
                OutputLogMessage("NR-ON ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/M4A1.wav" )]])
     
        end
           
    --
     
        if mb1_pressed and recoil then
        repeat
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
                    if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(3,31)
                    if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-11,32)
                if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(13,42)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-17,47)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-9,53)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(32,31)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(21,25)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(43,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-8,22)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-35,12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-60,-9)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-48,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-52,-12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,8)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(18,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-22,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-30,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(6,4)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(69,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(20,13)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(53,5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(18,4)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(23,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(-22,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(11,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(8,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(6,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(9,-2)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            MoveMouseRelative(0,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(44)
            ReleaseKey("M")
            Sleep(44)
            if not IsMouseButtonPressed(1) then break end
        until not IsMouseButtonPressed(1)
     
    --
     
           
    --
     
        end
    end
    Script 2

    Code:
    EnablePrimaryMouseButtonEvents(true)
    local recoil = not true;
    OutputLogMessage("PROFILE LOADED ")
     
    function OnEvent(event, arg)
     
        if event == "MOUSE_BUTTON_PRESSED" and arg == 1 then
            mb1_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 1 then
            mb1_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 2 then
            mb2_pressed = true
        elseif event == "MOUSE_BUTTON_RELEASED" and arg == 2 then
            mb2_pressed = false
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 and recoil then
            recoil = not true
                OutputLogMessage("NR-OFF ")
            OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/Shell.wav" )]])
        elseif event == "MOUSE_BUTTON_PRESSED" and arg == 7 then
            recoil = not recoil
                OutputLogMessage("NR-ON ")
        OutputDebugMessage([[EXE.]] .. [[SoundPlay ( "C:/Scripts/AK47.wav" )]])
        end
           
    --
     
        if mb1_pressed and recoil then
        repeat
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(7,51)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-5,58)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-2,61)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(25,65)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(16,55)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(26,39)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-33,29)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-84,-8)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-44,5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(26,22)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-31,12)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-52,-17)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-6,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(80,3)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(38,14)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(28,21)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(54,-3)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(66,-18)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-41,-5)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(12,6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-12,19)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-18,7)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(38,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(13,10)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-42,-1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-65,-6)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-91,-42)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(-28,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,0)
            MoveMouseRelative(0,-1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            MoveMouseRelative(0,1)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
            PressKey("M")
            Sleep(49)
            ReleaseKey("M")
            Sleep(49)
            if not IsMouseButtonPressed(1) then break end
        until not IsMouseButtonPressed(1)
     
    --
     
       
    --
     
        end
    end
    Hi,

    I am also using the G900 and was just wondering if you know if it's possible to create a macro (logitech mouse software) to do autofire? I saw that's possible for some other models....but is it also working for G900? I just want to get it work when pressing mouse1 (left mouse button).

    Did you know that there are already excellent norecoil ahk scripts that work fine with the G900? I use the version of Pean and it is really great. You can adjust for each different weapon. Or is there a reason that you make it especially for G900?

    looking forward to see your feedback

    Greetings,

    D

Similar Threads

  1. [Source Code] Logitech LUA recoil reduce Script! for every Game!
    By lumpi999 in forum Battlefield 4 Hacks & Cheats
    Replies: 2
    Last Post: 02-28-2016, 11:23 PM
  2. [Help Request] Can anyone give me a Show spectators spectating you lua script?
    By lolman59 in forum Garry's Mod Discussions & Help
    Replies: 8
    Last Post: 11-07-2014, 09:03 AM
  3. Can't seem to use lua scripts
    By rburnsie94 in forum Garry's Mod Discussions & Help
    Replies: 4
    Last Post: 08-02-2013, 11:11 PM
  4. [Help Request] RE:Can i have these Scripts Please?
    By Heytherenewb in forum DayZ Help & Requests
    Replies: 10
    Last Post: 02-23-2013, 06:12 PM
  5. [Help Request] Can i have these Scripts Please?
    By Heytherenewb in forum DayZ Help & Requests
    Replies: 4
    Last Post: 02-22-2013, 05:46 AM