Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. function setup()
  2. turtle.refuel()
  3. end
  4.  
  5. function goFront()
  6. if turtle.detect() then
  7. local success, data = turtle.inspect()
  8. if success then
  9. if data.name == "minectaft:water" or data.name == "minecraft:lava" then
  10. turtle.select(3)
  11. turtle.place()
  12. turtle.select(1)
  13. end
  14. end
  15. turtle.dig()
  16. end
  17. turtle.forward()
  18. if turtle.detectUp() then
  19. local success, data = turtle.inspectUp()
  20. if data.name == "minectaft:water" or data.name == "minecraft:lava" then
  21. turtle.select(3)
  22. turtle.placeUp()
  23. turtle.select(1)
  24. end
  25. turtle.digUp()
  26. end
  27. if turtle.detectDown() then
  28. local success, data = turtle.inspectDown()
  29. if data.name == "minectaft:water" or data.name == "minecraft:lava" then
  30. turtle.select(3)
  31. turtle.placeDown()
  32. turtle.select(1)
  33. end
  34. turtle.digDown()
  35. end
  36. end
  37.  
  38. function mainLoop()
  39. setup()
  40. while turtle.getFuelLevel() > 1 do
  41. print(turtle.getFuelLevel())
  42. goFront()
  43. turtle.turnLeft()
  44. for i = 10,1,-1 do
  45. goFront()
  46. end
  47. turtle.turnLeft()
  48. turtle.turnLeft()
  49. for i = 21,1,-1 do
  50. goFront()
  51. end
  52. turtle.turnLeft()
  53. turtle.turnLeft()
  54. for i = 11,1,-1 do
  55. goFront()
  56. end
  57. turtle.turnRight()
  58. goFront()
  59. goFront()
  60. turtle.select(2)
  61. turtle.turnLeft()
  62. turtle.dig()
  63. turtle.place()
  64. turtle.turnRight()
  65. end
  66. mainLoop()
  67. end
  68. goFront()
  69. mainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement