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.
Using in game mod manager locks you out of achievements
Should I not have won a culture victory by now in Civilization 6?
Screen flashing during the day in Watch Dogs
How do I unlock Floaro Gardens in Pokémon Legends: Arceus
When being killed by an object or non-player, does that entity gain the XP I had in diep.io?
How do I unlock scenes in Star Wars Tiny Death Star?
Tactical stance in COD MW3 - is there RL equivalent?
What is the best gear to wear when fighting Ranrok in Hogwarts?
What is the maximum number of tags a mob can have in Minecraft?
Too easy on normal in Hogwarts Legacy?