Advertisement
RoToRx88

Untitled

Feb 8th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. --[[Version 1.0]]--
  2. function fuelCheck()
  3.   local fuelLevel = turtle.getFuelLevel()
  4.   if fuelLevel < 16 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.")
  15.     turtle.dig()
  16.     turtle.forward()
  17.     turtle.digDown()
  18.     turtle.select(3)
  19.     turtle.place()
  20.     turtle.select(1)
  21.     while turtle.detectUp() == true do
  22.       turtle.digUp()
  23.       turtle.up()
  24.     end
  25.     while turtle.detectDown() == false do
  26.       turtle.down()
  27.     end
  28.   end
  29. end
  30.  
  31. local chopping = true
  32. while chopping do
  33.   fuelCheck()
  34.   chopTree()
  35.   turtle.forward()
  36.   turtle.forward()
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement