94Lord

Untitled

Aug 27th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 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. forward()
  62. forward()
  63. forward()
  64. forward()
  65. turtle.up(7)
  66. end
  67.  
  68. function ofen()
  69. if turtle.getItemCount(1) > 10 then
  70. turtle.up()
  71. forward()
  72. turtle.transferTo(1,15,9)
  73. turtle.dropDown(15)
  74. end
  75.  
  76.  
  77.  
  78. -- (Programm Start Holz) --
  79.  
  80. while j < 2 do
  81. turtle.select(1)
  82. success, data = turtle.inspect()
  83. if(success and data.name==treeblock) then
  84. refuel()
  85. fell()
  86. place()
  87. sleep(5)
  88. collect()
  89. refuel()
  90.  
  91. else
  92. print("Kein Baum")
  93. sleep(10)
  94. j = j+1
  95. end
  96. end
  97.  
  98. goback()
  99. ofen()
Advertisement
Add Comment
Please, Sign In to add comment