API:LootItem
From RoR Wiki
UI Lua API · Loot functions
Version: WAR 1.4.8
Asks the server to give the player one item from the open loot window.
LootItem(lootIndex)
Arguments
- lootIndex
number– Position of the item in the current loot list, starting at 1.
Returns
Nothing.
Details
- If
lootIndexis outside the current loot list (less than 1 or greater than the number of entries), nothing happens. - Otherwise a loot request for that item is sent to the server for the object the player last interacted with (the corpse or container whose loot is open).
- Nothing is sent if there is no such object or the connection is not ready.
- The client does not warn about bind-on-pickup items. The stock loot window does that itself before calling
LootItem. - 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/lootwindow.lua:
if( EA_Window_Loot.WarnBindOnPickUp( lootIndex ) )
then
return
end
LootItem( lootIndex )
