Macro with variable target

I have tried looking this up, but not found any solutions for this. How do I add a target variable in a macro in Classic?

I need it in a macro announcing a coming buff which will go like this:

/w [target] Casting buff x on you

I have tried using both [@target] and [@focus] as target variable, but the game insist that these are player names. What can I use that can make the game understand that I want it to /w my actual target?

https://www.curseforge.com/wow/addons/macro-talk

/wu target Casting buff x on you

You don’t really need an addon for this either. Sending a whisper to your target can be done using a /run command.

/run SendChatMessage("Casting buff x on you", "WHISPER", nil, GetUnitName("target"))

Thanks for your answers guys! :slight_smile:

Now, what if wanted to mention my target in /s or /yell or /p instead, how could that be done? Example:

/yell Casting buff x on [target], use it well!

Then use %t instead of [target] in your example :slight_smile:

2 Likes

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