i have been learning lua to code an auto clicker for my g903 that works when the right mouse button is held and can be toggled with the capslock key. any help or insight would be appreciated
EnablePrimaryMouseButtonEvents(true);
function OnEvent(event,arg)=true
if IsKeyLockOn("capslock"=true then
if IsMouseButtonPressed(3)=true then
repeat
if IsMouseButtonPressed(1)=true then
repeat
PressAndReleaseMouseButton(1)
Sleep(math.random(20,80))
until IsMouseButtonPressed(1)=false
end
until IsMouseButtonPressed(3)=false
end
end
end