• 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 - Using Select with multiword searches doesn't work?

I was trying to use Select to determine whether a particular spell had been used:

I had first set ${PetSpell} to Manifestation of Earth.
${Select[${PetSpell},Manifestation of Earth]}
gives 3, rather than the expected 1.

I changed the Select to "Manifestation of Water", with PetSpell still Manifestation of Earth, and I still got back 3, rather than the expected 0.

I also needed to know whether it had been a water, air, or fire pet:
${Select[${PetSpell},Manifestation of Water,Manifestation of Air,Manifestation of Fire]}
which also gave me 3.

I tried double quotes, single quotes. Nothing worked.

If I select using a single word, then it works as expected every time, but that doesn't help in this situation.

As a workaround I did:
${PetSpell.Equal[Manifestation of Earth]}
${PetSpell.Equal[Manifestation of Water]} || ...etc...

I had hoped select would work :)
 
TLDR: Use Quotes -- ${Select["${PetSpell}","Manifestation of Earth"]}

Select will work, but one of the quirks of MacroQuest is that you can use either a comma or a space as a delimiter and MacroQuest will guess which one you want. The logic for that guess is fairly simple: whichever one it sees first. From there it's a matter of knowing that the parser is just a string parser and it parses from the inside out.

So your Select above is actually working and for your tier, it will likely always return 3 because when "Manifestation" is broken out, that's the match it's hitting. In further detail, whatever pet spell you have on you is "Manifestation of Something" which means that when that Select is looking for the first comma or space in the arguments you passed to it, it's finding the space between "Manifestation" and "of" -- so the assumption is you want to match "Manifestation" and that's at 3rd position.

Putting quotes around it tells Select that the pet spell you're passing in is a single parameter and you want to match the whole thing.
 
TLDR: Use Quotes -- ${Select["${PetSpell}","Manifestation of Earth"]}

Select will work, but one of the quirks of MacroQuest is that you can use either a comma or a space as a delimiter and MacroQuest will guess which one you want. The logic for that guess is fairly simple: whichever one it sees first. From there it's a matter of knowing that the parser is just a string parser and it parses from the inside out.

So your Select above is actually working and for your tier, it will likely always return 3 because when "Manifestation" is broken out, that's the match it's hitting. In further detail, whatever pet spell you have on you is "Manifestation of Something" which means that when that Select is looking for the first comma or space in the arguments you passed to it, it's finding the space between "Manifestation" and "of" -- so the assumption is you want to match "Manifestation" and that's at 3rd position.

Putting quotes around it tells Select that the pet spell you're passing in is a single parameter and you want to match the whole thing.

I tried it, but it did not work the way I was expecting.

This is the gist of the comparison.

${Select["out of components","out of components"]} returns 3. I guess that means that all three words were found, good enough. If I do ${Select["peridot","out of components"]} then it returns 0 which works fine.
 
Question - Using Select with multiword searches doesn't work?

Users who are viewing this thread

Back
Top
Cart