I made this script with LUA in GHUB:
function OnEvent(event, arg)
if IsMouseButtonPressed(5) then
PressKey("r")
Sleep(math.random(30, 100))
ReleaseKey("r")
Sleep(math.random(30, 100))
end
end
But I don't want mouse button 5 to be detected. In fact, if I try to press it, it will record the pressure of key 5 and then it starts the script. Is there a way to press the key without it being detected?
You can open this image to understand better
I thought that to do this I could create a macro instead of a script but I need a random delay. How can I solve?
I'm not sure I have understood you correctly, but this is the obvious steps:
event
and arg
in the script instead of IsMouseButtonPressed
:function OnEvent(event, arg)
if event == "MOUSE_BUTTON_PRESSED" and arg == 5 then
PressKey("r")
Sleep(math.random(30, 100))
ReleaseKey("r")
end
end