Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Sort
- -- by SukaiPoppuGo
- -- required mod Plethora
- local target = ... or "not set"
- local delay = 2
- os.setComputerLabel("Sort")
- local chest = peripheral.find(target)
- assert(chest, string.format("Peripheral \"%s\" not found", target))
- os.loadAPI("listItem.lua")
- assert(listItem, "Require list API")
- local function loop()
- for slot, item in pairs(chest.list()) do
- local dest, msg = listItem.get(item)
- if dest then
- if chest.pushItems(dest,slot) then
- print(string.format("Move %s to %s (%s)", item.name, dest, msg))
- else
- print(string.format("Fail to move %s to %s (%s)", item.name, dest, msg))
- end
- else
- print(string.format("Not supported: %s", item.name))
- end
- end
- end
- while true do
- loop()
- sleep(delay)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement