HI,
I was hoping that some1 here who's good at writing macros could write a short macro for me that would print my chars current xp to chat. I think u can use UnitXP("Player"), which should return the player's current xp, and even UnitXPMax("Player"), which should return the xp needed to reach the next level. i couldn't figure out how to print it out in chat, tho. I tried to print it as a simple integer field, "/", then another integer field, representing
the chars current xp/xp needed to get to the next level. I'm pretty sure the macro can be 1 reasonably short line. I tried
/run print(("%s / %s"):format(UnitXP("player"), UnitXPMax("player") ))
needed an extra set of () as it's now calling the print() function instead of invoking a slash command
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I was hoping that some1 here who's good at writing macros could write a short macro for me that would print my chars current xp to chat. I think u can use UnitXP("Player"), which should return the player's current xp, and even UnitXPMax("Player"), which should return the xp needed to reach the next level. i couldn't figure out how to print it out in chat, tho. I tried to print it as a simple integer field, "/", then another integer field, representing
the chars current xp/xp needed to get to the next level. I'm pretty sure the macro can be 1 reasonably short line. I tried
/script x=UnitXP("Player") DEFAULT_CHAT_FRAME:AddMessage(format("%",UnitXP(),x))
and
/script DEFAULT_CHAT_FRAME:AddMessage(format("%",UnitXP("Player")))
but i don't know how to get it to print to chat.
Thx in advance :)
Also, /print assumes you have a library or addon that provides that slash command. If not, then you'll need to use /run print("stuff") instead.
worked fine with no addons and printed:
365/400
or some such for a lvl1. But the following:
/run print ("%s / %s"):format(UnitXP("player"), UnitXPMax("player") )
printed this:
%s / %s
so there's a syntax adjustment needed. Thx for the help, all!
:)
needed an extra set of () as it's now calling the print() function instead of invoking a slash command