Advertisement
SythsGod

Feller

Sep 20th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.54 KB | None | 0 0
  1. function fell()
  2.   local isAir = false
  3.  
  4.   fellStart()
  5.  
  6.   repeat
  7.     turtle.digUp()
  8.     turtle.up()
  9.     isAir = not compareWood()
  10.   until isAir
  11.  
  12.   goDown()
  13. end
  14.  
  15. function fellStart()
  16.   turtle.dig()
  17.   turtle.forward()
  18. end
  19.  
  20. function compareWood()
  21.   local isWood = false
  22.  
  23.   turtle.select(16)
  24.   isWood = turtle.compareUp()
  25.  
  26.   turtle.select(1)
  27.   return isWood
  28. end
  29.  
  30. function goDown()
  31.   local isGround = false
  32.  
  33.   repeat
  34.     turtle.down()
  35.     turtle.select(15)
  36.     isGround = not turtle.compareDown()
  37.   until isGround
  38. end
  39.  
  40. fell()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement