I'm trying to run some macrio which allow me emulate Left MOuse Button click until Left mouse button is pressed. But i don't know how to force script to stop when I physical release Left mouse button and start sript again once LButton is pressed again. My code looks like this:
SetTimer, keyStates, 100
LeftClick:="LButton"
KeyStates: ; SubRoutine
if GetKeyState(LeftClick, "P") {
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 4, int, x, int, y, uint, 0, int, 0)
Sleep 75
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
Sleep 75
}
}
I'm complete new in this scripting language so i would be thankful for any help