PostRecoil for G logitech mouse

Posts 115 of 46 · Page 1 of 4
Recoil for G logitech mouse
i just wanted to shared this for all logitech gaming mouse user.

code:
local current_weapon = "none"

--------------------------------------------------------------------------
---------------- Basic Setting ------------------------------
--------------------------------------------------------------------------

---- key bind ----

local ump9_key = 8
local akm_key = nil
local m16a4_key = 5
local m416_key = 7
local scarl_key = nil
local uzi_key = nil

local set_off_key = 6


---- fire key ----

local fire_key = "backspace"
local mode_switch_key = "capslock"


---- ignore key ----
---- can use "lalt", "ralt", "alt" "lshift", "rshift", "shift" "lctrl", "rctrl", "ctrl"

local ignore_key = "lshift"

--- Sensitivity in Game
--- default is 50.0

local target_sensitivity = 50
local scope_sensitivity = 50
local scope4x_sensitivity = 50

---- Obfs setting
---- Two firing time intervals = weapon_speed * interval_ratio * ( 1 + random_seed * ( 0 ~ 1))
local weapon_speed_mode = true
local obfs_mode = true
local interval_ratio = 0.75
local random_seed = 1

--------------------------------------------------------------------------
---------------- Recoil Table ------------------------------
---------------- You can fix the value here ------------------------------
--------------------------------------------------------------------------

local recoil_table = {}

recoil_table["ump9"] = {
basic={18.3,18.3,18.3,18.3,18.3,18.3,18.3,23,23,23 ,23,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3},
quadruple={83.3,83.3,83.3,83.3,83.3,83.3,83.3,116. 7,116.7,116.7,116.7,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3},
speed = 92
}

recoil_table["akm"] = {
basic={23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23. 7,23.7,23.7,28,28,28,28,29.7,29.7,29.7,29.7,29.7,2 9.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,2 9.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7},
quadruple={66.7,66.7,66.7,66.7,66.7,66.7,66.7,66.7 ,66.7,66.7,66.7,123.3,123.3,123.3,123.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3},
speed = 100
}

recoil_table["m16a4"] = {
basic={25.7,25.7,25.7,25.7,25.7,25.7,46.7,46.7,46. 7,46.7,30,30,30,30,30,30,30,30,30,30,30,30,30,30,3 0,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 75
}

recoil_table["m416"] = {
basic={26.7,26.7,26.7,26.7,26.7,26.7,37,37,37,37,3 7,31,31,31,31,31,32,32,32,35,35,35,35,35,35,35,35, 35,35,35,35,35,35,35,35,35,35,35,35,35},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 86
}

recoil_table["scarl"] = {
basic={22.3,22.3,22.3,22.3,22.3,22.3,22.3,29.3,29. 3,29.3,29.3,26.7,26.7,26.7,26.7,26.7,26.7,26,26,26 ,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,2 6,26,26,26},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 96
}

recoil_table["uzi"] = {
basic={18.3,18.3,18.3,18.3,18.3,18.3,18.3,23,23,23 ,23,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3},
quadruple={13.3,13.3,13.3,13.3,13.3,21.7,21.7,21.7 ,21.7,21.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7},
speed = 48
}

recoil_table["none"] = {
basic={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
quadruple={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
speed = 60
}


--------------------------------------------------------------------------
---------------- Function ------------------------------
--------------------------------------------------------------------------


function convert_sens(unconvertedSens)
return 0.002 * math.pow(10, unconvertedSens / 50)
end

function calc_sens_scale(sensitivity)
return convert_sens(sensitivity)/convert_sens(50)
end

local target_scale = calc_sens_scale(target_sensitivity)
local scope_scale = calc_sens_scale(scope_sensitivity)
local scope4x_scale = calc_sens_scale(scope4x_sensitivity)

function recoil_mode()
if IsKeyLockOn(mode_switch_key) then
return "quadruple";
else
return "basic";
end
end


function recoil_value(_weapon,_duration)
local _mode = recoil_mode()
local step = (math.floor(_duration/100)) + 1
if step > 40 then
step = 40
end
local weapon_recoil = recoil_table[_weapon][_mode][step]
-- OutputLogMessage("weapon_recoil = %s\n", weapon_recoil)

local weapon_speed = 30
if weapon_speed_mode then
weapon_speed = recoil_table[_weapon]["speed"]
end
-- OutputLogMessage("weapon_speed = %s\n", weapon_speed)

local weapon_intervals = weapon_speed
if obfs_mode then

local coefficient = interval_ratio * ( 1 + random_seed * math.random())
weapon_intervals = math.floor(coefficient * weapon_speed)
end
-- OutputLogMessage("weapon_intervals = %s\n", weapon_intervals)

recoil_recovery = weapon_recoil * weapon_intervals / 100

-- issues/3
if IsMouseButtonPressed(2) then
recoil_recovery = recoil_recovery / target_scale
elseif recoil_mode() == "basic" then
recoil_recovery = recoil_recovery / scope_scale
elseif recoil_mode() == "quadruple" then
recoil_recovery= recoil_recovery / scope4x_scale
end

return weapon_intervals,recoil_recovery
end


--------------------------------------------------------------------------
---------------- OnEvent ------------------------------
--------------------------------------------------------------------------


function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
current_weapon = "none"
shoot_duration = 0.0
ReleaseKey(fire_key)
ReleaseMouseButton(1)
end

if (event == "MOUSE_BUTTON_PRESSED" and arg == set_off_key) then
current_weapon = "none"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == akm_key) then
current_weapon = "akm"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m16a4_key) then
current_weapon = "m16a4"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == m416_key) then
current_weapon = "m416"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == ump9_key) then
current_weapon = "ump9"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == uzi_key) then
current_weapon = "uzi"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == scarl_key) then
current_weapon = "scarl"
elseif (event == "MOUSE_BUTTON_PRESSED" and arg == 1) then
-- button 1 : Shoot
if ((current_weapon == "none") or IsModifierPressed(ignore_key)) then
PressKey(fire_key)
repeat
Sleep(30)
until not IsMouseButtonPressed(1)
ReleaseKey(fire_key)
else
local shoot_duration = 0.0
repeat
local intervals,recovery = recoil_value(current_weapon,shoot_duration)
PressAndReleaseKey(fire_key)
MoveMouseRelative(0, recovery )
Sleep(intervals)
shoot_duration = shoot_duration + intervals
until not IsMouseButtonPressed(1)
end
elseif (event == "MOUSE_BUTTON_RELEASED" and arg == 1) then
ReleaseKey(fire_key)
end

end
Doesnt work :/

I just imported it to my PUBG profile and added it as a script but cant use it.

Can you fix your scrip code and write a tutorial how to use it and describe your keybinds you used?

I would really appreciate that ! Thanks so far for your work.

Greetings
updated
the button number can be find in log windows, when the mouse button click, log prompt event = MOUSE_BUTTON_RELEASED, arg = X, the X is the button number.
Weapon has 6 kinds, and different models of Logitech mouse function keys may be less than 6, for unnecessary weapons allocation nil value.
You should always assign a button to cancel the set recoil compensation. set_off_key.

the fire key button needs to be consistent with the game settings, and in the game to cancel the left mouse button binding.
When the mode switch key is pressed, recoil zoom 3-4x , easy to use quadruple mirror.
By default , fire key is pause , mode switch key is capslock.
**All weapons use the single-shot model, which converts the individual into a fully automated mode, including M16a1.

targeting,scoping sensitivity should be 29 then scope4x should 30

In the default mode, the shooting interval varies randomly from 30ms to 39ms. You can modify several variables to change this random range.

When weapon_speed_mode = ture, the use of weapons based on the rate of random fire.

Assign a button to use ump9, so that the keys are also suitable for full accessory m416 and scar-l.
Assign a button to use m16a1, m16a1 with red dot sight or holographic sight, do not need other accessories, you can play a power.
Assign a button using akm, akm mode also applies to sks and mini 14.
Assign a button to use a big jump.
Assign a button to cancel the no-recoil.

Not working? UAC will isolate user32.dll‘s function between users and administrators. both keybd_event and SendInput function are in user32.dll. so if you run pubg as administrator , you also need to run LGS as administrator.

You may not notice that pubg in the admin, may be pubg is child process of steam.exe , and steam is child process of steam update , steam update must run as admin.
Quote Originally Posted by AGUIRRE View Post
the button number can be find in log windows, when the mouse button click, log prompt event = MOUSE_BUTTON_RELEASED, arg = X, the X is the button number.
Weapon has 6 kinds, and different models of Logitech mouse function keys may be less than 6, for unnecessary weapons allocation nil value.
You should always assign a button to cancel the set recoil compensation. set_off_key.

the fire key button needs to be consistent with the game settings, and in the game to cancel the left mouse button binding.
When the mode switch key is pressed, recoil zoom 3-4x , easy to use quadruple mirror.
By default , fire key is pause , mode switch key is capslock.
**All weapons use the single-shot model, which converts the individual into a fully automated mode, including M16a1.

targeting,scoping sensitivity should be 29 then scope4x should 30

In the default mode, the shooting interval varies randomly from 30ms to 39ms. You can modify several variables to change this random range.

When weapon_speed_mode = ture, the use of weapons based on the rate of random fire.

Assign a button to use ump9, so that the keys are also suitable for full accessory m416 and scar-l.
Assign a button to use m16a1, m16a1 with red dot sight or holographic sight, do not need other accessories, you can play a power.
Assign a button using akm, akm mode also applies to sks and mini 14.
Assign a button to use a big jump.
Assign a button to cancel the no-recoil.

Not working? UAC will isolate user32.dll‘s function between users and administrators. both keybd_event and SendInput function are in user32.dll. so if you run pubg as administrator , you also need to run LGS as administrator.

You may not notice that pubg in the admin, may be pubg is child process of steam.exe , and steam is child process of steam update , steam update must run as admin.
so basically you realase something, which istn working, no u gave an tutorial in how to fix it... Sense !? Bullshit
You posted this without Liantian's Permission and you didnt even give him the credits.
Quote Originally Posted by styxhelix3 View Post
You posted this without Liantian's Permission and you didnt even give him the credits.
thank u.

not matter to me.

this project use unlicense.

github.com/liantian-cn/logitech-pubg/blob/master/LICENSE

- - - Updated - - -

Quote Originally Posted by balashov View Post
so basically you realase something, which istn working, no u gave an tutorial in how to fix it... Sense !? Bullshit
When copying and pasting, some of the longer lines in this code are added some cr/lr/space.
so, it cant run.
not easy to fix it , because the css , and this forum does not allow outbound links.
this code was first published on GitHub,and you can find it by searching for pubg.
Working fine for me! Thank you alot!
how to use marco for mouse logitech?? are you have banned ?
Code not working (Syntax Error: Line: 51)
?? Can you fix it?
Can you give me the code of complete for AKM

- - - Updated - - -

--------------------------------------------------------------------------
---------------- Recoil Table ------------------------------
---------------- You can fix the value here ------------------------------
--------------------------------------------------------------------------

local recoil_table = {}

recoil_table["ump9"] = {
basic={18.3,18.3,18.3,18.3,18.3,18.3,18.3,23,23,23 ,23,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3},
quadruple={83.3,83.3,83.3,83.3,83.3,83.3,83.3,116. 7,116.7,116.7,116.7,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3},
speed = 92
}

recoil_table["akm"] = {
basic={23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23. 7,23.7,23.7,28,28,28,28,29.7,29.7,29.7,29.7,29.7,2 9.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,2 9.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7,29.7},
quadruple={66.7,66.7,66.7,66.7,66.7,66.7,66.7,66.7 ,66.7,66.7,66.7,123.3,123.3,123.3,123.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3,93.3, 93.3,93.3,93.3},
speed = 100
}

recoil_table["m16a4"] = {
basic={25.7,25.7,25.7,25.7,25.7,25.7,46.7,46.7,46. 7,46.7,30,30,30,30,30,30,30,30,30,30,30,30,30,30,3 0,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 75
}

recoil_table["m416"] = {
basic={26.7,26.7,26.7,26.7,26.7,26.7,37,37,37,37,3 7,31,31,31,31,31,32,32,32,35,35,35,35,35,35,35,35, 35,35,35,35,35,35,35,35,35,35,35,35,35},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 86
}

recoil_table["scarl"] = {
basic={22.3,22.3,22.3,22.3,22.3,22.3,22.3,29.3,29. 3,29.3,29.3,26.7,26.7,26.7,26.7,26.7,26.7,26,26,26 ,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,2 6,26,26,26},
quadruple={86.7,86.7,86.7,86.7,86.7,86.7,86.7,150, 150,150,150,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96.7,96. 7,96.7},
speed = 96
}

recoil_table["uzi"] = {
basic={18.3,18.3,18.3,18.3,18.3,18.3,18.3,23,23,23 ,23,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.7,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,2 3.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3,23.3},
quadruple={13.3,13.3,13.3,13.3,13.3,21.7,21.7,21.7 ,21.7,21.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7,46.7 ,46.7,46.7},
speed = 48
}

recoil_table["none"] = {
basic={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
quadruple={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
speed = 60
}


This code failed when pasting into scripting ????
Could u get banned for this?????
Quote Originally Posted by noname699 View Post
Could u get banned for this?????
Quote Originally Posted by taonemaj123 View Post
how to use marco for mouse logitech?? are you have banned ?
Hello, yes.

All macros are detectable, if you use macros that you have created yourself and that players report you too often your account will be manually checked by PUBG and you will be banned.

A week ago I was banned because of a Script No Recoil Logitech, I never used any other tool than this one.
Quote Originally Posted by Vazi963 View Post
Hello, yes.

All macros are detectable, if you use macros that you have created yourself and that players report you too often your account will be manually checked by PUBG and you will be banned.

A week ago I was banned because of a Script No Recoil Logitech, I never used any other tool than this one.
But is it detectable? Besides by other players?
Quote Originally Posted by noname699 View Post
But is it detectable? Besides by other players?
I just told you
Posts 115 of 46 · Page 1 of 4
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?