Sayomie550

Untitled

Jul 16th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. local standby = 0
  2. local tree = 0
  3. local drop = 0
  4. local wait = 0
  5.  
  6. while turtle.detectDown() do
  7.  
  8. print( "Starting Tree Chopping Program" )
  9.  
  10. while redstone.getInput("back", true) do
  11. standby = 0
  12. tree = tree + 1
  13. drop = drop + 1
  14. wait = 0
  15.  
  16. print( "Chopping Tree Number "..tree )
  17.  
  18. while turtle.detect() do
  19. turtle.dig()
  20. turtle.forward()
  21. end
  22.  
  23. while turtle.detectUp() do
  24. turtle.digUp()
  25. turtle.up()
  26. end
  27.  
  28. while not turtle.detectUp() and not turtle.detectDown() do
  29. turtle.down()
  30. end
  31.  
  32. redstone.setOutput("left", false)
  33.  
  34. turtle.back()
  35. turtle.select(1)
  36. turtle.place(1)
  37.  
  38. redstone.setOutput("left", true)
  39.  
  40. if drop == 5 then
  41. print( "Depositing Lumber to Obby Pipe" )
  42.  
  43. turtle.turnRight()
  44.  
  45. turtle.select(2)
  46. turtle.drop()
  47.  
  48. turtle.turnLeft()
  49.  
  50. drop = 0
  51. end
  52.  
  53. end
  54.  
  55. while not redstone.getInput("back", true) do
  56.  
  57. if standby == 0 then
  58. print( "Standby Mode" )
  59. standby = standby + 1
  60. tree = 0
  61. else
  62. wait = wait + 1
  63. sleep(1)
  64. end
  65.  
  66. end
  67.  
  68. end
  69.  
  70. while not turtle.detectDown() do
  71. print( "Place a block under the turtle" )
  72. end
Advertisement
Add Comment
Please, Sign In to add comment