Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. function CouperArbre()
  2. i = 0
  3. while turtle.detect() == true do
  4. turtle.dig()
  5. if turtle.detectUp() == true then
  6. turtle.digUp()
  7. end
  8. turtle.up()
  9. i = i + 1
  10. end
  11. while i ~= 0 do
  12. turtle.down()
  13. i = i - 1
  14. end
  15. end
  16.  
  17. function TestArbre()
  18. detect, bloc = turtle.inspect()
  19. if turtle.inspect() == false then
  20. return "vide"
  21. end
  22. if string.find(bloc.name, "sapling") ~= nil then
  23. return "sapling"
  24. end
  25. if string.find(bloc.name, "wood") ~= nil then
  26. return "wood"
  27. end
  28. end
  29.  
  30. function Planter()
  31. turtle.select(12)
  32. turtle.place()
  33. end
  34.  
  35. function SlotWood()
  36. for slot=1, 4 do
  37. turtle.select(slot)
  38. if turlte.getItemSpace() ~= 0 then
  39. slot = 4
  40. end
  41. end
  42. end
  43.  
  44. function EviterSapling()
  45. if turtle.detectUp() == true then
  46. turtle.digUp()
  47. end
  48. turtle.up()
  49. if turtle.detect() == true then
  50. turtle.dig()
  51. end
  52. turtle.forward()
  53. if turtle.detect() == true then
  54. turtle.dig()
  55. end
  56. turtle.forward()
  57. if turtle.detectDown() == true then
  58. turtle.digDown()
  59. end
  60. turtle.down()
  61. end
  62.  
  63. function CouperLigne(NbArbre)
  64. repeat
  65. if TestArbre() == "vide" then
  66. turtle.forward()
  67. end
  68.  
  69. if TestArbre() == "wood" then
  70. SlotWood()
  71. CouperArbre()
  72. end
  73.  
  74. until NbArbre == 0
  75. end
  76.  
  77. EviterSapling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement