WoW:API GetActionCooldown: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
Line 23: Line 23:
  else
  else
  -- do stuff when cooldown is not active
  -- do stuff when cooldown is not active
end
<!-- end code -->
or
<!-- begin code -->
local start, duration, enable = GetActionCooldown(slot);
if ( start == 0 ) then
-- do stuff when cooldown is not active
else
-- do stuff when cooldown is under effect
  end
  end
<!-- end code -->
<!-- end code -->

Revision as of 14:09, 19 July 2006

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. (Lets you know when a shapeshifting form has ended and the actual countdown has started).

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

or

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

Template:WoW API