Power Infusion Macro

Very, very occasionally, I want to cast PI on somebody else. I’ve got a macro that casts it on my focus target, but I use focus pretty actively for other things. I’d like to re-claim my focus target when somebody else is going to get PI.

Specifically, what I’d like is some better way to add a player name as the target of my PI macro than opening it up, hard-typing the player name in, and then trying to find the inevitable typo. I’ve looked at various ways to define a variable and then cast at that variable, but haven’t been able to get anything working.

I don’t need to change the target during combat. The most common use cases are setting it up at the start of a dungeon (which might involve players on different servers) or before a raid encounter starts.

Any suggestions?

1 Like

You can’t really use variables in the way you may be thinking. (It is possible to set an attribute to a variable outside combat to use in a secure button; but they start crowding the 255 character limit very fast.)

An approach I’ve used for years is one macro to edit another. It works out of combat only which you said is fine.

This is my hunter’s “Set Misdirect” macro:

/pre local n=UnitName("target") or "pet" if not InCombatLockdown() then EditMacro("Misdirect",nil,nil,"/cast [@"..n.."] Misdirection") print("Misdirect set to "..n) end

it edits another macro named Misdirect to /cast [@] Misdirection.

So you need two macros for this. One to Set PI and another to cast PI. (I recommend naming them distinct–the game client can handle same-named macros but you will get unreliable behavior when attempting to manipulate them by name through the api if they have the same name.)

It’s also possible to have a macro edit itself out of combat, but you get weird behavior like extra characters going to the last chat channel if you don’t handle it properly. And again you’re crowding the 255-character limit fast here too.

3 Likes

Thanks, this is extremely helpful. For some reason I wasn’t able to adapt your macro so it worked, but I see the misdirection macro waters run deep and was able to find something very similar that mostly works.

One issue I’m still having is with casting it on players on different servers. It looks like server information isn’t added to the variable–do you get a different behavior, or does it not end up mattering for MD?

Were you grouped with the person from the other realm when you tested? @name in a macro requires the named person to be in the group. You don’t need to specify the server name either.