local islog = false Slot = -1 Test = true Height = 0 Run = 0 --//////////////////////////////////////-- function findSlot(name) for i=1,16 do turtle.select(i) if turtle.getItemDetail() == nil then else if turtle.getItemDetail().name == name then Slot = i end end end return Slot end function checkFuelNrefuel() if turtle.getFuelLevel() < 50 then turtle.select(findSlot("minecraft:coal")) turtle.refuel(1) print("refueling from"..findSlot("minecraft:coal")) end end --/////////////////-- function chop() Test = true while Test do checkFuelNrefuel() if not turtle.detect() then print("test=false") Test = false else print("test=true") turtle.dig() if turtle.detectUp() then turtle.digUp() end turtle.up() Height = Height + 1 end os.sleep(0.5) end for i=1,Height-1 do turtle.down() end end --//////////////////////////////////////-- while true do term.clear() term.setCursorPos(1,1) write("run") print(Run) Run = Run + 1 checkFuelNrefuel() B,C = turtle.inspect() print(B) print(C.name) print("testing") if C.name == "minecraft:log" then print("log, chopping") chop() turtle.select(findSlot("minecraft:sapling")) turtle.place() else print("no log, waiting") end os.sleep(1) end