Advertisement
100Toby1

Untitled

Mar 22nd, 2018
90
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.  
  21. while true do if not turtle.dig() then break end end
  22. while true do if not turtle.digUp() then break end end
  23. turtle.forward()
  24. end
  25. --Turtle ran out of space
  26. turtle.turnRight()
  27. turtle.turnRight()
  28. --Turn Back
  29. while turtle.inspect.name ~= "minecraft:chest" do
  30. turtle.forward()
  31. end
  32. dropAllItems()
  33. turtle.turnRight()
  34. turtle.turnRight()
  35. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement