• Hail, we're RedGuides. We want you to play six (yes, 6!) EverQuest characters at once. We have scripts and a friendly community to help, please join our playstyle and say hello! 👋
  • We've added LLM sections to our Terms & Rules and Resource Rules, for everyone's sanity & in-game safety.
    Read more
    a. Do not replace your voice with an LLM. This goes for your posts and your scripts. Drafting and editing with a tool is fine, but don't take you out of what you share.
    b. Do not replace your EQ character's voice with an LLM. We don't want scripts that speak over /ooc, /shout or other public channels. This has been an unwritten rule that's kept casino scripts off the site for decades, but we're now compelled to make it clear: keep automated communication private.

    Why Does RG Review Scripts?
    Nearly every LLM-written Lua script we see is making your character do impossible things, and rarely in a way that's beneficial to you. We've seen heavy server hammering, /target over impossible distances when /nav spawn would passively accomplish the same thing, a spawn search that fires 20+ times per second, and other pointless actions that are likely annoying GMs.

    You are welcome to use LLMs as a tool to structure, draft, and edit your work, but please read critically before hitting /lua run

Question - How to use /while (1 Viewer)

Warl0ck45

Well-known member
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