Hi guys,
I have a script that looks like this:
function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2)
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 9) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
MoveMouseRelative(0, 2)
Sleep(10)
until not IsMouseButtonPressed(1)
end
end
end
I need to make "MoveMouseRelative(0, 2)" to increase in value over time..
Let's say it starts with (0, 0), then after a second its (0, 1), after 2 seconds it's (0, 2) etc etc,
Any and all help greatly appreciated Thanks.
if it should happen by a limited amount, use a for loop, in that for loop use a timer.Simple
that runs each second, and increases the variable by whatever amount you want.
Also not sure if its because of the forums formation, but did you doe the script by having evrything in the left of every line without any spaces??
Hey man, this is a script for a Logitech G502 mouse, I just copied the code out as it was
Could you help me edit the code with loop / timer.Simple?
I'm a beginner at coding
that literally makes no sense. the code works with every mouse..
oh god. pls use some spaces/tabs to highlight functions etc..this code is awful to read
if you cant even add for loops and a function yourself, you should go watch some lua basic tutorials
How often the event executes?
Sorry, you need to Log In to post a reply to this thread.