Advertisement
Guest User

turtlescript

a guest
Oct 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.66 KB | None | 0 0
  1. --Felling turtle script
  2.  
  3. local function isLog()
  4.   local success, data = turtle.inspect()
  5.  
  6.   if success then
  7.     if data.name == "minecraft:log" then
  8.       return true
  9.     else
  10.       return false
  11.     end
  12.   else
  13.     return false
  14.   end
  15. end
  16.  
  17. while true do
  18.   if turtle.getFuelLevel() == 0 then
  19.     turtle.refuel()
  20.   else
  21.     if isLog == true then
  22.       if turtle.detectUp() then
  23.         turtle.digUp()
  24.       end
  25.       turtle.dig()
  26.       turtle.up()
  27.     else
  28.       local isdown = turtle.detectDown()
  29.      
  30.       while isdown == false do
  31.    
  32.       turtle.down()
  33.         isdown = turtle.detectDown()
  34.       end
  35.     end
  36.   end
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement