You might want to throw in a turtle.select() to make sure slot 1
is selected (for eg, remember that restarting the script
won't reset the current slot), and maybe a while loop to ensure it actually gets refueled, but yeah, the line works more or less as you seem to think it does.
turtle.select(1)
if turtle.getFuelLevel() < fuel then
print("Turtle has "..turtle.getFuelLevel().."/"..fuel.." required fuel.")
turtle.refuel()
while turtle.getFuelLevel() < fuel then
-- After the last attempt to refuel, we still don't have enough.
print("Please put more fuel in slot 1 (needs "..(fuel-turtle.getFuelLevel()).." more).")
os.pullEvent("turtle_inventory")
turtle.refuel()
end
end
print("Have "..turtle.getFuelLevel().."/"..fuel.." fuel, stripmine starting...")
Regarding the "if" statements, since you can be sure the "left" variable holds a lower-case string, there's no need to pull anything fancy there. This is fine for eg:
left = string.lower(read())
if left == "left" then
.
.
.