Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetHotbarCooldown

From RoR Wiki

UI Lua API · Hotbar functions
Version: WAR 1.4.8

Returns the cooldown of the action in a hotbar slot.

cooldown, maxCooldown = GetHotbarCooldown(slot)

Arguments

slot
number – Hotbar slot, 1 to 132 (GameData.HOTBAR_TOTAL_SLOT_COUNT).

Returns

cooldown
number – Time left, in seconds.
maxCooldown
number – Total length of that cooldown, in seconds.

Details

  • For abilities the client takes whichever runs longest of the global cooldown, the morale cooldown (for morale abilities) and the ability's own cooldown, and returns its time left and length. For items (type 2) it uses the item's cooldown data.
  • Some action types have no cooldown and return 0, 0. An empty slot also returns 0, 0.
  • If the slot holds an action type the cooldown code does not handle (types other than 0, 1, 2, 4, 7, 9 and 10), the client clears the slot.
  • For a slot outside 1 to 132 the result is 0, 0.
  • If there is no player object, or the Lua state is not available, the function returns nothing.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From ea_actionbars/source/actionbutton.lua:

self.m_Cooldown, self.m_MaxCooldown = GetHotbarCooldown (self:GetSlot ())

See also