This is my first attempt at LUA so bear with me!
I'm trying to combine a couple of functions that I want to loop at the same time, but I can only get them to run sequentially. Ideally, the function bound to mouse button 6 would start on press and stop on release (currently it doesn't stop at all!!). Separately the function on mouse button 3 would run when it is pressed and stop on release (this one does stop).
At the moment the button 3 loop works as it should, but the button 6 loop doesn't end.
Ideally, I would like both to work and stop on their respective button press and release, AND for them to BOTH run at the same time when both 3 & 6 are pressed at together.
Can this be done and if so what do I need to change to achieve this?
EnablePrimaryMouseButtonEvents(true);
function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 6 then
repeat
MoveMouseRelative(300,0)
Sleep(150)
MoveMouseRelative(-300,0)
Sleep(1500)
until event == "MOUSE_BUTTON_RELEASED" and arg == 6
elseif IsMouseButtonPressed(3) then
repeat
MoveMouseRelative(0,300)
Sleep(1000)
until not IsMouseButtonPressed(3)
end
end
Thanks in advance :D