WoW:API GetActionCooldown: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 27: Line 27:
  local start, duration, enable = GetActionCooldown(v.id);
  local start, duration, enable = GetActionCooldown(v.id);
  if ( start > 0 and duration > 0 and enable > 0) then
  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



Revision as of 10:29, 17 March 2005

GetActionCooldown -Documentation by Sarf-

Retrieves the cooldown data of the action specified.

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

Arguments
(Number actionID)
actionID
The ID of the action button to retrieve cooldown data for

Returns
(Number startTime, Number duration, Number enable)
startTime
The time when the cooldown started (as returned by GetTime()) or zero if no cooldown
duration
The number of seconds the cooldown will last, or zero if no cooldown
enable
0 if no cooldown, 1 if cooldown is in effect (probably)

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
else
	-- do stuff when cooldown is not active
end
Result

Retrieves data. Does not (to my knowledge) actually change anything.


Description
Retrieves data on the cooldown on a specific action button.

Template:WoW API