Niseg

fir planter/cutter

Feb 21st, 2013
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. local function cutTree()
  2. local lim=0;
  3. local moveRight=true;
  4. turtle.dig()
  5. turtle.forward()
  6. while turtle.detectUp() do
  7. turtle.digUp();turtle.dig();turtle.up();
  8. lim=lim+1
  9. end
  10. turtle.turnRight();turtle.dig();turtle.forward();turtle.turnLeft()
  11. while lim>0 do
  12. turtle.digDown();turtle.dig();turtle.down();
  13. lim=lim-1;
  14. end
  15. turtle.dig()
  16. end
  17.  
  18. local function plantTree()
  19. turtle.forward()
  20. turtle.select(1)
  21. turtle.place()
  22. turtle.back()
  23. turtle.place()
  24. turtle.turnRight()
  25. turtle.forward()
  26. turtle.turnRight()
  27. turtle.back()
  28. turtle.back()
  29. turtle.place()
  30. turtle.back()
  31. turtle.place()
  32. turtle.up()
  33. turtle.forward()
  34. turtle.forward()
  35. turtle.forward()
  36.  
  37. turtle.turnLeft()
  38. turtle.back()
  39. turtle.turnLeft()
  40. turtle.down()
  41. end
  42.  
  43. local sel=0;
  44. --print("1 plant 2 cut")
  45. --sel= tonumber(read())
  46. while turtle.getItemCount(1)>4 do
  47. plantTree()
  48. turtle.select(1)
  49. turtle.up()
  50. while not turtle.detect() do
  51. --if(turtle.getItemCount(1)<32) then
  52. --turtle.turnRight();turtle.suck();turtle.turnRight();turtle.suck();
  53. --turtle.turnRight();turtle.suck();turtle.turnRight();turtle.suck();
  54. --else
  55. sleep(5)
  56. --end
  57.  
  58. end
  59. turtle.down()
  60. cutTree()
  61. turtle.back();turtle.turnRight();turtle.back();turtle.turnLeft()
  62. for i=2,16 do turtle.select(i);turtle.dropDown(); end
  63. turtle.select(1)
  64. end
  65. --cutTree()
Advertisement
Add Comment
Please, Sign In to add comment