WoW:API GetActionCooldown: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Updated formatting)
Line 1: Line 1:
<center>'''GetActionCooldown''' ''-Documentation by Sarf-''</center>
<center>'''GetActionCooldown''' - ''Documentation by Sarf''</center>


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 ==
=== Arguments ===
:(slot)


;
:;slot : Integer - The action slot to retrieve data from.
=== Returns ===
: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.
;''Arguments''
:;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. (Exactly what this is for is slightly unclear).
:(Number actionID)
== Example ==
 
<!-- begin code -->
:;actionID : The ID of the action button to retrieve cooldown data for
  local start, duration, enable = GetActionCooldown(slot);
 
  if ( start &gt; 0 and duration &gt; 0 and enable &gt; 0) then
----
;''Returns''
 
:(Number startTime, Number duration, Number enable)
 
:;startTime : The time when the cooldown started (as returned by [[API GetTime|GetTime()]]) or zero if no cooldown
:;duration : The number of seconds the cooldown will last, or zero if no cooldown
:;enable : seems to always be 1
 
----
;''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
  else
  -- do stuff when cooldown is not active
  -- 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)
 
----
----
__NOTOC__
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API Functions|GetActionCooldown]]
[[Category:API Action Functions|GetActionCooldown]]
[[Category:API Action Functions|GetActionCooldown]]

Revision as of 01:58, 20 September 2005

GetActionCooldown - Documentation by Sarf

Retrieves the cooldown data of the action specified.

start, duration, enable = GetActionCooldown(slot)

Parameters

Arguments

(slot)
slot
Integer - The action slot to retrieve data from.

Returns

start, duration, enable
start
Number - The time at which the current cooldown period began (Relative to the result of GetTime), or 0 if the cooldown is not active or not applicable.
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. (Exactly what this is for is slightly unclear).

Example

local start, duration, enable = GetActionCooldown(slot);
if ( start > 0 and duration > 0 and enable > 0) then
	-- do stuff when cooldown is under effect
else
	-- do stuff when cooldown is not active
end

Template:WoW API