mvpdez How do I cheat? Reputation: 0
Joined: 27 May 2017 Posts: 1
|
Posted: Sat May 27, 2017 9:07 pm Post subject: How to deactivate button when another button activate? |
|
|
Can some one help me with this?
I want to make it when mb4 is activated, press mb5 to activate mb5 and deactivate mb4.
Right now with this code when mb4 is activated while press mb5 and mb9, all three mouse button function are still enable.
Code: | 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
recoildot = not recoildot
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoildot) then
if recoildot then
repeat
--Sleep(9)
Sleep(9)
MoveMouseRelative(0, 2)
until not IsMouseButtonPressed(1)
end
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 5) then
recoilx4 = not recoilx4
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoilx4) then
if recoilx4 then
repeat
--Sleep(5)
Sleep(9)
MoveMouseRelative(0, 5)
until not IsMouseButtonPressed(1)
end
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 9) then
recoilx9 = not recoilx9
spot = not spot
end
if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and recoilx9) then
if recoilx9 then
repeat
--Sleep(9)
Sleep(9)
MoveMouseRelative(0, 7)
until not IsMouseButtonPressed(1)
end
end
end
|
|
|