--Turtle Lumberjack--   shell.run(clear)   print("Before beginning make sure:\n ")   print("Wood is in slot 1.") print("Saplings are in slot 2.") print("Bonemeal for slot 3.") print("And fuel for slot 16.\n")   print("What type of tree are you cutting?") local treeType = io.read() local log, sapling, bonemeal, fuel = 1, 2, 3, 16   local function digUp()   while turtle.compareUp() do     turtle.digUp()     turtle.up()     if turtle.compareUp() == false and treeType == "redwood" then       turtle.digUp()       turtle.up()       turtle.forward()     else     end   end end   local function digDown()   while turtle.compareDown() do     turtle.digDown()     turtle.down()     if turtle.compareDown() == false and treeType == "redwood" then       turtle.turnRight()       turtle.dig()       turtle.forward()     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(amount)   local amount = nil   if amount ~= nil then   else     print("How many times would you like the turtle to run?")     times = read()   end   if turtle.compare() ~= true then     plant()   else   end   for i = 0, times do     turtle.select(log)     if turtle.compare() then       turtle.dig()       turtle.forward()       digUp()       digDown()     else     end   end end   cycle(times)