• 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 - Subroutine Returns

Looked around ... didn't see any clear examples or other questions about this subject, so here goes ..

I don't seem to have any issues with subroutines returning int or string type variables and picking up the result in the calling macro with ${Macro.Return}
I have not been successful yet trying the same thing with arrays or MQ2Collections types. I am beginning to think it's not possible.

Is it possible for a subroutine to return an array?
Is it possible for a subroutine to return a list (or set or map) from (MQ2Collections)?

Maybe people are avoiding returns and just using outer scoped variables for passing implicitly passing information between macro and subroutine?
 
Looked around ... didn't see any clear examples or other questions about this subject, so here goes ..

I don't seem to have any issues with subroutines returning int or string type variables and picking up the result in the calling macro with ${Macro.Return}
I have not been successful yet trying the same thing with arrays or MQ2Collections types. I am beginning to think it's not possible.

Is it possible for a subroutine to return an array?
Is it possible for a subroutine to return a list (or set or map) from (MQ2Collections)?

Maybe people are avoiding returns and just using outer scoped variables for passing implicitly passing information between macro and subroutine?
(this doesn't answer your question) there are some very serious limitations to the macroquest macro language - have you considered checking out MacroQuest "Next"? with it comes mq2lua and you can use Lua to do so many more things you just simply can't with the mq macro language
 
According to the doco, /return [value|${varname}] is the only way is works. And ${varname} causes any complex type to evaluate down to a value. Sic is correct. Lua is probably a better choice here if you're on Next.
 
Question - Subroutine Returns

Users who are viewing this thread

Back
Top
Cart