First macro time here. I'm trying to develop a macro that will cast renewal if the target is myself or cast swiftmend in any other case. For example, if renewal is on CD swiftmend would cast on myself. I think we could simply run two casts as the GCD would be triggered by the first call to cast(?)
/cast [@player]renewal
/cast [@mouseover,help,nodead]swiftmend
But this doesn't seem to work, in fact it casts both at the same time which is interesting. Please help!
I don't think it can be done in exact way you want it. @player doesn't check if the target is you, it targets you. Also it casts two spells because you have two lines that start with /cast. If you want macro to choose one spell you need have everything in one line that starts with /cast.
I am not aware of any conditional that can check if your target is you, the player. Macros also can't check if a spell is on cooldown. You could try doing something that will cast Swiftmend on mouseover and Renewal on you in any other case so if you would like to cast renewal you would need to make sure your mouse isn't over any friendly target.
I am not aware of any conditional that can check if your target is you, the player. Macros also can't check if a spell is on cooldown. You could try doing something that will cast Swiftmend on mouseover and Renewal on you in any other case so if you would like to cast renewal you would need to make sure your mouse isn't over any friendly target.
#showtooltip
/cast [@mouseover,help,nodead]Swiftmend;[@player]Renewal
macros cant do "if", they can only follow your order of target choice.
11/11/2018 18:58Posted by TivaciFirst macro time here. I'm trying to develop a macro that will cast renewal if the target is myself or cast swiftmend in any other case. For example, if renewal is on CD swiftmend would cast on myself. I think we could simply run two casts as the GCD would be triggered by the first call to cast(?)
/cast [@player]renewal
/cast [@mouseover,help,nodead]swiftmend
But this doesn't seem to work, in fact it casts both at the same time which is interesting. Please help!
The reason why it casts both at the same time is because Renewal isn't on the global cooldown so it can be chained with other spells in the same macro. The "@player" conditional just defines the target of the spell, it's not an "IF" statement.
Although you can't have a macro to check if you are the target of a spell, what you can do is use logic to get a similar result:
#showtooltip
/cast [@mouseover, help, nodead] Swiftmend; [] Renewal
This will attempt to cast Swiftmend on your friendly mouseover target, and if it can't do that it will cast Renewal. Renewal can only be cast on yourself so it doesn't need any conditionals for it to work. The only downside with this macro is that if you have you mouse over your character frame, it will cast swiftmend rather than renewal, since your character counts as a friendly target. It's annoying but I think that's the closest you'll get to what you want.
#showtooltip
/cast [@mouseover, help, nodead] Swiftmend; [] Renewal
This will attempt to cast Swiftmend on your friendly mouseover target, and if it can't do that it will cast Renewal. Renewal can only be cast on yourself so it doesn't need any conditionals for it to work. The only downside with this macro is that if you have you mouse over your character frame, it will cast swiftmend rather than renewal, since your character counts as a friendly target. It's annoying but I think that's the closest you'll get to what you want.
If it doesn't need any conditional then you don't need that empty bracket there. And all those spaces aren't necessary you only need space after /cast. That way you can pack more commands into the macro.
11/11/2018 23:31Posted by Cedrad
...
This will attempt to cast Swiftmend on your friendly mouseover target, and if it can't do that it will cast Renewal. Renewal can only be cast on yourself so it doesn't need any conditionals for it to work. The only downside with this macro is that if you have you mouse over your character frame, it will cast swiftmend rather than renewal, since your character counts as a friendly target. It's annoying but I think that's the closest you'll get to what you want.
If it doesn't need any conditional then you don't need that empty bracket there. And all those spaces aren't necessary you only need space after /cast. That way you can pack more commands into the macro.
I've had issues with some macros in bfa that randomly decide to carry on conditionals for spells that have no conditionals attached to them. The extra set of empty brackets are an added redundancy as just a safety net to make sure it doesn't happen.