Reply
Thread Tools Display Modes
Unread 04-12-08, 08:53 PM   #1
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 131
GetSpellCooldown() work with SpellIDs?

I know it says it does on WoWWiki, but when I was testing this out:
Code:
GetSpellCooldown(28734)
it returned nil, however
Code:
GetSpellCooldown("Mana Tap")
worked just fine. Can anyone verify this please?
ganders is offline   Reply With Quote
Unread 04-12-08, 09:06 PM   #2
Taffu
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 149
Make sure the spellID is valid. The API call can accept Spell Name or spellID.
Taffu is offline   Reply With Quote
Unread 04-12-08, 09:09 PM   #3
Shirik
Blasphemer!
Premium Member
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2007
Posts: 818
Mana tap's spell ID is 28734, hence his question. I can confirm this behavior.

EDIT: After review, GetSpellCooldown does not take a spell ID. It takes a slot ID. Check the slot ID of Mana Tap. If you must go by ID, I recommend using GetSpellInfo() to get its name, then proceed to pass the name to GetSpellCooldown:

Code:
GetSpellCooldown((GetSpellInfo(28734)))
Note the extra parentheses are intentional and required for proper operation.

EDIT2: You beat me
__________________
たしかにひとつのじだいがおわるのお
ぼくはこのめでみたよ
だけどつぎがじぶんおばんだってことわ
しりたくなかったんだ
It's my turn next.

Shakespeare liked regexes too!
/(bb|[^b]{2})/

Last edited by Shirik : 04-12-08 at 09:14 PM.
Shirik is offline   Reply With Quote
Unread 04-12-08, 09:12 PM   #4
ganders
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 131
Originally Posted by Shirik View Post
Mana tap's spell ID is 28734, hence his question. I can confirm this behavior.

EDIT: After review, GetSpellCooldown does not take a spell ID. It takes a slot ID. Check the slot ID of Mana Tap.
Yup I finally figured this out after A LOT of testing.

I ended up just using
Code:
local name = GetSpellInfo(28730)
local start, duration, enable = GetSpellCooldown(name)
and that does the trick.
ganders is offline   Reply With Quote
Reply

Go BackWoWInterface » Developer Discussions » General Authoring Discussion » GetSpellCooldown() work with SpellIDs?

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