Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local me = peripheral.wrap("right")
- local list = me.getAvailableItems()
- local itemID = ""
- local amt = 0
- local maxAmt = 0
- -- Functions
- function export(itemID, amt)
- local amt = amt
- for number, item in pairs(list) do
- if item.fingerprint.id == itemID then
- if amt > 64 then
- while amt > 64 do
- me.exportItem(item.fingerprint, "SOUTH", amt)
- amt = amt - 64
- end
- me.exportItem(item.fingerprint, "SOUTH", amt)
- else
- me.exportItem(item.fingerprint, "SOUTH", amt)
- end
- end
- end
- end
- function exportExcess(itemID, maxAmt)
- list = me.getAvailableItems()
- for number, item in pairs(list) do
- if item.fingerprint.id == itemID then
- if item.size > maxAmt then
- print("Condensing "..item.size-maxAmt.." "..itemID)
- export(itemID, item.size-maxAmt)
- end
- end
- end
- end
- -- Main code
- while true do
- term.clear()
- term.setCursorPos(1,1)
- exportExcess("minecraft:cobblestone", 500000)
- os.sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment