Advertisement
melzneni

Untitled

Feb 4th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. meal=16
  2. sapp=15
  3.  
  4. function digForward(c)
  5. for i=1,c do
  6. turtle.dig()
  7. turtle.forward()
  8. end
  9. end
  10.  
  11. function digArea()
  12. digForward(2)
  13. turtle.turnRight()
  14. digForward(2)
  15. turtle.turnRight()
  16. digForward(4)
  17. turtle.turnRight()
  18. digForward(4)
  19. turtle.turnRight()
  20. digForward(4)
  21. turtle.turnRight()
  22. digForward(1)
  23. turtle.turnRight()
  24. digForward(3)
  25. turtle.turnLeft()
  26. digForward(2)
  27. turtle.turnLeft()
  28. digForward(1)
  29. turtle.turnLeft()
  30. digForward(1)
  31. turtle.turnRight()
  32. end
  33.  
  34.  
  35. while true do
  36.  
  37. turtle.select(sapp)
  38. if turtle.getItemCount()==0 then
  39. turtle.back()
  40. turtle.turnRight()
  41. turtle.suck()
  42. turtle.turnLeft()
  43. turtle.forward()
  44. end
  45.  
  46. turtle.select(sapp)
  47. if turtle.compare() then
  48. turtle.select(meal)
  49. if turtle.getItemCount()==0 then
  50. turtle.back()
  51. turtle.turnLeft()
  52. turtle.suck()
  53. turtle.turnRight()
  54. turtle.forward()
  55. end
  56. turtle.place()
  57. elseif turtle.detect() then
  58. turtle.dig()
  59. turtle.forward()
  60.  
  61. for i=1,9 do
  62. turtle.select(1)
  63. detect=turtle.compareUp()
  64. turtle.select(sapp)
  65. turtle.digUp()
  66. turtle.up()
  67. if i>1 and i<8 and detect and turtle.detect() then
  68. digArea()
  69. end
  70. end
  71.  
  72. for i=1,9 do
  73. turtle.down()
  74. end
  75. turtle.back()
  76. turtle.back()
  77. turtle.turnLeft()
  78. turtle.turnLeft()
  79. turtle.select(1)
  80. turtle.drop()
  81. turtle.turnLeft()
  82. turtle.turnLeft()
  83. turtle.forward()
  84. else
  85. turtle.place()
  86. end
  87.  
  88.  
  89. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement