WoW:API GetActionCooldown: Difference between revisions
Jump to navigation
Jump to search
GetActionCooldown - Documentation by Sarf
No edit summary |
m (Updated formatting) |
||
Line 1: | Line 1: | ||
<center>'''GetActionCooldown''' - ''Documentation by Sarf''</center> | |||
Retrieves the cooldown data of the action specified. | 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 [[API GetTime|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 == | ||
<!-- begin code --> | |||
local start, duration, enable = GetActionCooldown(slot); | |||
if ( start > 0 and duration > 0 and enable > 0) then | |||
:;duration : The | |||
:;enable : | |||
---- | |||
local start, duration, enable = GetActionCooldown( | |||
if ( start | |||
-- 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 --> | |||
---- | |||
---- | ---- | ||
__NOTOC__ | |||
{{Template:WoW API}} | {{Template:WoW API}} | ||
[[Category:API Action Functions|GetActionCooldown]] | [[Category:API Action Functions|GetActionCooldown]] |
Revision as of 01:58, 20 September 2005
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