Im brand new at scripting and have no idea what im doing. Found the below code online and want it to make adjustments. So basically, in fallout 4 lets say a gun's recoil goes to up and to the left originally, but then halfway into shooting it goes to the right. I want the script to initially be able to pull the mouse down and to the right, and then (when the guns recoil starts to go in the other direction) go to the left. Is this possible?
EnablePrimaryMouseButtonEvents (true);
function OnEvent(event,arg)
if IsKeyLockOn("numlock")then
if IsMouseButtonPressed(3)then
repeat
if IsMouseButtonPressed(1) then
repeat
MoveMouseRelative(-1,13)
Sleep(75)
until not IsMouseButtonPressed(1)
end
until not IsMouseButtonPressed(3)
end
end
end
Above is a script I use to move my mouse down when pressing the shooting buttons in Fallout 4 because I have problems which prevent me from countering recoil.
I want the script to not only move down and slightly to the left (MoveMouseRelative(-1,13)) but I want to be able to specify that after a certain amount of time, I then want the script to move in a different direction that again, I can specify.
How would I do this? I believe this is a LUA script or something, and im using a logitech mouse
UPDATE:
Step 0.
You are about to modify the behavior of Left Mouse Button.
This is a potentially dangerous operation: you can do almost nothing on your computer without LMB.
So you must create a "spare LMB".
For example, if you don't use Mouse Button 8, you can make it acting like a clone on LMB.
Go to the big mouse picture in LGS and assign command "Left Click" to your physical MB#8.
Now, if something goes wrong and your LMB stops working, you can press MB#8 instead of LMB.
Step 1.
Do you use Mouse Button 4 ("Back") in the game?
Step 2.
You have to remap game action from MB#4 to some other key.
Do the following:
(let's assume the
F12
key is not currently used)F12
to your physical MB#4F12
instead of MB#4As a result, when you press physical MB#4, the game receives
F12
and activates the game action.Now skip "Step 3" and proceed to "Step 4".
Step 3.
Go to the big mouse picture in LGS.
Unassign standard command "Back" from physical MB#4 (select "Unassign" from the drop-down menu).
Step 4.
Set the script (see below).
Step 5.
Go to the big mouse picture in LGS.
Assign command "Back" to your physical LMB.
You will see a warning about a potentially dangerous operation.
Allow this operation because you have the "spare LMB" if something goes wrong.