Advertisement
kolya5544

Tree Miner v1.0

Feb 15th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.58 KB | None | 0 0
  1. while true do
  2. g,info = turtle.inspect()
  3. check,off = turtle.inspectDown()
  4. --print("Got")
  5. if (check ~=true) and (info["name"]~="minecraft:log") then
  6. onground = false
  7. suck = true;
  8. while (suck) do
  9.  check,off = turtle.inspectDown()
  10.  if (off["name"]=="minecraft:dirt") then
  11.  suck = false;
  12.  end
  13.  if (off["name"]=="minecraft:grass") then
  14.  suck = false;
  15.  end
  16.  turtle.down()
  17. -- print("Gotodown")
  18. end
  19. elseif (info["name"]~="minecraft:log") or (off == "minecraft:grass") or (off=="minecraft:dirt") then
  20.  turtle.select(12)
  21.  turtle.place()
  22. end
  23. if (g==true) then
  24.  if (info["name"] == "minecraft:log") then
  25.   print("Found log!")
  26.   flag = false
  27.    if (turtle.getFuelLevel()<10) then
  28.     turtle.select(4)
  29.     turtle.refuel()
  30.    end
  31.  if (turtle.getFuelLevel()<10) then
  32.  error("Not enough fuel! Please use fourth slot!")
  33.  else
  34.  --here
  35.  
  36.    turtle.select(8)
  37.    local _,wood = turtle.inspect()
  38.    local _,leave = turtle.inspectUp()
  39.    if (wood["name"] == "minecraft:log") then
  40.      if (leave["name"]=="minecraft:leaves") then
  41.       turtle.digUp(); -- dig leaves above
  42.      else
  43.       turtle.digUp();
  44.      end
  45.     turtle.dig(); -- dig log in front of
  46.     turtle.turnRight()
  47.     turtle.dig(); -- dig log in front of
  48.     turtle.turnRight()
  49.     turtle.dig(); -- dig log in front of
  50.     turtle.turnRight()
  51.     turtle.dig(); -- dig log in front of
  52.     turtle.turnRight()
  53.     turtle.up();
  54.     else
  55.     gg,hh = turtle.inspectDown()
  56.     if (hh["name"] == "minecraft:dirt") or (hh["name"] == "minecraft:grass") then
  57.      turtle.select(12)
  58.      turtle.place()
  59.      end
  60.    
  61.     end
  62.    
  63.   end
  64.  end
  65.  end
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement