Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Required API's
- local component = require "component"
- local serialization = require "serialization"
- local sides = require "sides"
- --adapter is connected to an ME controller, and export bus.
- local me = component.me_controller
- --export bus is has a redstone card set so it doesn't auto-export
- local bus = component.me_exportbus
- --adapter has an database upgrade
- local db = component.database
- --Loop over items in the me network
- for key,item in ipairs(me.getItemsInNetwork()) do
- --print out each item for debugging; serializing to see the entire data table
- print(item.name.." :: "..serialization.serialize(me.getItemsInNetwork(item)))
- --Use the item as a filter to find an item in the me network, and store its
- --itemstack data into the database
- me.store(item,db.address,1,1)
- --configure the export bus to export that item
- bus.setExportConfiguration(sides.left,1,db.address,1)
- --trigger an export
- bus.exportIntoSlot(sides.left,1)
- --clear out the database entry. Might not be needed...
- db.clear(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment