API:GameData.InteractData.GetLootableItem
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Returns one item of the loot list of the corpse or object the player is looting.
item = GameData.InteractData.GetLootableItem(index)
Arguments
- index
number– Position of the item in the loot list, starting at 0.
Returns
- item
table– An item data table, or nothing ifindexis outside the list.
Details
- Unlike most list functions, the index is zero-based:
GetLootableItem(0)returns the first entry of GameData.InteractData.GetLootList, which is[1]in the table from that function. - If the Lua state is not available, the function returns nothing.
- The stock UI never calls this function.
- Exactly one argument must be passed.
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 first = GameData.InteractData.GetLootableItem( 0 )
if first ~= nil then
LabelSetText( "MyLootLabel", first.name )
end
