spoil_priority parameter for LuaInventory:remove()

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
LeonSkills
Inserter
Inserter
Posts: 32
Joined: Mon Feb 11, 2019 12:37 pm
Contact:

spoil_priority parameter for LuaInventory:remove()

Post by LeonSkills »

I'd like to remove spoilable items from inventories prioritised by their spoilage level, similar to the functionality of inserters.

I could write a function to loop over all the item stacks, filter for the item I'm looking for, and sort them by spoil time.
But I wonder since the functionality already exists for inserters, that it might be possible to expose this in the LuaInventory:remove method.

So a
LuaInventory:remove(items, spoil_priority), with spoil_priority of type SpoilPriority, defaulting to "none".

Additionally (or instead), a LuaInventory:find_item_stack(item, spoil_priority), could work as well.
Post Reply

Return to “Modding interface requests”