Saplings = tonumber(turtle.getItemCount(16))
if Saplings > 3 then
You dont need tonumber here. You also can put turtle.getItemCount(16) right into the if statement:
if turtle.getItemCount(16) > 3 then
if you are making a yes-no-question i allways would recommand using os.pullEvent(). Look it up in the wiki and understand what it does, because it is very powerful.
In your case i would make it like this:
print("Enable Bonemeal? Y/N")
while true do
local event = {os.pullEvent("char")}
if event[2] == "y" then
bm = true
break
elseif event[2] == "n" then
bm = false
break
else
print("Wrong key!!")
end
end
Also: Just use a function if you need the code more than once or if you want to make it more visual. Last thing is allways by the programmer and coder. However i just recommand using a function, if the code you put into it, has a lot of lines and cover a specific theme or part of your program (e.g. the whole grabbing supplies out of a chest ect,)
Instead of checking every step the turte is doing by putting a checkFuel() behind it, you should a) prefuel the turtle or b)create a function for the movementcommands like this one:
function up()
turtle.up()
checkFuel()
end
This for every movement direction you need or like i said: prefuel.
You also should create local variables at the top/beginning of your program. Just these which you need in your whole script like "bm". You can use it in every function and code in your program.
Just some thingies