zeshan

Untitled

Dec 22nd, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. local height
  2. function getFuel()
  3. if turtle.getFuelLevel() <=10 then
  4. turtle.select(1)
  5. turtle.refuel(2)
  6. end
  7. end
  8. function callTree()
  9. turtle.select(2)
  10. if turtle.getItemCount(2) <=4 then
  11. turtle.suckDown()
  12. end
  13. turtle.forward()
  14. turtle.forward()
  15. turtle.turnLeft()
  16. turtle.place()
  17. turtle.turnRight()
  18. turtle.back()
  19. turtle.place()
  20. turtle.turnLeft()
  21. turtle.place()
  22. turtle.turnRight()
  23. turtle.back()
  24. turtle.place()
  25. repeat
  26. turtle.select(3)
  27. turtle.place()
  28. until not turtle.place()
  29. end
  30. function chopDatStuffUp()
  31. repeat
  32. turtle.dig()
  33. getFuel()
  34. turtle.digUp()
  35. turtle.up()
  36. height = height+1
  37. until not turtle.detectUp()
  38. end
  39. function chopDatStuffDown()
  40. repeat
  41. turtle.dig()
  42. getFuel()
  43. turtle.digDown()
  44. turtle.down()
  45. height = height-1
  46. until height == 0
  47. end
  48. function cutTree()
  49. getFuel()
  50. turtle.dig()
  51. turtle.forward()
  52. turtle.digUp()
  53. chopDatStuffUp()
  54. turtle.dig()
  55. turtle.forward()
  56. turtle.turnLeft()
  57. turtle.dig()
  58. turtle.forward()
  59. turtle.turnLeft()
  60. chopDatStuffDown()
  61. turtle.dig()
  62. turtle.forward()
  63. turtle.forward()
  64. end
  65. function dropItems()
  66. for i = 2, 14 do
  67. if i~=3 then
  68. turtle.select(i)
  69. turtle.dropDown()
  70. end
  71. end
  72. turtle.turnLeft()
  73. turtle.forward()
  74. turtle.turnLeft()
  75. end
  76. function doStuff()
  77. height=0
  78. getFuel()
  79. callTree()
  80. cutTree()
  81. dropItems()
  82. end
  83. doStuff()
Advertisement
Add Comment
Please, Sign In to add comment