--Turtle Lumberjack-- shell.run(clear) print("Before beginning make sure:\n ") print("Saplings are in slot 13.") print("Bonemeal for slot 14.") print("Dirt for slot 15.") print("And fuel for slot 16.\n") print("What type of tree are you cutting?\n") local treeType = io.read() local sapling, bonemeal, dirt, fuel = 13, 14, 15, 16 local function digUp() while turtle.detectUp() do turtle.digUp() turtle.up() if turtle.detectUp = false and treeType == "redwood" then turtle.digUp() turtle.up() turtle.dig() turtle.forward() turtle.digDown() turtle.down() local amount = amount - 1 else end end end local function digDown() turtle.select(dirt) while turtle.detectDown do turtle.digDown() turtle.down() if turtle.compareDown() == true and treeType == "redwood" then turtle.forward() turtle.turnRight() turtle.forward() turtle.turnRight() local amount = amount - 1 else end end end local function plant() for i = 1, 1 do if treeType == "redwood" then turtle.select(sapling) turtle.forward(2) turtle.turnRight(2) turtle.place() turtle.back() turtle.place() turtle.turnLeft() turtle.forward() turtle.turnRight() turtle.forward() turtle.place() turtle.back() turtle.place() turtle.select(bonemeal) turtle.place() else turtle.select(sapling) turtle.place() turtle.select(bonemeal) turtle.place() end end end local function cycle() local amount = 4 turtle.select(13) if turtle.compare() ~= true then plant() else end while amount ~= 0 do turtle.dig() turtle.forward() digUp() digDown() else end end end cycle()