WoW:API GetSpellCooldown: Difference between revisions

m
bookType rather than tabNumber
No edit summary
m (bookType rather than tabNumber)
Line 1: Line 1:
Retrieves the cooldown data of the spell specified.
Retrieves the cooldown data of the spell specified.


  local start, duration = GetSpellCooldown(spellID, spellnumTab);
  local start, duration = GetSpellCooldown(spellID, "bookType");


;
;
Line 12: Line 12:
:;spellID : The ID of the spell to retrieve cooldown data for
:;spellID : The ID of the spell to retrieve cooldown data for


:(Number spellnumTab)
:(string bookType)


:;spellnumTab : The tab within your spellbook, ignore empty slots. As of 1.41 this argument appears to be required, but not used.
:;bookType : BOOKTYPE_SPELL or BOOKTYPE_PET depending on whether you wish to query the player or pet spellbook.


----
----
Line 28: Line 28:
----
----
;''Example''
;''Example''
  local start, duration = GetSpellCooldown(spellID, spellnumTab);
  local start, duration = GetSpellCooldown(spellID, BOOKTYPE_SPELL);
  if ( start > 0 and duration > 0) then
  if ( start > 0 and duration > 0) then
  Print('Please wait ' .. duration - ( GetTime() - start) .. ' seconds before using this spell.');
  Print('Please wait ' .. duration - ( GetTime() - start) .. ' seconds before using this spell.');