Pour un début t'es pas parti sur quelque chose de simple
Voilà ce que je comprend
au départ on veut que le script ne soit pas lancé plus de 3 fois :
MaxThreadsPerHotkey 3ensuite on définit une hotkey ( WinZ)
#z:: ; Win+Z hotkey (change this hotkey to suit your preferences).ce qui vient après sera exécuté après l'appui sur WinZ
KeepWinZRunning contrôle si la boucle est active ou arrêtée :
active : KeepWinZRunning = true
arrêtée: KeepWinZRunning =false
il ne faut pas lancer la boucle plusieurs fois ,donc si elle est déjà active on la stoppe :
if KeepWinZRunning ; This means an underlying thread is already running the loop below.
{
KeepWinZRunning := 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.sinon on l'autorise :
KeepWinZRunning := trueaprès vient la boucle en elle même qui affiche le message:
"Press Win-Z again to stop this from flashing." clignotant
elle sera stopée par:
if not KeepWinZRunning ; The user signaled the loop to stop by pressing Win-Z again.
break ; Break out of this loop.la dernière ligne est un "reset" pour préparer a un nouvel appui sur CtrlW
KeepWinZRunning := false ; Reset in preparation for the next press of this hotkey.
return
en fait ce script réalise un "toggle" avec CtrlWin
un appui lance la boucle
un autre appui la stoppe ect..ect..
attention il y a une autre version de autohotkey : autohotkey -L qui semble avoir plus de possibilité
si tu chope un script écrit avec,il sera peut-être pas compatible avec la version de base.
dans ton script il y a une erreur ( un "o" en trop )
Dragty a écrit:Pour la boucle, je me suis décidé a fair eun tour chez les anglais et j'ai réussi a faire ca:
#MaxThreadsPerHotkey 3
^q:: ;
#MaxThreadsPerHotkey 1
if KeepCtrlQRunning ;
{
KeepCtrolQRunning := false ;
return ;
}
; Otherwise:
KeepCtrlQRunning := true
Loop
{
;
Send, {Z Down}
;
if not KeepCtrlQRunning ; .
break ;
}
KeepCtrlQRunning := false ;
return
Le probleme c'est que la boucle se lance bien mais ne s'arette pas :/
Quand au inputbox, je vais tester ca, merci de tes réponses :)
Si tu disais ce que tu veux faire précisément, ce serait surement plus facile de t'aider a construire un script
A+
Alain