Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetHotbarData

From RoR Wiki

UI Lua API · Hotbar functions
Version: WAR 1.4.8

Returns the action in a hotbar slot and its current state.

actionType, actionId, isEnabled, isTargetValid, isBlocked = GetHotbarData(slot)

Arguments

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

Returns

actionType
number – Type of the action, a GameData.PlayerActions value. 0 for an empty slot.
actionId
number – Id of the action (ability id, item id, macro slot, …). 0 for an empty slot.
isEnabled
boolean – State flag of the slot. The stock action buttons use it as "enabled".
isTargetValid
boolean – State flag of the slot. The stock action buttons use it as "target valid".
isBlocked
boolean – State flag of the slot. The stock action buttons use it as "blocked".

Details

  • The three flags are kept by the client per hotbar entry and read here; the function does not run the ability checks itself.
  • For a slot outside 1 to 132 the type and id are 0 and all three flags are true.
  • 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:

if( actionType == nil or actionId == nil )
then
    actionType, actionId, self.m_IsEnabled, self.m_IsTargetValid, self.m_IsBlocked = GetHotbarData( slot )
end

See also