on-internet
← Community

Lua Script : adding a repeating code for a mouse movement

Stack Overflow ·

I'm currently looking over some Lua coding for a Logitech keyboard. I can get the code to work on a single push, I have placed a repeat and sleep timer and was hoping for this to continue to loop until I pushed the mouse button which is not woring. This is what I have so far: function OnEvent(event, arg) if event == "G_PRESSED" and arg == 1 then PressMouseButton(3) repeat MoveMouseRelative(-20,0) Sleep(50) until not PressMouseButton(1) end end Please note this is my first time looking over this type of coding as any help is greatly appreciated.

Comments

Sign in or sign up to comment and upvote.

No comments yet.