LibCooldownTracker-1.0

API

r3

lib:GetCooldownData(spellid)

Returns the raw data of a specified cooldown spellid.

Parameters

spellid
The cooldown spellid.


lib:GetCooldownsData()

Returns the raw data of all the cooldowns.
See the cooldowns_*.lua data files for more details about its structure.


lib:GetUnitCooldownInfo(unitid, spellid)

Returns a table with the state of a unit's cooldown, or nil if there is no state stored about it.

Parameters

unitid
The unit unitid.
spellid
The cooldown spellid.

Usage

local tracked = lib:GetUnitCooldownInfo(unitid, spellid)
if tracked then
    print(tracked.cooldown_start) -- times are based on GetTime()
    print(tracked.cooldown_end)
    print(tracked.used_start)
    print(tracked.used_end)
    print(tracked.detected) -- use this to check if the unit has used this spell before (useful for detecting talents/glyphs)
end


lib:IterateCooldowns(class, specID, race)

Iterates over the cooldowns that apply to a unit of the specified class, specID and race.

Parameters

class
The unit class. Can be nil.
specID
The unit talent spec ID. Can be nil.
race
The unit race. Can be nil.


lib:RegisterUnit(unitid)

Registers an unit to be tracked by the library.

Parameters

unitid
The unitid to register.


lib:UnregisterUnit(unitid)

Unregisters an unit.
While the same unit may be registered more than once, it is important that UnregisterUnit is called exactly once for each call to RegisterUnit.

Parameters

unitid
The unitid to unregister.