GetActionCooldown

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.0.0 / 1.13.2

Returns cooldown info for the specified action slot.

start, duration, enable, modRate = GetActionCooldown(slot)

Arguments

slot
number - The action slot to retrieve data from.

Returns

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 could be 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.
modRate
number - The rate at which the cooldown widget's animation should be updated.

Example

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

Patch changes

Legion Patch 7.1.0 (2016-10-25): The modRate return value was added.
Warlords of Draenor Patch 6.2.0 (2015-06-23): The charges and maxCharges return values were removed. They were moved to GetActionCharges.