• 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 - 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.

[CODE lang="cpp" title="/return"]// ***************************************************************************
// 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;
}
[/CODE]
 
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