• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - How to use /while

Warl0ck45

Well-known member
Joined
Jan 31, 2014
RedCents
8,554¢
While trouble shooting a /for loop that was giving me issues after all the updating I ran across the /while command again. I have not touched /while before, after reading a few others had issues with it working properly.

Is it working now?

And since my understanding of code is VERY dated, before trying to use it I wanted to know it's usage and limitations before hand. My understanding was a "while" command was a command waiting for X condition to be true before being executed... thus putting a "while, condition, command" at the start of a section would have it running during that section to be triggered anytime the condition was met. Is this accurate?

In this case, my puller is occasionally being snared while he is pulling. I used a simply /delay command. I thought about using a /while command to have him FD if his class was able.

I how ever do not want him just randomly FDing anytime he is snared, and thought this might be a chance to try tinkering with /while so the check is only happening during the pull.

Reading over https://www.redguides.com/docs/projects/macroquest/reference/commands/while/ though makes it appear that the /while works more like /for.../next though...


Does someone have the time to explain this? =)
 
/while works but your understanding of it is a little off. A while loop checks the condition at the start of the loop. Each time it gets to the end of the loop, it goes back to the top and, if the condition is true, it executes the loop again. So it's a loop that continues as long as the "while" condition is true.

For is for looping a set number of times, but the concept is similar. Neither are "triggered" like events are, they are just evaluated at the time the code reaches that point.
 
Ah, so the /while loop would continue perpetually until the condition is met, while the /for loop has a set limit, otherwise they are the same.

Alrighty, thank you
 
Question - How to use /while

Users who are viewing this thread

Back
Top
Cart