0

I'm looking to create a script that when the right mouse button is pressed and held it: Also presses and holds the right mouse button (aiming) Cycles between pressing "q" for .5 seconds(lean left), releases and waits .5 seconds and presses "e" for .5 seconds(lean right). And then loops back to leaning left in a loop until the right mouse button is released.

This is what I have so far and I'm not sure how to go about that.

RButton::
Send {RButton down}
Loop
{
    If GetKeyState("RButton")
    {
    Send {q down}
    Sleep, 500
    Send {q up}
    Sleep, 500
    Send {e down}
    Sleep, 500
    Send {e up}
    Sleep, 500
    }
Else
Break
}
KeyWait, RButton
Send {RButton up}
return

Currently it runs but it won't stop if you release the right mouse button.

Can this script be programmed to stop immediately when the RMB is released instead of going through the whole loop to check if the RMB is released?

Also is there a way to randomize (50/50 chance) of it starting with an "e" instead of a "q"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.