Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local slot = 1
- local message = ""
- function checkSlot()
- if turtle.getItemCount(slot) ~= 0 then
- return true
- else
- for i = slot, 12 do
- if turtle.getItemCount(i) > 0 then
- turtle.select(i)
- slot = i
- return true
- end
- end
- return false
- end
- end
- function HasItems()
- for i = 1, 12 do
- if turtle.getItemCount(i) > 0 then
- return true
- end
- end
- return false
- end
- local run = true
- turtle.select(slot)
- while run do
- while turtle.forward() do
- --turtle will move forward to a chest
- end
- --check to see if chest is empty
- if turtle.suck() then
- while turtle.suck() do
- --fill turtle inventory
- end
- else
- --chest is empty
- run = false
- message = "chest A ran out of items"
- end
- turtle.turnRight()
- turtle.turnRight()
- while turtle.forward() do
- --move to next chest
- end
- --cycle through turtles inventory
- while checkSlot() do
- --if turtle cant drop an item, chest is full
- if turtle.drop() == false and hasItems() then
- message = "chest B ran out of space"
- run = false
- end
- end
- --turn around
- turtle.turnRight()
- turtle.turnRight()
- end
Add Comment
Please, Sign In to add comment