• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->
  • There is a suspension/ban wave happening, we're still gathering information. Please keep regular discussion to Suspension MegaThread and please consider submitting a Suspension report to RG.
Resource icon

Guide How to Trace Calls in an MQ2 Macro

One could replace /call with a sub that then calls. E.g.
Another implementation:
/call RemoteCall "subname param0 param1..."


Sub RemoteCall(string RemoteSubParams)
    ||| One may need to cache params if needed elsewhere, but you can also use .Arg[] to extract

    /declare MacroReturn string local NULL

    ||| Debug call stack but the value of CurSub is substituted with the subname passed in
    CALLINGSUB
    CALLINGINDEX
  
    ||| Perhaps put a generic debug Entry message in here
    PUSHCALL
  
    ||| Modify the DEBUG define(s) to use the debug flags as vars rather than hardcoded and replace CurSub with name of calling sub
    DEBUGN
  
    /call ${RemoteSubParams}
    /varset MacroReturn ${Macro.Return}
  
    DEBUGN...
  
    ||| Perhaps put a generic Exit messsage in here
    POPCALL
/return ${MacroReturn}

In the remote sub, one still needs to have CALLINGSUB and CALLINGINDEX at the top to make use of DEBUG messages produced therein.

One would need to do a global search/replace for /call with /call RemoteCall, then put quotes around the sub/params.
Back
Top