94Lord

Untitled

Aug 27th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. -- ( HOLZ) --
  2.  
  3. aufsammeln = 20
  4. fuellevel = 100
  5. count = 0
  6. treeblock = "minecraft:log"
  7. chestdistance = 5
  8. j = 0
  9.  
  10. function fell()
  11. count = count + 1
  12. print("Baum Nr. " ..count.. " wird gefaellt!")
  13. while(turtle.forward()==false) do
  14. turtle.dig()
  15. end
  16. success, data = turtle.inspectUp()
  17. while(success and data.name==treeblock) do
  18. turtle.digUp()
  19. turtle.up()
  20. success, data = turtle.inspectUp()
  21. end
  22. while(turtle.down()) do end
  23. while(turtle.back()==false) do end
  24. end
  25.  
  26. function place()
  27. turtle.select(2)
  28. turtle.place()
  29. turtle.select(1)
  30. end
  31.  
  32. function collect()
  33. print("Sammle auf")
  34. sleep(aufsammeln)
  35. turtle.suck()
  36. while(turtle.down()==false) do end
  37. turtle.suckDown()
  38. sleep(1)
  39. turtle.suckDown()
  40. sleep(1)
  41. turtle.suckDown()
  42. sleep(1)
  43. while(turtle.up()==false) do end
  44. end
  45.  
  46. function refuel()
  47. if(turtle.getFuelLevel() < fuellevel) then
  48. turtle.select(16)
  49. turtle.refuel(1)
  50. print("Aufgetankt")
  51. end
  52. end
  53.  
  54. function forward()
  55. while(turtle.forward()==false) do end
  56. end
  57.  
  58. function goback()
  59. turtle.turnRight()
  60. turtle.turnRight()
  61. for i=1,4 do
  62. forward()
  63. end
  64. for i=1,7 do
  65. turtle.up()
  66. end
  67. end
  68.  
  69. function ofen()
  70. if turtle.getItemCount(1) > 10 then
  71. turtle.up()
  72. forward()
  73. turtle.select(1)
  74. turtle.transferTo(15,9)
  75. turtle.select(15)
  76. turtle.dropDown(15)
  77. turtle.turnRight()
  78. turtle.back()
  79. turtle.down()
  80. turtle.select(16)
  81. turtle.suck()
  82. turtle.down()
  83. forward()
  84. end
  85.  
  86. if turtle.getItemCount(16) > 10 then
  87. turtle.dropUp(9)
  88. print("Holzkohle wird hergestellt")
  89. end
  90. turtle.select(1)
  91. turtle.turnLeft()
  92. turtle.back()
  93. turtle.up()
  94. refuel()
  95.  
  96. end
  97.  
  98. function goBaum1()
  99. turtle.turnLeft()
  100. turtle.turnLeft()
  101. for i=1,7 do
  102. turtle.down()
  103. end
  104. for i=1,4 do
  105. forward()
  106. end
  107. end
  108.  
  109. -- (Programm Start Holz) --
  110.  
  111. function Baum()
  112. turtle.select(1)
  113. success, data = turtle.inspect()
  114. if(success and data.name==treeblock) then
  115. refuel()
  116. fell()
  117. place()
  118. sleep(5)
  119. collect()
  120. refuel()
  121.  
  122. else
  123. print("Kein Baum")
  124. end
  125. end
  126.  
  127. Baum()
  128. goback()
  129. ofen()
  130. goBaum1()
  131. print("RUNDE 1")
  132.  
  133. Baum()
  134. goback()
  135. ofen()
  136. goBaum1()
  137. print("RUNDE 2")
Advertisement
Add Comment
Please, Sign In to add comment