Thread Tools Display Modes
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?
  Reply With Quote
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.
  Reply With Quote
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.
  Reply With Quote
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.
  Reply With Quote

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


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