-- Turtle Mining Program -- Set the number of blocks the Turtle will mine local distance = 10 -- Fuel check function local function checkFuel() if turtle.getFuelLevel() < 1 then print("Out of fuel. Please refuel.") return false end return true end -- Mining function local function mine() for i = 1, distance do -- Check fuel if not checkFuel() then break end -- Check and dig in front while turtle.detect() do turtle.dig() end -- Move forward if turtle.forward() then -- Dig below if turtle.detectDown() then turtle.digDown() end else print("Turtle cannot move forward.") break end end end -- Start the program print("Starting Turtle mining program...") mine() print("Mining program complete.")