#showtooltip
/stopcasting
/run u,mf=“target”,“Counterspell”;if IsSpellInRange(mf,u)==1 and GetSpellCooldown(mf)==0 then SendChatMessage("<< Interrupted %t >>", IsInGroup(2) and “INSTANCE_CHAT” or IsInRaid() and “RAID” or “PARTY”) end
/use Counterspell
The macro allow me to cast Counterspell and announce when I cast it and on whom without spamming the announcement when ever I press the button. Overall it works great but it also create a ton of errors and there ain’t room for the clear errors script due to character limitations.
Is there any way I can achieve the same results but shorten or rework the macro and also get rid of all the errors?
Well I made it since people in raids do care, perhaps not a random PuG but more organized groups do, same with most other CC abilities that’s important in raids, especially in later phases when other raids arrive.
You can circumvent the Macro character limitation by splitting it up into multiple macros, drag them to actionbar(s) and then call the action-button you put it on from within your main macro.
Now I don’t know if it will work out for you, with the macro you have in mind, but just maybe it will.
First of all, you’ve mixed up the parameters for IsSpellInRange. It takes the spellname first, then the target. Secondly, GetSpellCooldown returns several values. The second value it returns is 0 if the spell isnt on cooldown, and returns its full cooldown value if it is on cooldown (it doesnt “count down”).
Try this if it’s what you want.
#showtooltip
/stopcasting
/run _,cd,_,_=GetSpellCooldown(2139) if cd==0 and IsSpellInRange("Counterspell","target") and IsInGroup() then SendChatMessage("test","party") end
/cast Counterspell
That works like a charm apart from the range check but added ==1, huge thanks Riotblade. Also a follow up question, what’s the smartest way to make it post in raid chat if available but party chat otherwise?