I present to you an API that allows simplified reading of stacks in an Interactive Sorter from Misc Peripherals, It returns an array of tables, each with the following fields:
- id The ID of the item stack, the actual ID, not the Unique Identifier
- meta The metadata of the item, this is nil if the item takes damage
- amount The size of the stack of items.
Here's the code:
http://pastebin.com/dUh038df
Basically you call getStacks with the direction of the Interactive Sorter and then the direction of the inventory, for example
getStacks("front", "up") and that will return an array of stack tables from the inventory above the peripheral, with id, metadata and count.
Should be self explanatory, ENJOY!
I've also updated the source to have a getUID function that will return the uuid for the id and meta, as I believe you need it for the extract
-NeverCast
(ps. don't forget to up vote me if you likey, thanks )
Updated a couple times thanks to the people commenting below with fixes, You're wonderful!