Advertisement
VADemon

Obsidian tower breaker | The End

Mar 31st, 2013
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 KB | None | 0 0
  1. function cutUp()
  2.     turtle.digUp()
  3.     turtle.up()
  4. end
  5.  
  6. function cutDown()
  7.     turtle.digDown()
  8.     turtle.down()
  9. end
  10.  
  11. function run()
  12.     local height = 0
  13.    
  14.     -- chop down the first block
  15.     turtle.dig()
  16.     turtle.forward() -- ]]
  17.  
  18.     while turtle.digUp()==true do
  19.         turtle.dig()
  20.         turtle.up()
  21.         height = height + 1 --count height of the tree
  22.     end
  23.    
  24.     turtle.dig()
  25.     turtle.turnRight(); turtle.dig(); turtle.forward(); turtle.turnLeft()
  26.     turtle.dig()
  27.  
  28.     for i=1, height do
  29.         cutDown()
  30.         turtle.dig()
  31.         turtle.turnRight(); turtle.dig(); turtle.turnLeft()
  32.     end
  33.    
  34.     turtle.forward()
  35.     turtle.dig()
  36.     turtle.forward()
  37.     turtle.turnLeft()
  38.     turtle.dig()
  39.    
  40.     for i=1, height do
  41.         cutUp()
  42.         turtle.dig()
  43.     end
  44.  
  45.     turtle.turnRight(); turtle.turnRight()
  46.     turtle.dig(); turtle.forward()
  47.     turtle.turnRight(); turtle.dig()
  48.    
  49.     for i=1, height do
  50.         cutDown()
  51.         turtle.dig()
  52.     end
  53.    
  54.     print("Jobs done! Current height: " ..height)
  55. end
  56.  
  57. run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement