exemple : *when i presse Xbutton1 it sends {Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}
what i want is : 1/ while Xbutton1 or Xbutton2 or $ù is running and i press a key on keyboard it stops the loop and send the key when i Release the key it resumes the loop againe
and also 2/ sometimes when i press Xbutton1 , Xbutton2 and $ù at the same time THE ahk script bugs and wont stop , ty for help
here is my script :
Code: Select all
*ESC:: reload
;=======================================================Mono============================================================== .
#MaxThreadsPerHotkey 3
XButton2:: ; XButton2 hotkey (change this hotkey to suit your preferences).
{
if KeepXButton2Running ; This means an underlying thread is already running the loop below.
{
KeepXButton2Running := false ; Signal that thread's loop to stop.
return ; End this thread so that the one underneath will resume and see the change made by the line above.
}
; Otherwise:
KeepXButton2Running := true
Loop
{
; The next four lines are the action you want to repeat (update them to suit your preferences):
ToolTip, MONO, 830, 660
; But leave the rest below unchanged.
Sendinput {Blind}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}
Sleep, 700
if not KeepXButton2Running ; The user signaled the loop to stop by pressing XButton2 again.
break ; Break out of this loop.
}
KeepXButton2Running := false ; Reset in preparation for the next press of this hotkey.
ToolTip, stoped, 830, 660
return
}
#MaxThreadsPerHotkey 1
;=======================================================Multi============================================================== .
#MaxThreadsPerHotkey 3
XButton1:: ; XButton1 hotkey (change this hotkey to suit your preferences).
{
if KeepXButton1Running ; This means an underlying thread is already running the loop below.
{
KeepXButton1Running := false ; Signal that thread's loop to stop.
return ; End this thread so that the one underneath will resume and see the change made by the line above.
}
; Otherwise:
KeepXButton1Running := true
Loop
{
; The next four lines are the action you want to repeat (update them to suit your preferences):
ToolTip, MULTI, 1050, 660
; But leave the rest below unchanged.
Sendinput {Blind}{Numpad0}{h}{w}{p}{j}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}
Sleep, 600
if not KeepXButton1Running ; The user signaled the loop to stop by pressing XButton1 again.
break ; Break out of this loop.
}
KeepXButton1Running := false ; Reset in preparation for the next press of this hotkey.
ToolTip, stoped, 1050, 660
return
}
#MaxThreadsPerHotkey 1
;=======================================================Burst============================================================ .
#MaxThreadsPerHotkey 3
$ù:: ; $ù hotkey (change this hotkey to suit your preferences).
{
if Keep$ùRunning ; This means an underlying thread is already running the loop below.
{
Keep$ùRunning := false ; Signal that thread's loop to stop.
return ; End this thread so that the one underneath will resume and see the change made by the line above.
}
; Otherwise:
Keep$ùRunning := true
Loop
{
; The next four lines are the action you want to repeat (update them to suit your preferences):
ToolTip, BURST, 935, 660
; But leave the rest below unchanged.
Sendinput {Blind}{y}{x}{m}{k}{v}{Numpad1}{Numpad2}{Numpad3}{Numpad4}{Numpad5}{Numpad6}{Numpad7}{Numpad8}{Numpad9}
Sleep, 600
if not Keep$ùRunning ; The user signaled the loop to stop by pressing XButton1 again.
break ; Break out of this loop.
}
Keep$ùRunning := false ; Reset in preparation for the next press of this hotkey.
ToolTip, stoped, 935, 660
return
}
#MaxThreadsPerHotkey 1
tooltip,
sleep 3000