Advertisement
94Lord

Untitled

Aug 27th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 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(2)
  60. forward(4)
  61. turtle.up(5)
  62. end
  63.  
  64.  
  65.  
  66. -- (Programm Start Holz) --
  67.  
  68. for j=1,2 do
  69. turtle.select(1)
  70. success, data = turtle.inspect()
  71. if(success and data.name==treeblock) then
  72. refuel()
  73. fell()
  74. place()
  75. sleep(5)
  76. collect()
  77. refuel()
  78.  
  79. else
  80. print("Kein Baum")
  81. Sleep(10)
  82. j = j+1
  83. end
  84. end
  85.  
  86. goback()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement