Loop nur eimal auführen trotz gedrücktem hotkey

Stelle Fragen zur Programmierung mit Autohotkey

Moderator: jNizM

nepukadnezar
Posts: 2
Joined: 02 Oct 2013, 09:21

Loop nur eimal auführen trotz gedrücktem hotkey

Post by nepukadnezar » 02 Oct 2013, 09:28

Hi,

ich hätte gerne das in meinem script loop 3 nur einmal ausgeführt wird. auch wenn der hotkey gedrückt bleibt.

Code: Select all

timers:="160:199,168:211,276:332,4150:4300"
x::
Loop,Parse,timers,`,
{
  StringSplit,v,A_LoopField,:
  Random,r,%v1%,%v2%
  SetTimer,Loop%A_Index%,%r%
}KeyWait,x
Loop 4
	SetTimer, Loop%A_Index%, Off
return

Loop1:
Send a
return

Loop2:
send b
return

Loop3:
send c
return

Loop4:
send d
return
Danke

User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Loop nur eimal auführen trotz gedrücktem hotkey

Post by nnnik » 02 Oct 2013, 10:35

Dafür musst du dir merken ob dein Knopf schon gedrückt wurde und jetzt nur festgehalten wird.
Recommends AHK Studio

Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: Loop nur eimal auführen trotz gedrücktem hotkey

Post by Alibaba » 02 Oct 2013, 10:43

am besten über einen switch, also eine variable die entweder eine 0 oder eine 1 enthält.
"Nothing is quieter than a loaded gun." - Heinrich Heine

nepukadnezar
Posts: 2
Joined: 02 Oct 2013, 09:21

Re: Loop nur eimal auführen trotz gedrücktem hotkey

Post by nepukadnezar » 04 Oct 2013, 06:03

habs mit gosub und einem langen timer hinbekommen.

Post Reply

Return to “Ich brauche Hilfe”