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

Question - Passing arguments to /macro

Joined
Mar 13, 2023
RedCents
944¢
The documentation tells me I can pass parameters to a macro when starting it with /macro like this:
Arguments:
/macro MyMacro "metal bits"
But I cannot for the life of me find anywhere how I pick up this/these values in the macro. It is probably dead easy but my eyes are tired and I have spent 30 minutes googling/reading the documentation for a "how to" but I just cannot find it.
 
You'll want to look into https://www.redguides.com/wiki/DataType:macro specifically the Params so you can count the number of arguments easy

then you access those parameters like ${Param0} ${Param1} etc...

This project of mine is pretty basic and uses arguments from runtime that you can look at. It shows the error checking you can do to make sure it's not just a blank space or out of scope or whatever. You're looking for around line 93

 
instead of trying to figure out how to do things in macro language, you could always try to figure out how to do them in Lua instead!

Lua:
local mq = require('mq')

local args = {...}
print(args[1])

while true do
    printf('Doing something interesting with all my %s', args[1])
    if mq.TLO.FindItemCount(args[1])() == 0 then
        printf('i ran out of %s', args[1])
        break
    end
    mq.delay(1000)
end
 
You'll want to look into https://www.redguides.com/wiki/DataType:macro specifically the Params so you can count the number of arguments easy

then you access those parameters like ${Param0} ${Param1} etc...

This project of mine is pretty basic and uses arguments from runtime that you can look at. It shows the error checking you can do to make sure it's not just a blank space or out of scope or whatever. You're looking for around line 93

Thank you. Works now.
 
Question - Passing arguments to /macro

Users who are viewing this thread

Back
Top