• 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 - Help with /declare multiple strings

Status
Not open for further replies.
Hi, I am making a targeting macro which looks for specific name types to target only those. I am having issues when I do the following:

/declare Targets string outer plains lion cat

it is only looking for targets with 'plains' in the name instead of any mobs which contains either 'plains' 'lion' or 'cat.' If I change the order and put cat first, it would look for that. How can I make it look for any of the defined strings?

What am I doing wrong? Thanks!
 
I believe you need a declare for each.

/declare Targets string outer plains
/declare Targets string outer lion
/declare Targets string outer cat
 
You can't have a variable declared more than once unless you use local (and it is still only once per Sub).

You can declare an array tho and populate the array with plains, lion and cat and do a target via that. Or just do targets1, targets2, targets3
 
Very helpful thanks both. I am currently using the declaring targets1, targets2, targets3, etc. The array sounds like a better option though. I will play with it once new compile is out. Assuming the syntax is as follows?

/declare Targets array outer plains lion cat
 
Something like this would work (minus any syntax errors that you might have to fix).

Rich (BB code):
/declare Targets[3] string outer //creates an array with 3 variables
/declare i int outer

/varset Targets[1] plains
/varset Targets[2] lion
/varset Targets[3] cat
/varset i 1 

:loop
/if (!${Target.ID}) /target ${Spawn[${Targets[${i}]}]}
/varset i ${Math.Calc[${i}+1]}
/if (!${Target.ID}) {
/delay 2s //to keep from spamming
/goto :loop
}
 
Question - Help with /declare multiple strings
Status
Not open for further replies.

Users who are viewing this thread

Back
Top
Cart