Reply
 
Thread Tools Display Modes
Unread 08-16-10, 04:25 PM   #1
SannaSK
An Aku'mai Servant
Join Date: Oct 2008
Posts: 33
Only /say if ability is off CD?

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.

So, instead of spamming
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec
Shield Wall: -60%dmg 12 sec

and making the healers wonder if it's working at all, it would only happen once.

Simple macros I get. This, I don't get enough to figure out out : x. Thanks in advance for any help \o !

-- Sanna
SannaSK is offline   Reply With Quote
Unread 08-16-10, 05:01 PM   #2
ra1d3n
A Cyclonian
 
ra1d3n's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 44
Code:
/script local _, duration, _ = GetSpellCooldown("Shield Wall");  if duration == 0 then SendChatMessage("Shield Wall: -60%dmg 12 sec") end

/use Shield Wall
You're welcome.
ra1d3n is offline   Reply With Quote
Unread 08-16-10, 05:02 PM   #3
Motig
A Fallenroot Satyr
 
Motig's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 23
#showtooltip
/cast Shield Wall
/script if select(2, GetSpellCooldown('Shield Wall')) == 0 then SendChatMessage("Shield Wall: -60%dmg 12 sec", 'SAY'); end

Edit:
Awww beaten to it!

Last edited by Motig : 08-16-10 at 05:07 PM.
Motig is offline   Reply With Quote
Unread 08-16-10, 09:35 PM   #4
SannaSK
An Aku'mai Servant
Join Date: Oct 2008
Posts: 33
Many cheers to the both of you! Thanks a ton! No way in tar would I have been able to put that together on my own. Yaaay \o/

-- Sanna
SannaSK is offline   Reply With Quote
Unread 08-16-10, 10:18 PM   #5
ra1d3n
A Cyclonian
 
ra1d3n's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 44
As I said, you're welcome.

Originally Posted by Motig View Post
#showtooltip
/cast Shield Wall
/script if select(2, GetSpellCooldown('Shield Wall')) == 0 then SendChatMessage("Shield Wall: -60%dmg 12 sec", 'SAY'); end

Edit:
Awww beaten to it!
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.

Conclusion:
Code:
#showtooltip
/script if select(2, GetSpellCooldown('Shield Wall')) == 0 then SendChatMessage("Shield Wall: -60%dmg 12 sec") end
/cast Shield Wall
Warning, haven't tested this last iteration.
ra1d3n is offline   Reply With Quote
Unread 08-17-10, 06:05 AM   #6
Motig
A Fallenroot Satyr
 
Motig's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2010
Posts: 23
Ah yeah that's pretty stupid I must've moved it up after testing it! I figured I'd include the channel name in case the OP wanted to change it sometime in the future though.
Motig is offline   Reply With Quote
Unread 08-26-10, 04:07 AM   #7
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 765
Improved?

Code:
#showtooltip
/run local s=GetSpellInfo(871)if HasFullControl()and IsUsableSpell(s)and not select(2,GetSpellCooldown(s))then SendChatMessage(s..": -60%dmg 12sec","SAY")end
/cast Shield Wall
Vlad is offline   Reply With Quote
Unread 08-26-10, 04:49 AM   #8
v6o
An Onyxian Warder
AddOn Author - Click to view addons
Join Date: Mar 2009
Posts: 399
Why use select(2, xxx) at all?

The first argument is 0 if it's not on cooldown.

Number - The time when the cooldown started (as returned by GetTime()); zero if no cooldown; current time if (enabled == 0).
__________________
I have very little time to play WoW and even less time to code addons. As such I've dropped all development of all my addons. If you want to continue any addon or make a fork then feel free to do so. This is your permission slip.

Best regards, Valle.
v6o is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » Macro Help » Only /say if ability is off CD?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off