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

AmericanNero

Seasoned veteran member
Joined
Oct 13, 2020
RedCents
4,709¢
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