Advertisement
100Toby1

Untitled

Mar 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function getItemSlots()
  2. local slots = 16
  3. for i = 1, 16 do
  4. if turtle.getItemCount(i) > 0 then
  5. slots = slots - 1
  6. end
  7. end
  8. return slots
  9. end
  10.  
  11. function dropAllItems()
  12. for i = 1, 16 do
  13. turtle.select(i)
  14. turtle.drop()
  15. end
  16. end
  17.  
  18. while true do
  19. while getItemSlots() > 0 do
  20. while turtle.dig() do end
  21. while turtle.digUp() do end
  22. turtle.forward()
  23. end
  24. --Turtle ran out of space
  25. turtle.turnRight()
  26. turtle.turnRight()
  27. --Turn Back
  28. while true do
  29. local _,data = turtle.inspect
  30. if data.name ~= "minecraft:chest" then break end
  31. turtle.forward()
  32. end
  33. dropAllItems()
  34. turtle.turnRight()
  35. turtle.turnRight()
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement