API:ItemContainerLootItem
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Picks one item from an opened item container (a "choose one" loot bag from the backpack) and closes the choice.
ItemContainerLootItem(choiceIndex)
Arguments
- choiceIndex
number– Position of the chosen item in the list from GameData.InteractData.GetItemLootList, starting at 1.
Returns
Nothing.
Details
- If the index is inside the container's list, the client sends the server a request to use the container with that choice. Nothing is sent if no item container is open, the index is outside the range the client stored for the container, or the connection is not ready.
- Only the low byte of
choiceIndexis used for the range check. - After the call, the client clears its stored item-container loot list, whether or not a request was sent. GameData.InteractData.GetItemLootList returns an empty table until the server sends a new list.
- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a number.
Example
From default/ea_lootwindow/source/chooseonelootwindow.lua:
elseif(EA_Window_ChooseOneLoot.lootType == EA_Window_ChooseOneLoot.LOOT_TYPE_ITEM_CONTAINER)
then
ItemContainerLootItem( EA_Window_ChooseOneLoot.currentlySelectedChoice )
end
EA_Window_ChooseOneLoot.Hide()
