--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 amount = 4 local function digUp() while turtle.detectUp() do turtle.digUp() turtle.up() if turtle.detectUp() == false and treeType == "redwood" then if turtle.detect() then turtle.dig() turtle.forward() else turtle.forward() end 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() 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() turtle.digDown() turtle.down() turtle.dig() turtle.forward() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward() turtle.turnRight() turtle.dig() turtle.forward turtle.turnRight() turtle.forward() turtle.turnRight() turtle.back() turtle.up() else turtle.select(sapling) turtle.place() turtle.select(bonemeal) turtle.place() end end end local function cycle(a) turtle.select(13) if turtle.compare() ~= true then plant() else end while a ~= 0 do turtle.dig() turtle.forward() digUp() a = a - 1 digDown() a = a - 1 end end cycle(amount)