API:GetHotbarName
From RoR Wiki
UI Lua API · Hotbar functions
Version: WAR 1.4.8
Returns the name of the action in a hotbar slot.
name = GetHotbarName(slot)
Arguments
- slot
number– Hotbar slot, 1 to 132 (GameData.HOTBAR_TOTAL_SLOT_COUNT).
Returns
- name
wstring– Name of the action, orL"".
Details
- The name is looked up according to the action type: abilities (types 1 and 10) use the
AbilityNamesstring table, macros (type 4) the macro name, and type 2 a name the client keeps for that id. Other types, empty slots and slots outside 1 to 132 giveL"". - If there is no player object, or the Lua state is not available, the function returns nothing.
- The stock UI never calls this function.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
A minimal example built from the signature:
local name = GetHotbarName( 1 )
if( name ~= L"" ) then
LabelSetText( "MyLabel", name )
end
