Macro SendChatMessage concatenate?

I have a macro for Rebirth like this that works great:=. Annouces in yell I am battle rezzing my mouseover target (healbot)
/run SendChatMessage("BATTLE REZ INCOMING FOR " …UnitName(“mouseover”), “Yell”)\

I would like to have the name in the middle. However this only seems to work when Unitname is at the end. Any ideas on how to add a string after the Unitname?

If you haven’t yet, I’d suggest posting it also on Reddit.
These forums have only a few hundred people at best.

But yeah, I got no idea. The only “work around” I can think of is an addon called SpeakingSpell.

I did on Reddit, one person gave me the code that works. I asked if he knew how to adjust it so it doesn’t have to be at the end but I am just reaching out to others as well.

/run SendChatMessage("Bringing " …UnitName(“mouseover”) " back from the dead, “Yell”)

You should just be able to concatenate another string.

/run SendChatMessage("BATTLE REZ FOR " .. UnitName(“mouseover”) .. " INCOMING", "YELL")

Now, I’m not logged on to test this, but if that still fails, it may be some interaction with UnitName returning two values (name & realm). In that case, you may need to do something like:

/run SendChatMessage("BATTLE REZ FOR " .. (UnitName(“mouseover”)) .. " INCOMING", "YELL")

or use a function that only has a single return value like

/run SendChatMessage("BATTLE REZ FOR " .. GetUnitName(“mouseover”,true) .. " INCOMING", "YELL")

Edit: Updated to put commands in code blocks, as .. was being replaced by ... otherwise.
Edit2: Initial one seemed to work after testing, so the second and third can likely be ignored.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.