Advertisement
RedstoneExpert

Turtle Baumfällen Programm #2

Jul 17th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. function turnaround()
  2. turtle.turnLeft()
  3. turtle.turnLeft()
  4. end
  5. function droppo()
  6. c = c + 1
  7. turtle.select(c)
  8. turtle.drop(64)
  9. end
  10. c = 3
  11. count = 0
  12. print( "How many trees should the turtle fell before clearing inventory?" )
  13. a = tonumber(read())
  14. print( "Felling trees..." )
  15. for i=1,1000 do
  16. for i=1,a do
  17. turtle.select(2)
  18. while(turtle.compare()==false) do
  19. turtle.select(3)
  20. turtle.place()
  21. turtle.select(2)
  22. end
  23. turtle.digUp()
  24. turtle.up()
  25. while(turtle.compare()==true) do
  26. turtle.digUp()
  27. turtle.dig()
  28. turtle.up()
  29. end
  30. while(turtle.detect()==false) do
  31. turtle.down()
  32. end
  33. turtle.down()
  34. turtle.select(2)
  35. turtle.refuel(1)
  36. turtle.select(1)
  37. turtle.suckDown()
  38. turtle.up()
  39. turtle.dig()
  40. turtle.place()
  41. count = count + 1
  42. turtle.up()
  43. print( "Felled and replanted tree number "..count.." " )
  44. end
  45. turnaround()
  46. for i=1,4 do
  47. turtle.forward()
  48. end
  49. turtle.select(2)
  50. turtle.drop(64)
  51. for i=1,13 do
  52. droppo()
  53. end
  54. c = 3
  55. turtle.select(2)
  56. turtle.suck(1)
  57. turtle.up()
  58. turtle.select(3)
  59. turtle.drop(64)
  60. turtle.suck(64)
  61. turtle.down()
  62. turtle.select(1)
  63. turnaround()
  64. for i=1,4 do
  65. turtle.forward()
  66. end
  67. turtle.down()
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement