Advertisement
El_Diablo256

wheat farm

May 1st, 2013
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.51 KB | None | 0 0
  1. --[[ functions ]]--
  2.  
  3. function harvest()
  4. turtle.forward()
  5. turtle.digDown()
  6. turtle.suckDown()
  7. turtle.select (2)
  8. turtle.placeDown()
  9. end
  10.  
  11. function straight()
  12. harvest()
  13. harvest()
  14. harvest()
  15. harvest()
  16. harvest()
  17. harvest()
  18. harvest()
  19. harvest()
  20. harvest()
  21. harvest()
  22. harvest()
  23. harvest()
  24. harvest()
  25. harvest()
  26. harvest()
  27. harvest()
  28. harvest()
  29. harvest()
  30. harvest()
  31. end
  32.  
  33. function turn()
  34. harvest()
  35. harvest()
  36. turtle.turnRight()
  37. turtle.forward()
  38. turtle.turnRight()
  39. turtle.digDown()
  40. turtle.suckDown()
  41. turtle.select (2)
  42. turtle.placeDown()
  43. harvest()
  44. turtle.turnLeft()
  45. harvest()
  46. turtle.turnLeft()
  47. harvest()
  48. turtle.turnRight()
  49. end
  50.  
  51. function curve()
  52. harvest()
  53. turtle.turnRight()
  54. harvest()
  55. turtle.turnLeft()
  56. harvest()
  57. turtle.turnLeft()
  58. harvest()
  59. turtle.turnRight()
  60. end
  61.  
  62.  
  63. turtle.select (1)
  64. if turtle.getItemCount(1) < 5 then
  65.   turtle.suckUp()
  66.   if turtle.getItemCount(1) < 5 then
  67.     rs.setOutput("left", true)
  68.     repeat
  69.       turtle.suckUp()
  70.       sleep(5)
  71.       turtle.getItemCount(1)
  72.     until turtle.getItemCount(1) > 45
  73.     shell.run("wheat")
  74.   end
  75. end
  76. rs.setOutput("left",false)
  77.  
  78. if turtle.getFuelLevel() < 65 then
  79.   turtle.refuel(1)
  80. end
  81.  
  82. turtle.forward()
  83. straight()
  84. turtle.turnRight()
  85. turn()
  86. curve()
  87. curve()rn()
  88. curve()
  89. curve()
  90. curve()
  91. curve()
  92. curve()
  93. curve()
  94. turtle.forward()
  95. turtle.forward()
  96. turtle.turnRight()
  97. turtle.forward()
  98. turtle.forward()
  99. turtle.turnRight()
  100. for variable = 3,7 do
  101. turtle.select(variable)
  102. turtle.dropDown()
  103. term.clear()
  104. term.setCursorPos(1,1)
  105. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement