Advertisement
100Toby1

Untitled

Mar 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 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.inspect().name ~= "minecraft:air" do
  21. turtle.dig()
  22. end
  23. while turtle.inspectUp().name ~= "minecraft:air" do
  24. turtle.digUp()
  25. end
  26. turtle.forward()
  27. end
  28. --Turtle ran out of space
  29. turtle.turnRight()
  30. turtle.turnRight()
  31. --Turn Back
  32. while turtle.inspect.name ~= "minecraft:chest" do
  33. turtle.forward()
  34. end
  35. dropAllItems()
  36. turtle.turnRight()
  37. turtle.turnRight()
  38. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement