Créer script association de touche qui se repete Topic is solved

Poser vos questions de programmation en AutoHotkey
Lilian

Créer script association de touche qui se repete

10 Apr 2020, 05:43

Bonjour,
Je cherches à créer un script mais je galère :/
Je voudrais faire:

Code: Select all

F5
Attente 1s
ENTER
Attente 1s
Flèche du haut 3 fois (attentes 1s entre chaque)
Attente 1s
Flèche de gauche
Attente 1s
ENTER
Attente 1s
Flèche du haut
Attente 1s
ENTER
Attente 30s et répéter ce script (jusqu’à ce que je l’arrête)
Pensez vous que c’est faisable? L’associer à une touche lambda.
Merci de votre retour.
Last edited by joedf on 10 Apr 2020, 11:45, edited 1 time in total.
Reason: fix bbcode
User avatar
joedf
Posts: 8994
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Créer script association de touche qui se repete  Topic is solved

10 Apr 2020, 11:48

qqch comme ca?

Code: Select all

Loop
{
	Send {F5}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Loop 3
	{
		Send {Up}
		Sleep 1000
	}
	Sleep 1000
	Send {Left}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Send {Up}
	Sleep 1000
	Send {Enter}
	Sleep 30000
}
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Lilian

Re: Créer script association de touche qui se repete

11 Apr 2020, 04:57

Oui exactement, je vais l’essayer c’est pour un jeu vidéo. Merci de ton aide, car moi cela ne fonctionnais pas. Je te tiens au courant!
Lilian

Re: Créer script association de touche qui se repete

11 Apr 2020, 05:04

Bonjour,
en effet ton script me semble bien, je voulais ajouter une touche pour le alncer et une pour l'arreter, pense-tu que c'est bon si je fais:

Code: Select all

F12::
ExitApp
return

F11::
Loop
{
	Send {F5}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Loop 3
	{
		Send {Up}
		Sleep 1000
	}
	Sleep 1000
	Send {Left}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Send {Up}
	Sleep 1000
	Send {Enter}
	Sleep 30000
}
[Mod edit: [code][/code] tags added]
User avatar
joedf
Posts: 8994
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Créer script association de touche qui se repete

11 Apr 2020, 17:22

Tu peux faire qqch comme ca :+1:

Code: Select all

#MaxThreadsPerHotkey 2
F12::Reload

$F11::
active:=!active
while (active){
	Send {F5}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Loop 3
	{
		Send {Up}
		Sleep 1000
	}
	Sleep 1000
	Send {Left}
	Sleep 1000
	Send {Enter}
	Sleep 1000
	Send {Up}
	Sleep 1000
	Send {Enter}
	Sleep 30000
}
return
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Lilian

Re: Créer script association de touche qui se repete

16 Apr 2020, 05:31

Merci pour ton script mais il ne fonctionne pas dans mon jeu c’est étrange, peut être un blocage, une idée?
J’ai essayé en mode admin pour lancer le script mais c’est idem :/
User avatar
joedf
Posts: 8994
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Créer script association de touche qui se repete

16 Apr 2020, 13:08

Hmmm, pt essaye de remplacer tous les Send par SendInput ou SendPlay? :think: :geek:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

Return to “J'ai besoin d'aide”

Who is online

Users browsing this forum: No registered users and 10 guests