Macro for: [harm]Chain Lightning [help]Chain Heal

Hi everyone

Im struggling to create the following macro:
If i target an enemy, the macro should /startattack and /cast Chain Lightning

/startattack
/cast [harm]Chain Lightning;

If i mouseover a friendly target, have no target or a friendly target the macro should /cast Chain Heal.

/startattack
/cast [harm]Chain Lightning; [help][@mouseover,help,nodead][@player] Chain Heal

If i push shift and mouseover a friendly target, have no target or a friendly target the macro should /cast Chain Heal(Rank1):

/startattack
/cast [harm]Chain Lightning; [mod:shift][help][@mouseover,help,nodead][@player] Chain Heal(Rank 1); [help][@mouseover,help,nodead][@player] Chain Heal

Can someone please tell me if I put this macro together correctly?

Hi,
if you only want to /startattack your current, hostile target, you need to use conditionals, too. Otherwise the default behavior would clear friendly targets.

/startattack [harm,nodead]

For mouseover macros you have to consider the order of your conditionals. For example, [@target] will resolve if you have a target. If you use [@mouseover] after that, it will only resolve without a target. If you don’t specify a target, the default behavior (@target or @player) is used.

Next, you start with the modifier cast first. Same as above. [@mouseover,mod:shift] will only be true with Shift pressed while [@mouseover] will always be true, if you have a mouseover target, thus overriding any other additional conditions, like mod:shift, for the next conditional.

/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift]Chain Heal(Rank 1);

Followed by the part without mod:shift.

[@mouseover,help,nodead][@target,help,nodead]Chain Heal;

After that, you need to handle the harmful spell first. Otherwise you’d be locked in the [@player] conditional. For the harmful spell you need to add nodead, otherwise the macro would not advance to the next step if your target is dead.

[harm,nodead]Chain Lightning;

And the last part is for selfcast.

[@player]Chain Heal;

The full macro:
I just realized the macro is too long. I’m sad now. @target is not needed and can be removed.

/startattack [harm,nodead]
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift]Chain Heal(Rank 1);[@mouseover,help,nodead][@target,help,nodead]Chain Heal;[harm,nodead]Chain Lightning;[@player,mod:shift]Chain Heal(Rank 1);[@player]Chain Heal

With #showtooltip and the question mark icon you can easily showcase which spell will be cast. If you had enough space and different icons. :upside_down_face:

If you want to know more about why your macro was not working, read on.

Regards

Macro conditions and conditionals

Everything inside [], like harm,nodead is a condition while the whole [harm,nodead] is a conditional.

The first conditional that resolves to true, every condition inside is true, will execute the command. Every conditional after that will be ignored. The command in this case is /cast followed by the spell name after all conditionals.

/cast [mod:shift][help][@mouseover,help,nodead]Chain Heal(Rank 1);[help][@mouseover,help,nodead][@player] Chain Heal

is the same as

/cast [mod:shift]Chain Heal(Rank 1)
/cast [help]Chain Heal(Rank 1)
/cast [@mouseover,help,nodead]Chain Heal(Rank 1)
/cast [help]Chain Heal
/cast [@mouseover,help,nodead]Chain Heal

The condition mod:shift is not acting on the other conditionals. Meaning, that you would always cast Chain Heal(Rank 1) , not just by pressing Shift.

2 Likes

Oh wow, you are a true master at handling macros! kudos! Now the 255 character limit really is bad news, since i planned to use three different ranks of each healing spell in one macro (no modifier, shift and ctrl). i assume there is no way to make this work even if we take chain lightning out of the equation?

i would bascially need at least this but shorter:

#showtooltip
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift]Chain Heal(Rank 1);[@mouseover,help,nodead][@target,help,nodead]Chain Heal; [@mouseover,help,nodead,mod:ctrl][@target,help,nodead,mod:ctrl]Chain Heal(Rank 2); [@player,mod:shift]Chain Heal(Rank 1); [@player,mod:ctrl]Chain Heal(Rank 2); [@player]Chain Heal

1 Like

In terms of shortening the macro, you could activate auto self cast in your Interface Settings. It’s in the Combat section. That makes @player obsolete, since the default behavior, in this case, would be casting on yourself anyway.

[mod:ctrl]Chain Heal(Rank 2);Chain Heal

If you don’t need Chain Lightning you can rewrite the macro. Self cast will no longer lock you out.

/startattack [harm,nodead]
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift][mod:shift]Chain Heal(Rank 1);[@mouseover,help,nodead][@target,help,nodead][]Chain Heal

[] at the end is needed to fall back to default behavior. I’m not sure with the following one. With auto self cast you might be able to even lose the nodead. If the target is not valid, you should always self cast. So you just need to check if you have a target, either with exists or the shorter help.

Consider removing #showtooltip, I barely look at them in fight. The icon will still change.


For long macros it is possible to use /click <ActionButton>. Adding it at the end of your a macro will execute another one in the given ActionButton slot.

MultiBarRightButton1..12
MultiBarLeftButton1..12
MultiBarBottomLeftButton1..12
MultiBarBottomRight1..12

With this you could write a macro that uses the modifiers to execute other macros and handles nomod cases.

/startattack [harm,nodead]
/click [mod:shift] MultiBarLeftButton1
/cast [@mouseover,help,nodead][@target,help,nodead]Chain Heal;[harm,nodead]Chain Lightning;[@player]Chain Heal

In MultiBarButton1 slot

/cast [@mouseover,help,nodead][@target,help,nodead][@player]Chain Heal(Rank 1)

To hand over to another macro:

/startattack [harm,nodead]
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift]Chain Heal(Rank 1);[@mouseover,help,nodead][@target,help,nodead]Chain Heal;[harm,nodead]Chain Lightning
/click MultiBarLeftButton1
/cast [@player,mod:shift]Chain Heal(Rank 1);[@player]Chain Heal

The first macro won’t update it’s icon/tooltip in regards to the others, though. #showtooltip can use conditionals to remedy that to some extend.

#showtooltip [mod:shift] Auto Attack

Edit: @target is in those macros not needed and can be removed.

1 Like

Thanks Amarabael, i think we’re getting there now! Leaving out @Player might do the trick.

I did research on how many healing spells i actually need for Classic and came across an article on wowhead. According to the guy who wrote the article, i need:
2 Ranks of Chain Heal
4 Ranks of Healing Wave
1 Rank of Lesser Healing Wave

With that in mind, im able to squeeze in all of these spells including Chain Lightning to three keys:

Chain Lightning / Heal

#showtooltip
/startattack [harm,nodead]
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift]Chain Heal(Rank 1);[@mouseover,help,nodead][@target,help,nodead]Chain Heal;[harm,nodead]Chain Lightning;

Now i believe i learned one thing from you, which is important here: is it correct that [@mouseover,help,nodead] will always overrule [harm,nodead] since the macro will execute the first true condition? The reason im asking is, because i might want to target a boss in a raid to see the remaining health while using mouseover chain heal at the same time.

Lesser Healing Wave / Healing Wave

#showtooltip
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift] Healing Wave(Rank 1); [@mouseover,help,nodead][@target,help,nodead] Lesser Healing Wave

The reason i put Healing Wave(Rank 1) in here, is because it doesnt fit the third and last macro below and i dont want to start using more modifier than ctrl and shift. But i think these two go well together anyway so its fine.

Healing Wave

#showtooltip
/cast [@mouseover,help,nodead,mod:shift][@target,help,nodead,mod:shift] Healing Wave(Rank 7); [@mouseover,help,nodead,mod:ctrl][@target,help,nodead,mod:ctrl] Healing Wave(Rank 5); [@mouseover,help,nodead][@target,help,nodead] Healing Wave

@Amarabael
Can you confirm that these macros will work as intended?
What a beautiful piece of art we created!

Yes, mouseover will have the highest priority and overrule all following conditionals. Your macro will not show an icon, though, if non of the conditionals are true. [harm,nodead] before Chain Lightning prevents that. It was only needed if followed by a self cast.

Hm, yes. They should work otherwise.

But I have to apologize. :disappointed: @target is not needed in ANY of those macros. @target is the default behavior. I even said it in my last post and still… I’m sad now and really sorry for that. :no_mouth:

1 Like

No worries, you are my hero anyway :blush:

1 Like

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