Advertisement
a_alien

tree farm

Jan 9th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. --[[Version 1.0]]--
  2. function fuelCheck()
  3. local fuelLevel = turtle.getFuelLevel()
  4. if fuelLevel < 20 then
  5. turtle.select(1)
  6. turtle.refuel(1)
  7. print("Refueled!")
  8. end
  9. end
  10.  
  11. function chopTree()
  12. local success, data = turtle.inspect()
  13. if data.name == "minecraft:log" then
  14. print("Tree detected... chopping.")
  15. turtle.dig()
  16. turtle.forward()
  17. while turtle.detectUp() == true do
  18. turtle.digUp()
  19. turtle.up()
  20. end
  21. while turtle.detectDown() == false do
  22. turtle.down()
  23. end
  24. turtle.back()
  25. turtle.select(3)
  26. turtle.place()
  27. turtle.select(1)
  28. end
  29. end
  30.  
  31. local chopping = true
  32. while chopping do
  33. fuelCheck()
  34. chopTree()
  35. turtle.suck()
  36. turtle.suckUp()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement