This script handles mouse button events to control mouse movement. When the right mouse button is pressed, it sets a recoil flag to false and resets the step size to 2.0. When the middle mouse button is pressed, it increases the step size by 25% each time unless recoil is true, in which case it decreases the step size by 20%. It then moves the mouse repeatedly using the step size when the left mouse button and recoil are true.
This script handles mouse button events to control mouse movement. When the right mouse button is pressed, it sets a recoil flag to false and resets the step size to 2.0. When the middle mouse button is pressed, it increases the step size by 25% each time unless recoil is true, in which case it decreases the step size by 20%. It then moves the mouse repeatedly using the step size when the left mouse button and recoil are true.
This script handles mouse button events to control mouse movement. When the right mouse button is pressed, it sets a recoil flag to false and resets the step size to 2.0. When the middle mouse button is pressed, it increases the step size by 25% each time unless recoil is true, in which case it decreases the step size by 20%. It then moves the mouse repeatedly using the step size when the left mouse button and recoil are true.
local recoil = false function OnEvent(event, arg) OutputLogMessage("event = %s, arg = %d\n", event, arg) if (event == "PROFILE_ACTIVATED") then EnablePrimaryMouseButtonEvents(true) end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 6) then
recoil = false
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
if (recoil == false) then step = 2.0 recoil = true else step = step * 1.25 end end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
if (recoil == false) then step = 2.0 recoil = true else step = step * 0.8 end end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
repeat Sleep(8) MoveMouseRelative(0, step) until not IsMouseButtonPressed(1)