Advertisement
Pandana

TreeChopper

Aug 4th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.41 KB | None | 0 0
  1. height = 0
  2.  
  3. while true do
  4.     chop()
  5. end
  6.  
  7. function chop()
  8.     turtle.dig()
  9.     turtle.forward()
  10.     turtle.digDown()
  11.     while turtle.detectUp() == true do
  12.         turtle.digUp()
  13.         turtle.up()
  14.         height = height + 1
  15.     end
  16.     while height > 0 do
  17.         turtle.down()
  18.         height = height - 1
  19.     end
  20.     goBack()
  21. end
  22.  
  23. function goBack()
  24.     turtle.turnLeft()
  25.     turtle.turnLeft()
  26.     turtle.forward()
  27.     turtle.turnLeft()
  28.     turtle.turnLeft()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement