for next loops

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

EQBot_man
a ghoul
a ghoul
Posts: 111
Joined: Mon May 17, 2004 6:35 pm

for next loops

Post by EQBot_man » Wed May 19, 2004 11:49 pm

Why doesn't this work?
I get /for loop using invalid variable.
I know its so simple but for the life of me its beyond my grasp.

----------------------------------------------

#turbo
/delay 0

Sub Main
:Continue

/for Loop 0 to ${Group}

/echo test

/next Loop

/goto :Continue
/return

-----------------------------------------------

Jerle69
a hill giant
a hill giant
Posts: 263
Joined: Wed Apr 28, 2004 3:26 pm

Post by Jerle69 » Wed May 19, 2004 11:52 pm

You have to delcare all variables you wish to use, including loop indexes.

Insert:

Code: Select all

/declare Loop int

...somewhere before your /for statement, and you're good to go.

As a sidenote, you don't need #turbo or the /delay command; they're not doing anything worthy for you here.
--Jerle