Advertisement
L3nna55

Treefarm Computercraftv2

May 2nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. --Plant
  2. function plant()
  3. if turtle.getItemCount(1) == 0 then
  4. turtle.select(1)
  5. turtle.turnLeft()
  6. turtle.suck()
  7. turtle.turnRight()
  8. end
  9. if turtle.getItemCount(2) == 0 then
  10. turtle.select(2)
  11. turtle.turnRight()
  12. turtle.suck()
  13. turtle.turnLeft()
  14. end
  15. turtle.select(1)
  16. turtle.place()
  17. turtle.select(2)
  18. turtle.place()
  19. turtle.place()
  20. turtle.place()
  21. turtle.place()
  22. turtle.place()
  23. turtle.place()
  24.  
  25. end
  26.  
  27. --Chop
  28. function chop()
  29. turtle.select(3)
  30. turtle.dig()
  31. turtle.forward()
  32. while turtle.compareUp() == true do
  33. turtle.digUp()
  34. turtle.up()
  35. end
  36. while turtle.detectDown() == false do
  37. turtle.down()
  38. end
  39. turtle.back()
  40. end
  41.  
  42. --Refuel
  43. function refuel()
  44. turtle.select(3)
  45. turtle.refuel(1)
  46. end
  47.  
  48. --Empty
  49. function empty()
  50. turtle.turnLeft()
  51. turtle.turnLeft()
  52. turtle.select(3)
  53. turtle.drop()
  54. turtle.turnRight()
  55. turtle.turnRight()
  56. end
  57.  
  58. while true do
  59. refuel()
  60. empty()
  61. plant()
  62. chop()
  63. sleep(10)
  64. os.queueEvent("Repeat")
  65. os.pullEvent()
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement