Macro help: setting raid target icons

I’ve done some googling and can’t seem to get anywhere. I would just like a simple macro command to set the Skull on what I am targeting when I press the macro. That’s it. Nothing fancy. I do this so the group knows what to attack when I pull a group of mobs, because so many players seem to have forgotten how threat works in classic.

1 Like

There are a couple of ways you could do this.

You can set a keybind to the target marker icon

Or use /script SetRaidTarget("target", 8);

2 Likes

/script SetRaidTargetIcon(“target”, 1)

1 Star
2 Circle
3 Diamond
4 Triangle
5 Moon
6 Square
7 Cross (X)
8 Skull
7 Likes

Big help, thanks guys. Now to complicate it slightly. Right now using that it toggles the icon off and on, is there a command to just have it on and keep it on no matter how many times I press it? I plan on binding this to a /cast Judgement.

So right now the macro looks like this:

#showtooltip
/cast Judgement
/startattack
/script SetRaidTarget(“target”, 8);

Again I would like it to keep the icon on if it’s already there. Thanks again for the help guys.

I don’t think there’s a way in the current macro system to determine whether the icon marker is set on that target, then to not unset if it isn’t.

However, a workaround may be to use the combat conditional. This will only set (or unset) the raid icon while out of combat:

#showtooltip
/cast Judgement
/startattack
/stopmacro [combat]
/script SetRaidTarget(“target”, 8);
2 Likes

Fair enough. I’ll work with what I got, thanks.

While I have you guys here, a simpler macro would be one where it targets the target of my target, casts blessing of protection, then goes back to the original target. Think of it as a vanilla paladin taunt lol. I know there’s an assist command, but I’m not sure how it would work in casting. Thanks again.

I’ve got a question,

Can I make a macro that will cast shield unless it is on CD, and then cast lesser heal?

That’s an easy one. Simply

/cast Divine Shield
/cast Flash of Light

It won’t attempt to do both, it will do the first one, and if it can’t succeed, it will do the second. If you want it to show the shield’s cooldown and tooltip, start the macro with

#showtooltip

I misunderstood the request, potentially. Paladin or priest? For priest, /cast power word: shield
/cast flash heal
would not work

I don’t think this exists but I could be wrong. While not quite what you’re asking for you could use /targetlasttarget to quickly return to the mob after manually targeting the party member. Or you could use a mouseover to avoid untargeting all together. Or, the F key is default ‘target of target’

/cast BoP
/targetlasttarget

1 Like

I tried this already and it doesn’t work, it tries to cast shield and does not move on to the heal.

it is for my priest too

Yes, that would require the game to make a decision for you. You can’t do it that way. There are workarounds but they’re pretty crass for 2 low/no cd same-target (ally or non-ally) spells. You COULD do something like:

/cast [@mouseover,exists,noharm] flash heal
/cast power word: shield

but you’d likely be better off just giving them separate bindings as the target navigation is wonky and excessive.

You could also castsequence for the cd of pw:s but again, I don’t really recommend it. I’m not versed in the castsequence syntax because I find them personally to be poor options in general but:

/castsequence reset=combat/5 power word: shield, flash heal, flash heal

already have separate macros for shield and heals on my on-follow priest. Just wanted to see if I could save space.

Thanks :slight_smile:

Ok for my paladin taunt, as far as I can tell, this works. I haven’t had a chance to test it yet in a group, but I tried it using renew on my priest by targeting some random mob that was being attacked by a warlock’s pet, and this did keep me targeted on the mob while putting renew on the voidwalker.

/assist
/cast Blessing of Protection(Rank 1)
/targetlasttarget
/startattack

Theoretically this should work like a taunt. If I’m working on a boss, and the mage pulls aggro, and I see it, by pressing this button it should put blessing of protection on the mage and keeps me autoattacking the boss.

#showtooltip
/cast Judgement
/startattack
/script SetRaidTarget("target",0);
/script SetRaidTarget("target",8);

Let me know if this works

6 Likes

You can only do one action per click. And since Divine Shield is first, it’ll only try to cast that. It won’t ever get to Flash of Light.

The best you can do is a /castsequence Divine Shield, Flash of Light

Holy necro, Batman. Sorry Dunhill! Lol.

Hey guys, i know this is a little late, but you don’t have to use scripts to bind the target markers to the keys. Just go into keybindings and bind the keys you want, under the target markers category.

3 Likes

I know this post is old but it comes up in google searches about SetRaidTarget skull marker macros, so this might help someone who stumbles on this:

The other poster above (Elite) is incorrect about the current macro system being unable to make the macro always set a skull and not toggle.

Here’s a macro I just made on TBC Classic (working as of phase 1, Aug 8, 2021) that sets a skull on your mouseover if it exists, sets skull on your target if no mouseover exists, and clears the skull marker off all targets if you have no mouseover and no target:

/run st=SetRaidTarget;ue=UnitExists;g=GetRaidTargetIndex;mo="mouseover";pl="player";tr="target";pt=g(pl);if ue(mo)then if g(mo)~=8 then st(mo,8)end elseif ue(tr)then if g(tr)~=8 then st(tr,8)end elseif pt==8 then st(pl,0)else st(pl,8) st(pl,pt or 0)end

How this macro works:

I had to shorten the macro using variables since it was over 255 characters originally, so it’s not super readable.

First, we check for a mouseover and put a skull on that (but only if it doesn’t already have a skull on it).

Second, we check for a target and put a skull on that (but only if it doesn’t already have a skull on it).

Third, we clear skull if there was no mouseover and no target.

There is no function to clear a specific raid target icon globally that I am aware of, so the workaround I chose was to set a skull on the player (which will remove it from anything else), then clear it. This means if there was another icon on you, it would get normally get cleared by the macro and you’d need to set it again. To fix THAT issue, we check for any icons on the player first, store them in a variable, then put them back on the player afterward. Also, the GetRaidTargetIndex function returns nil when a unit has no icon, but the SetRaidTarget function wants you to use zero for its second argument to clear an icon and does not accept nil, so that’s why we have “or 0” in the last function call to prevent it from breaking when GetRaidTargetIndex(“player”) returns nil.

If you just wanted to always set skull on your target only (without the mouseover or skull-clearing functionality), that’s simpler and would just be this:

/run if UnitExists("target") then if GetRaidTargetIndex("target")~=8 then SetRaidTarget("target",8) end end

and if you wanted it to set skull only on target but WITH skull clear when you have no target (again, no mouseover functionality), that would be:

/run pt=GetRaidTargetIndex("player");if UnitExists("target") then if GetRaidTargetIndex("target")~=8 then SetRaidTarget("target",8) end elseif pt==8 then SetRaidTarget("player",0)else SetRaidTarget("player",8) SetRaidTarget("player",pt or 0)end

Here’s another macro that will clear ALL raid target icons, since there’s not a function for that either:

/run i=8;while i>=0 do SetRaidTarget("player",i) i=i-1 end

Edit: cleaned up the post’s messy formatting and updated the target-only macro to preserve player icons when clearing skull.

7 Likes

You are amazing - thank you for posting this.

this didnt work for me, however /run SetRaidTarget(“target”, 8); did work

Logged in to confirm this works today in wow classic hardcore:
/run if UnitExists(“target”) then if GetRaidTargetIndex(“target”)~=8 then SetRaidTarget(“target”,8) end end

Skull comes on and stays on even if I spam. Great work Spouty! The last piece to getting my convoluted steam controller setup running nicely!