Hello, I am trying to archive No Recoil in Pubg Mobile Emulator game via G Hub(Logitech App) mouse script... When I press fire button, it should keep on firing and keep my aim down. I wrote some code to aim down while firing and it works everywhere except in Pubg Mobile Emulator. In Pubg Mobile Emulator, It works in single shot but not in Auto Fire. Can anyone help me with this?

function OnEvent(event, arg)
OutputLogMessage("event = %s, arg = %d\n", event, arg)
if (event == "PROFILE_ACTIVATED") then
EnablePrimaryMouseButtonEvents(true)
elseif event == "PROFILE_DEACTIVATED" then
ReleaseMouseButton(2) -- to prevent it from being stuck on
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 4) then
recoil = not recoil
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoil) then
if recoil then
repeat
--Sleep(10)
Sleep(10)
MoveMouseRelative(0, 5)
until not IsMouseButtonPressed(1)
end
end
end