Sir_Popsilots

lumberjack2

Dec 23rd, 2021 (edited)
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. function MineTree()
  2.     local checkblock , checked = turtle.inspect()
  3.     if (checkblock) and (string.match(checked.name,"log")) then
  4.         turtle.dig()
  5.         turtle.forward()
  6.         while turtle.detectUp() do
  7.             turtle.digUp()
  8.             turtle.up()
  9.         end
  10.         while turtle.detectDown() == false do
  11.             turtle.down()
  12.         end
  13.     end
  14. end
  15.  
  16.  
  17.  
  18. local  checkDown , CDdata = turtle.inspectDown()
  19. if (checkDown) and (string.match(CDdata.name,"brick")) then
  20.     while (checkDown) and (string.match(CDdata.name,"brick")) do
  21.         MineTree()
  22.         turtle.forward()
  23.         turtle.forward()
  24.         checkDown , CDdata = turtle.inspectDown()
  25.     end
  26. else
  27.     local c , d = turtle.inspect()
  28.     while (c) and (string.match(d.name,"log")) do
  29.         MineTree()
  30.     end
  31. end
  32.  
  33.  
Add Comment
Please, Sign In to add comment