• 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 - Macro TLO

I believe you have to pass it to the sub from the calling sub

pseudo-code of poo
Code:
Sub SubThatImIn(int iCoolParam, string sFromWhere)
    if (bDebugReport) {
        /echo Entering ${Macro.CurSub} from ${sFromWhere}

    }
/return
 
Return needs to know where to go back. Is it treated as a synonym for goto so there is no sub name information in the stack? NM I answered my own question.

/return
C++:
// ***************************************************************************
// Function:    Return
// Description: Our '/return' command
// Usage:       /return [value]
// ***************************************************************************
void Return(PSPAWNINFO pChar, char* szLine)
{
    bRunNextCommand = true;
    MQMacroStack* pStack = gMacroStack;

    if (!gMacroBlock)
    {
        MacroError("Cannot return when a macro isn't running.");
        return;
    }

    if (!pStack->pNext)
    {
        // Top of stack (ie. returning from Sub Main)
        EndMacro(pChar, "");
        return;
    }

    if (pStack->LocalVariables)
        ClearMQ2DataVariables(&pStack->LocalVariables);

    if (pStack->Parameters)
        ClearMQ2DataVariables(&pStack->Parameters);

    if (!pStack->bIsBind) // binds dont return values...
        pStack->pNext->Return = szLine;

    gMacroBlock->CurrIndex = pStack->pNext->LocationIndex;
    gMacroStack = pStack->pNext;

    delete pStack;
}
 
Last edited:
hrm - I "believe" it just uses the gMacroStack->Return - in which case, a member could be added to report that as a stringtype
 
I mean, I guess my poke about Lua and the debug.traceback() which will give you the stack was kind of in jest - but in all honestly, I wonder if you have considered just converting the macro from the old contrived scripting language to Lua or not? Rather than having the devs add members on the Macro TLO to expose stuff and having to recompile, you could just convert the script.

I'm no Lua expert, but I would be willing to help anyone with converting old stuff over.
 
I'm not sure its cool for me to port KA over, but I can if the powers that be bless it.

I just finished writing a neato hack that allows me to trace the call stack within MQ. I'll survive a bit longer.
 
Question - Macro TLO

Users who are viewing this thread

Back
Top
Cart