Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chestOrder = 1
- local enderchest1 = 15
- local enderchest2 = 16
- function scanInv()
- local invList = {}
- for i = 1,16 do
- turtle.select(i)
- local item = turtle.getItemDetail()
- if item then
- invList[i] = item.name
- end
- end
- return invList
- end
- function ParseInv(invList)
- turtle.select(16)
- turtle.dropUp()
- while turtle.suck() do
- local item = turtle.getItemDetail()
- for i =1,16 do
- if item.name == invList[i] then
- turtle.transferTo(i)
- break
- end
- if item.name == "minecraft:lava_bucket" or item.name == "minecraft:coal" then
- turtle.refuel(64)
- end
- end
- turtle.dropUp()
- end
- end
- function EnderChests(action)
- --action = 'set' or 'gather'
- if action == "set" then
- turtle.select(enderchest1)
- turtle.place()
- turtle.select(enderchest2)
- turtle.placeUp()
- elseif action == "gather" then
- if chestOrder == 1 then
- turtle.select(enderchest1)
- turtle.digUp()
- turtle.select(enderchest2)
- turtle.dig()
- chestOrder = 2
- elseif chestOrder == 2 then
- turtle.select(enderchest1)
- turtle.dig()
- turtle.select(enderchest2)
- turtle.digUp()
- chestOrder = 1
- end
- end
- end
- local inventory = scanInv()
- for i = 1,4 do
- EnderChests("set")
- ParseInv(inventory)
- EnderChests("gather")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement