Sorry, that was just the code snippet, and not the entire script
For keyboards this is the entire script:
function OnEvent(event, arg)
if (event == "G_PRESSED" and arg == 1) and GetMKeyState() == 1 then
for i = 0, 99 do
MoveMouseRelative(10,0)
Sleep(10)
end
end
end
And for a mouse, use this (assigning to button 5):
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
for i = 0, 99 do
MoveMouseRelative(10,0)
Sleep(10)
end
end
end
The G keys on the mouse are targeted like this, and not with the G_PRESSED syntax.