Advertisement
einsteinmaster96

Baum

Mar 18th, 2018 (edited)
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. require("movement")
  2.  
  3. function fell()
  4. move_to(0,1)
  5. level = 0
  6. while turtle.detectUp() do
  7. move_z_to(level)
  8. move_to(0,1)
  9. move_to(0,2)
  10. move_to(1,2)
  11. move_to(1,1)
  12. level = level + 1
  13. end
  14. move_to(0,0)
  15. move_z_to(0)
  16. end
  17.  
  18. function place()
  19. turtle.select(2)
  20. move_to(0,2)
  21. set_dir(1,0)
  22. turtle.place()
  23. move_to(0,1)
  24. set_dir(1,0)
  25. turtle.place()
  26. set_dir(0,1)
  27. turtle.place()
  28. move_to(0,0)
  29. set_dir(0,1)
  30. turtle.place()
  31. turtle.select(1)
  32. end
  33.  
  34. function collect()
  35. set_dir(0,1)
  36. turtle.suck()
  37. move_z_to(-1)
  38. turtle.suckDown()
  39. move_z_to(-2)
  40. turtle.suck()
  41. move_to(0,1)
  42. turtle.suck()
  43. set_dir(1,0)
  44. turtle.suck()
  45. set_dir(0,1)
  46. move_to(0,2)
  47. set_dir(1,0)
  48. turtle.suck()
  49. move_to(0,0)
  50. move_z_to(0)
  51. set_dir(0,1)
  52. turtle.suckUp()
  53. end
  54.  
  55. function refuel()
  56. if(turtle.getFuelLevel() < 50) then
  57. turtle.select(1)
  58. turtle.refuel(32)
  59. end
  60. end
  61.  
  62. function unload()
  63. if(turtle.getItemCount(16) > 0) then
  64. move_to(0,-4)
  65. set_dir(0,-1)
  66. for i=4,16 do
  67. turtle.select(i)
  68. turtle.drop(64)
  69. end
  70. end
  71. end
  72.  
  73. function load_bone_meal()
  74. move_to(0,-4)
  75. set_dir(0,-1)
  76. move_z_to(1)
  77. while turtle.suck() do end
  78. move_z_to(0)
  79. end
  80.  
  81. while(true) do
  82. turtle.select(1)
  83. move_to(0,0)
  84. set_dir(0,1)
  85. if(turtle.compare()) then
  86. print("Fell tree")
  87. fell()
  88. print("Place sapplings")
  89. place()
  90. print("Wait collect")
  91. sleep(60)
  92. print("Collect")
  93. collect()
  94. refuel()
  95. print("Unload")
  96. unload()
  97. print("Reload Bone meal")
  98. load_bone_meal()
  99. else
  100. turtle.select(3)
  101. if turtle.getItemCount(3) > 1 then
  102. turtle.place()
  103. end
  104. end
  105. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement