Afternoon, everyone. I read the wowwiki macro pages, and attempted to Google for an answer to this as well as search this forum, buuut I couldn't even figure out good search terms. : x.

My warrior has a macro something like

/use Shield Wall
/s Shield Wall: -60%dmg 12 sec

Problem is, if SW is still on cd and I jam the button, my /say goes off anyway. Is there a way to make the /say only happen if SW is off CD and gets used? IE, if it's 3 sec from being available, I could jam the button multiple times, but the whole key would only work (use SW and then do the /say) the one time when SW comes off CD and gets used, and then the key doesn't work again now that SW has been used.

Your code is actually better (shorter), but you need to execute the script before the /cast or else it will never evaluate to "true". Because after the /cast it always is on cooldown
Further, specifying the channel and ending a line with the semicolon just eats up macro space and is not necessary.

Number - The time when the cooldown started (as returned by GetTime()); zero if no cooldown; current time if (enabled == 0).

__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.This is your permission slip.

Weird. I went back and tried 8 second long and 120 second long cooldowns and it always resets the returned values to 0, 0, 1

(As it should)

<Edit>

Oh should have said that instead of
not select(2,GetSpellCooldown(s))
you use
GetSpellCooldown(s)==0

__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.This is your permission slip.

Not that it matters, but I liked the idea of the "improved?" version, where it checks if you can cast it. Would it be possible to check if you *did* cast it?

If you're gonna take it any further you might as well monitor the combat log for the cast instead. That's what I do with my announcements.

__________________
I stopped playing back World of Warcraft in 2010 and I have no plans on returning.
This is a dead account and if you want to continue any of my addons or make a fork then feel free to do so.This is your permission slip.

And a macro cannot do anything like this - you would need an addon. An entire macro and its scripts are run all in a single frame draw (if you have 60fps, it takes 1/60th of a second to run it). There is absolutely no way for a macro to know if the spell it contains WAS successful.

__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

#showtooltip
/cast Growl
/run if not yyz then yyz=CreateFrame("Frame")yyz:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")yyz:SetScript("OnEvent",function(a,b,c,d,e)if c=="player"and d=="Growl"then SendChatMessage("AEONFLUX IS A ****TY NAME TAUNTED")end end)end