WoW:API GetActionCooldown: Difference between revisions

m
Move page script moved page API GetActionCooldown to WoW:API GetActionCooldown without leaving a redirect
No edit summary
m (Move page script moved page API GetActionCooldown to WoW:API GetActionCooldown without leaving a redirect)
 
(6 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<center>'''GetActionCooldown''' ''-Documentation by Sarf-''</center>
{{wowapi}} __NOTOC__


Retrieves the cooldown data of the action specified.
Retrieves the [[cooldown]] data of the action specified.


  local start, duration, enable = GetActionCooldown(v.id);
  start, duration, enable = GetActionCooldown(slot)


;
== Parameters ==
<big>'''Arguments'''</big>


----
:;slot : Integer - The [[ActionSlot|action slot]] to retrieve data from.
;''Arguments''


:(Number actionID)
<big>'''Returns'''</big>


:;actionID : The ID of the action button to retrieve cooldown data for
:start, duration, enable


----
:;start : Number - The time at which the current cooldown period began (relative to the result of [[API GetTime|GetTime]]), or 0 if the cooldown is not active or not applicable.
;''Returns''
:;duration : Number - The duration of the current cooldown period in seconds, or 0 if the cooldown is not active or not applicable.
:;enable : Number - Indicate if cooldown is enabled, is greater than 0 if a cooldown is active, and 0 if a cooldown cannot be active. This lets you know when a shapeshifting form has ended and the actual countdown has started.


:(Number startTime, Number duration, Number enable)
== Example ==
 
<!-- begin code -->
:;startTime : The time when the cooldown started (as returned by [[API GetTime|GetTime()]]) or zero if no cooldown
  local start, duration, enable = GetActionCooldown(slot);
:;duration : The number of seconds the cooldown will last, or zero if no cooldown
  if ( start == 0 ) then
:;enable : seems to always be 1
-- do stuff when cooldown is not active
 
else
----
;''Example''
  local start, duration, enable = GetActionCooldown(v.id);
  if ( start > 0 and duration > 0 and enable > 0) then
  -- do stuff when cooldown is under effect
  -- do stuff when cooldown is under effect
else
-- do stuff when cooldown is not active
  end
  end
 
<!-- end code -->
;''Result''
 
Retrieves data. Does not (to my knowledge) actually change anything.
 
----
;''Description''
 
: Retrieves data on the cooldown on a specific action button.
----
(This doesn't seem to work in Macros (or perhaps not at all) it always triggers the "not active" part.
Crash 19:09 05-06-2005)
 
----
{{Template:WoW API}}
[[Category:API Functions|GetActionCooldown]]
[[Category:API Action Functions|GetActionCooldown]]
2,434

edits