This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Adjgamer's profile picture

Turtle Auto Refueling Program Help

Started by Adjgamer, 10 December 2012 - 06:33 AM
Adjgamer #1
Posted 10 December 2012 - 07:33 AM
Okay, so I made a turtle program that strip mines but it keeps running out of fuel and i want to have it mine automatically. I am not familiar with any of the APIs, can someone help me with this?
Lettuce #2
Posted 10 December 2012 - 08:01 AM
How are you refueling it? It would take an awful long time to run out of a stack of coal. If you refuel it one coal at a time, with turtle.refuel(1) and feed it a stack in a certain slot, it should last a while. My refuel program is always

function checkFuel()
if turtle.getFuelLevel() <= 5 --or any number, depending on how frequently you check, and how much the turtle moves.
turtle.select(16) --fuel goes in this slot
turtle.refuel(1)
turtle.select(1) --use any slot here, I default to 1, depending on the program.
end
end
Or you have to have it return to a chest and retrieve fuel, which can get involved. A stack should move a turtle 1,000+ blocks, so that's usually unnecessary.
Adjgamer #3
Posted 10 December 2012 - 08:10 AM
I am just gonna shove a stack in it and refuel it when it gets low. I will use enderchests like Eloraam did (just place one, deposit items, break. when it gets full).