Titan 2 - Logitech Mouse/Keyboard scripting (AntiRecoil)
Posted: Tue Nov 20, 2018 12:39 pm
Hey All,
I was using XIM4 for years together with T1/T2 but latest XIM Apex made me to stay just with T2 for Mouse/Keyboard gameplay.
I was using T2 scripting with XIM4 for all games but with direct T2 M/KB capture I left most of the T2 scripting and I tried Logitech LUA scripting on my mouse.
I'll add brief guide how to add scripting to your Logitech device (let it be headset or mouse). Simply rightclick on your logitech profile and click on Scripting. Paste code bellow and play with it to fit your play style/weapons.
As I rly like our Titan community, there is my script which I use for Battlefield series.
It offers two stages configurable Anti-Recoil (standard is with scroll-lock and for bipod u have to have scroll-lock on and also caps-lock on). Adjust can be done via holding left alt and pressing 4th / 5th mouse button (side buttons).
I feel this as the best way how to deal with scripting right now as it is just in the input device driver and T2 offers awesome speed in direct capture communication.
You can adjust dynamic Anti-recoil by usiong wmulti1 parameter. It will dynamicaly inrease/decrease antirecoil strength which is rly usefull for Battlefield LMGs.
Let me know if you need any advice or customization.
I was using XIM4 for years together with T1/T2 but latest XIM Apex made me to stay just with T2 for Mouse/Keyboard gameplay.
I was using T2 scripting with XIM4 for all games but with direct T2 M/KB capture I left most of the T2 scripting and I tried Logitech LUA scripting on my mouse.
I'll add brief guide how to add scripting to your Logitech device (let it be headset or mouse). Simply rightclick on your logitech profile and click on Scripting. Paste code bellow and play with it to fit your play style/weapons.
As I rly like our Titan community, there is my script which I use for Battlefield series.
It offers two stages configurable Anti-Recoil (standard is with scroll-lock and for bipod u have to have scroll-lock on and also caps-lock on). Adjust can be done via holding left alt and pressing 4th / 5th mouse button (side buttons).
I feel this as the best way how to deal with scripting right now as it is just in the input device driver and T2 offers awesome speed in direct capture communication.
You can adjust dynamic Anti-recoil by usiong wmulti1 parameter. It will dynamicaly inrease/decrease antirecoil strength which is rly usefull for Battlefield LMGs.
Let me know if you need any advice or customization.
- Code: Select all
EnablePrimaryMouseButtonEvents (true)
local step = 12.0
local wait = 32.0
local wmulti1 = 1
local wait1
local step1
function OnEvent(event, arg)
if IsKeyLockOn("scrolllock")and not IsModifierPressed('lshift') then
if not IsKeyLockOn("capslock")then
if IsMouseButtonPressed(1) then
wait1 = wait
OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait1)
repeat
MoveMouseRelative(0,step)
--wait1 = wait1 * (wmulti1 + rng3) * (wmulti2 +rng3)
wait1 = wait1 * (wmulti1)
Sleep(wait1)
--OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait1)
until not IsMouseButtonPressed(1)
end
if IsMouseButtonPressed(3) then
repeat
if IsMouseButtonPressed(1) then
wait1 = wait
OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait1)
repeat
MoveMouseRelative(0,step)
--wait1 = wait1 * (wmulti1 + rng3) * (wmulti2 +rng3)
wait1 = wait1 * (wmulti1)
Sleep(wait1)
--OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait1)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
if IsKeyLockOn("capslock")then
if IsMouseButtonPressed(1) then
-- wait1 = wait
wait1 = 5*wait
step1 = step
OutputLogMessage("event = %s, arg = %d, step = %s\n", event, arg, step)
repeat
MoveMouseRelative(0,step1)
--wait1 = wait1 * (wmulti1 + rng3) * (wmulti2 +rng3)
wait1 = wait1 * (wmulti1)
Sleep(wait1)
OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait)
until not IsMouseButtonPressed(1)
end
if IsMouseButtonPressed(3) then
repeat
if IsMouseButtonPressed(1) then
wait1 = 5*wait
step1 = step
-- step1 = step/6
OutputLogMessage("event = %s, arg = %d, step = %s\n", event, arg, step)
repeat
MoveMouseRelative(0,step1)
--wait1 = wait1 * (wmulti1 + rng3) * (wmulti2 +rng3)
wait1 = wait1 * (wmulti1)
Sleep(wait1)
OutputLogMessage("step1 = %s, wait1 = %s\n", step, wait1)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
end
if IsModifierPressed('lalt')then
if IsMouseButtonPressed(5) then
step = step - 1
OutputLogMessage("event = %s, arg = %d, step = %s\n", event, arg, step)
end
if IsMouseButtonPressed(4) then
step = step + 1
OutputLogMessage("event = %s, arg = %d, step = %s\n", event, arg, step)
end
end
end