Advertisement
100Toby1

Untitled

Mar 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 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 autoRefuel()
  12. if turtle.getFuelLevel() <= 80 do
  13. turtle.refuel()
  14. end
  15. end
  16.  
  17. function dropAllItems()
  18. for i = 1, 16 do
  19. turtle.select(i)
  20. turtle.drop()
  21. end
  22. end
  23.  
  24. while true do
  25. while getItemSlots() > 0 do
  26. while turtle.dig() do end
  27. while turtle.digUp() do end
  28. autoRefuel()
  29. turtle.forward()
  30. end
  31. --Turtle ran out of space
  32. turtle.turnRight()
  33. turtle.turnRight()
  34. --Turn Back
  35. while true do
  36. local _,data = turtle.inspect()
  37. if data.name == "minecraft:chest" then break end
  38. autoRefuel()
  39. turtle.forward()
  40. end
  41. dropAllItems()
  42. turtle.turnRight()
  43. turtle.forward()
  44. turtle.turnRight()
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement