Advertisement
DustinRosebery

smallWheatFarm

Dec 17th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. -- Small wheat farm script
  2.  
  3. t = turtle
  4. sleep = 6000 -- Sets sleep timer
  5.  
  6. local function plant() -- cycles through inv. and finds seeds
  7. for i = 1, 15, 1 do
  8. t.select(i)
  9. if t.compareTo(16) == true then
  10. t.placeDown()
  11. end
  12. end
  13. end
  14.  
  15. local function digStep() -- harvests, plants, and moves one
  16. t.digDown() -- space forward
  17. plant()
  18. t.forward()
  19. end
  20. local function shortRow()
  21. digStep()
  22. digStep()
  23. digStep()
  24. end
  25. local function longRow()
  26. digStep()
  27. digStep()
  28. digStep()
  29. digStep()
  30.  
  31. end
  32.  
  33.  
  34. local function dropOff() -- Unloads inventory
  35. for i = 1, 15, 1 do
  36. t.select(i)
  37. t.dropDown()
  38. end
  39. end
  40.  
  41. -- Movement path for top-center
  42. -- chest to start
  43. local function farm()
  44. t.turnLeft()
  45. t.forward()
  46. t.turnRight()
  47. t.forward()
  48. t.digDown()
  49. plant()
  50. t.turnLeft()
  51. t.forward()
  52. t.turnRight()
  53.  
  54. -- start
  55. shortRow()
  56. t.digDown()
  57. plant()
  58.  
  59. t.turnRight()
  60. longRow()
  61.  
  62. t.digDown()
  63. plant()
  64.  
  65. t.turnRight()
  66. t.forward()
  67. t.turnRight()
  68.  
  69. shortRow()
  70. t.digDown()
  71. plant()
  72.  
  73. t.turnLeft()
  74. t.forward()
  75. t.turnLeft()
  76.  
  77. shortRow()
  78. t.digDown()
  79. plant()
  80.  
  81. t.turnRight()
  82. t.forward()
  83. t.digDown()
  84. plant()
  85. t.turnRight()
  86. t.forward()
  87. t.digDown()
  88. plant()
  89. t.turnLeft()
  90. t.forward()
  91. t.turnRight()
  92. t.forward()
  93. t.turnRight()
  94.  
  95. dropOff()
  96. os.sleep(sleep)
  97. end
  98.  
  99. while true do
  100. farm()
  101. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement