Article Categories
- Baldur's Gate 3
- Diablo
- Elder Scrolls
- General
- Hogwarts Legacy
- League of Legends
- Minecraft
- Pokemon Go
- Sims 4
- StarCraft
- Steam Platform
- Xbox Game Console
More Articles
How can I disable use of a macro if a spell is on cooldown?

As a Shadow Priest, I use a macro to announce to those nearby who I'm casting Power Infusion on. I do this for clarity in a raid and Mythic+ setting. It works fairly well.
The problem I'm encountering is that I'm sometimes pressing this macro before Power Infusion's cooldown timer is over. This causes the /yell message to send regardless of whether I actually cast Power Infusion or not, leading to me awkwardly mentioning in voice chat that I've not, actually, cast Power Infusion.
Here's my current macro:.
#showtooltip Power Infusion.
/target [@mouseover,help,nodead][help,nodead][@player].
/cast Power Infusion.
/yell Casting Power Infusion on %t.
/targetlasttarget.
I'm abusing /targetlasttarget to make this an easy-to-use mouseover macro.
Is there a way to make this macro not execute at all if Power Infusion is on cooldown?
Question from user Spevacus at gaming.stackexchange.com.
Answer:
So Blizzard removed the ability for a macro to make a determination whether or not to cast a spell. People were abusing this and making automated combat macros that would always cast the most effective barrage of spells/attacks in combat, and it was a game-changer for people on both sides.
You can check that a spell is on cooldown in Lua (https://wowwiki-archive.fandom.com/wiki/API_GetSpellCooldown), but you can't call that from a macro.
(Calling Lua from a macro was the main part of what was removed from the macro abilities.).
Answer from user Tim S. at gaming.stackexchange.com.

As a Shadow Priest, I use a macro to announce to those nearby who I'm casting Power Infusion on. I do this for clarity in a raid and Mythic+ setting. It works fairly well.
The problem I'm encountering is that I'm sometimes pressing this macro before Power Infusion's cooldown timer is over. This causes the /yell message to send regardless of whether I actually cast Power Infusion or not, leading to me awkwardly mentioning in voice chat that I've not, actually, cast Power Infusion.
Here's my current macro:.
#showtooltip Power Infusion.
/target [@mouseover,help,nodead][help,nodead][@player].
/cast Power Infusion.
/yell Casting Power Infusion on %t.
/targetlasttarget.
I'm abusing /targetlasttarget to make this an easy-to-use mouseover macro.
Is there a way to make this macro not execute at all if Power Infusion is on cooldown?
Question from user Spevacus at gaming.stackexchange.com.
Answer:
So Blizzard removed the ability for a macro to make a determination whether or not to cast a spell. People were abusing this and making automated combat macros that would always cast the most effective barrage of spells/attacks in combat, and it was a game-changer for people on both sides.
You can check that a spell is on cooldown in Lua (https://wowwiki-archive.fandom.com/wiki/API_GetSpellCooldown), but you can't call that from a macro.
(Calling Lua from a macro was the main part of what was removed from the macro abilities.).
Answer from user Tim S. at gaming.stackexchange.com.
How to get the Operating Profit Graph for the entire game?
Why does my map have exclamation points marked on it?
Can someone tell me what is wrong with my game in Hogwarts Legacy?
What programming language or game engine is Hogwarts Legacies written in?
Can you control what ore a drill harvests when its placed over multiple ores?
Are Cheats in GTA5 official feature or is it some hack spread by developers - users?
Ancient Magic Theory relating to Harry Potter
Agitated Giant Thrips: how to properly deal with them in Dwarf Fortress?
What do the Dota 2 ranks mean in the context of individual unranked games?


