Advertisement
ravensniper72

12x12 auto Turtle Farm CC

Dec 12th, 2020 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. --Functions
  2. local function right()
  3. turtle.forward()
  4. turtle.turnRight()
  5. turtle.forward()
  6. turtle.turnRight()
  7. end
  8.  
  9. local function left()
  10. turtle.forward()
  11. turtle.turnLeft()
  12. turtle.forward()
  13. turtle.turnLeft()
  14. end
  15.  
  16. local function startR()
  17. turtle.forward()
  18. turtle.down()
  19. turtle.turnRight()
  20. for i=1,11 do
  21. turtle.forward()
  22. end
  23. end
  24.  
  25. local function seeds()
  26. for i=1,2 do
  27. local numC = 0
  28. local numV = turtle.getItemCount()
  29. if numV == numC then
  30. turtle.select(i)
  31. sleep()
  32. elseif numV ~= numC then
  33.  
  34. end
  35. end
  36. end
  37.  
  38. local function dump()
  39. turtle.turnLeft()
  40. for u=2,16 do
  41. turtle.select(u)
  42. for i=1,13 do
  43. turtle.drop()
  44. end
  45. end
  46. turtle.turnRight()
  47. turtle.turnRight()
  48. end
  49.  
  50. local function move()
  51. turtle.forward()
  52. turtle.digDown()
  53. turtle.placeDown()
  54. end
  55.  
  56. local function plant()
  57. for i=1,12 do
  58. move()
  59. end
  60. end
  61.  
  62. local function wait()
  63. p = 660
  64.  
  65. term.clear()
  66. term.setCursorPos(1,1)
  67. print("Waiting for crops to grow")
  68.  
  69. for i=0,660 do
  70.  
  71. term.setCursorPos(1,3)
  72. print("Progress Completed "..i.."/"..p)
  73. sleep(1)
  74.  
  75. end
  76. term.setCursorPos(1,3)
  77. print("Progress Completed 100% ")
  78. end
  79.  
  80. --Main Program
  81. while true do
  82. turtle.up()
  83. seeds()
  84. for i=1,5 do
  85. plant()
  86. seeds()
  87. right()
  88. plant()
  89. seeds()
  90. left()
  91. end
  92.  
  93. plant()
  94. seeds()
  95. right()
  96. plant()
  97. seeds()
  98. startR()
  99. dump()
  100. wait()
  101. end
  102.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement