Page 1 of 1

loop in autohotkey?

Posted: March 16th, 2009, 6:20 pm
by henrikgud
Hi anyone that know how to put in loop amount in autohotkey... thought I knew but I didnt :P cant get it to work...

I want the macro to run 2loops then stop. but its just keep on looping endlessly :(

Posted: March 16th, 2009, 6:44 pm
by xsevenbeta
RTFM

Loop, Count
{
}

Posted: March 16th, 2009, 6:47 pm
by henrikgud
humf werid I have done like that but still it run endlessly :(

"
Loop, 2
{
Send r ;
Sleep, 2000 ; wait 2 seconds

balblablablalbalbalba
}
"

Posted: March 16th, 2009, 9:00 pm
by henrikgud
!,::
Pause



Loop, 2
{

Send r
Sleep, 2000 ; wait 2 seconds

}


this is how it looks like... even tho it says Loop, 2 I get 4 rrrr“s in the text dokument (just made this exampel to show it dosent work)

Edif: Well it seams that if I pick Loop,1 I get 2 Loops so I can run my macro anyway... just woundering if it should behave like this :P
btw: its quite a long macro and when i checked it I stoped it after it started the 4th run thats why I though it was running endlessly :(

Posted: March 17th, 2009, 7:25 am
by henrikgud
still dosent work for me :(

if I take Loop, 1 in to a longer macro it still dosent stop :(
anyone that cant helpout?

Posted: March 18th, 2009, 10:44 pm
by xsevenbeta
Btw, good style use variables. Like this:

SpellCount=10 ; How much time Cast
Loop, %SpellCount%
{
> macros body here <
}

Posted: March 19th, 2009, 2:15 am
by henrikgud
so if I write

SpellCount=2
Loop, %SpellCount%
{
> macros body here <
}

it will only play 2 times or?

Posted: March 30th, 2009, 12:43 am
by drizuid
loop, 2
{
stuff
}
exitapp