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 |
Code:
/script local _, duration, _ = GetSpellCooldown("Shield Wall"); if duration == 0 then SendChatMessage("Shield Wall: -60%dmg 12 sec") end |
#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! |
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 |
As I said, you're welcome. ;)
Quote:
Further, specifying the channel and ending a line with the semicolon just eats up macro space and is not necessary. Conclusion: Code:
#showtooltip |
Ah yeah that's pretty stupid :p 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.
|
Improved?
Code:
#showtooltip |
Why use select(2, xxx) at all?
The first argument is 0 if it's not on cooldown. Quote:
|
Quote:
|
Quote:
(As it should) <Edit> Oh should have said that instead of not select(2,GetSpellCooldown(s)) you use GetSpellCooldown(s)==0 |
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?
This is obviously untested, but here's the basic idea: /script wasNotOnCooldown=(GetSpellCooldown(s)==0) /cast Shield Wall /script if (wasNotOnCooldown&& GetSpellCooldown(s)~=0) SendChatMessage... Question is whether we can force a variable to be globally (or macro-level) bound from a /script call, and I don't remember the WoW-Lua variable bounding rules for macros... :) |
Quote:
|
Quote:
|
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.
|
Quote:
|
From the ui macro wow forums:)
#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 Here's the original thread: http://forums.worldofwarcraft.com/th...sid=1&pageNo=1 |
If you want to go that route, why not just put in 30 seconds of extra effort and make it a real addon?
|
Quote:
If you want an addon try Nutty War Announce. It is aimed at warriors and does loads of announcements. Fully configurable also. http://www.wowinterface.com/download...rAnnounce.html |
All times are GMT -6. The time now is 05:17 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI