Logitech Lua no recoil script

MxX

New Member
2 Apr 2019
4
0
Sharing my Personal no recoil script.
Works universal on any game and any weapon because you can modify the strength of the recoil reduction on the fly.
By default, you have to press monowheel left/right to change strength.
Enjoy.

Code:
-- Universal_Simplified for Logitech GHUB
-- only testet on G604

-- some times you have to close GHUB through Taskmanager and launch it as admin, not my fault

-- main feature :
-- with mousewheel right you can increase NoRecoil strength, with mouse wheel left you can reduce strength
-- change UP,DOWN if you mouse does not support this
-- so you can use it in any game and with any weapon
-- for use in games like PUBG,RainbowSix,SuperPeople...
-- 2+ Years no ban

-- to keep track of you strength values use
-- the console in LGHUB, 2nd screen required looks like this :
-- https://imgur.com/qoiMpRi
-- or https://docs.microsoft.com/en-us/sysinternals/downloads/debugview and filter for *NR*, can be used as overlay
-- https://imgur.com/3P2GbW2

--Settings--
--General--
UP = 13                     -- to increase NoRecoil strength, toggle Modify to change RapidFire strenght
DOWN = 12                   -- to reduce NoRecoil strength, toggle Modify to change RapidFire strenght
--NoRecoil
NR = 4                        -- distance to pull down, (default) recoil reduction
HorizontalRecoilModifier=0    -- unused, is for left right recoil     
Sleep_ = 10                    -- delay between pull down, less for smoother
--BINDS--   
--General--                 
UP = 13                     -- to increase NoRecoil strength, + Modify to increase RapidFireNoRecoil
DOWN = 12                   -- to reduce     
--NoRecoil                                     
RC = 3                        -- right click, when you press RC and LC it pulls down
LC = 1                        -- Left click, key boud to shoot ingame

--FUNCTIONS--                       
EnablePrimaryMouseButtonEvents(true);   -- to capture primary (1) klick
OutputDebugMessage("Profil Aktiv")
function NoRecoil()
    repeat
    MoveMouseRelative(0,NR)
    Sleep(Sleep_)
until not IsMouseButtonPressed(LC)
end
--NoRecoilModify
function Add()
    NR=NR+1     
    if (NR>10) then
        NR=0
    end         
    OutputLogMessage("NR %d\n", NR)
    OutputDebugMessage("NR %d\n", NR)
end
function Reduce()
    NR=NR-1     
    if (NR<0) then
        NR=10
    end
    OutputLogMessage("NR %d\n", NR)
    OutputDebugMessage("NR %d\n", NR)
end
--increaseAndReduce
function OnEvent(event, arg)   

    if (event == "MOUSE_BUTTON_PRESSED" and arg == UP) then
        Add()
    end
    if (event == "MOUSE_BUTTON_PRESSED" and arg == DOWN) then
        Reduce()
    end
    if IsMouseButtonPressed(RC)then                               
        repeat
            if IsMouseButtonPressed(LC)  then
                NoRecoil()
            end
        until not IsMouseButtonPressed(RC)
    end
end