Advertisement
Enderlein

Fell

Jun 28th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.13 KB | None | 0 0
  1. local function reset()
  2.     _, blockdata = turtle.inspectDown()
  3.  
  4.     while blockdata["name"] ~= "minecraft:chest" do
  5.         turtle.down()
  6.        
  7.         _, blockdata = turtle.inspectDown()
  8.        
  9.         if blockdata["name"] == "minecraft:chest" then
  10.             break
  11.         end
  12.  
  13.     turtle.digDown()
  14.  
  15.     end
  16.    
  17.     turtle.select(1)
  18.     turtle.dropDown()
  19.  
  20.     turtle.select(15)
  21.     turtle.suck()
  22.     turtle.place()
  23.  
  24. end
  25.  
  26. local function fell()
  27.     _, blockdata = turtle.inspect()
  28.  
  29.     while blockdata["name"] == "minecraft:log" do
  30.         _, blockdata = turtle.inspect()
  31.  
  32.         if blockdata["name"] ~= "minecraft:log" then
  33.             break
  34.         end
  35.  
  36.         turtle.dig()
  37.         turtle.digUp()
  38.         turtle.up()
  39.  
  40.         ran = true
  41.     end
  42.  
  43.     if ran == true then
  44.         ran = false
  45.         reset()
  46.     end
  47. end
  48.  
  49. local function refuel()
  50.     if turtle.getFuelLevel() < 20 then
  51.         turtle.select(16)
  52.         turtle.refuel()
  53.     end
  54. end
  55.  
  56. if turtle.getFuelLevel() == "unlimited" then
  57.     needsFuel = false
  58. end
  59.  
  60. while true do
  61.     turtle.turnRight()
  62.     fell()
  63.  
  64.     if needsFuel then
  65.         refuel()
  66.     end
  67.  
  68. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement