-- Variables
turtle.select(1)
local tArgs = { ... }
local togo = tonumber(tArgs[1])
togo = togo or 1
print("Going Boss!")
-- Functions
function tfuel(amount)
if turtle.getFuelLevel() < 5 then
turtle.select(16)
turtle.refuel(amount)
turtle.select(1)
end
end
function turnaround()
turtle.turnRight()
turtle.turnRight()
end
function uandd()
if turtle.detectUp() then
turtle.digUp()
end
if turtle.detectDown() then
turtle.digDown()
end
end
-- Starting Out
for i = 1, togo do
tfuel(1)
if turtle.detect() then
repeat
turtle.dig()
sleep(0.25)
until turtle.detect() == false
turtle.forward()
uandd()
else
turtle.forward()
uandd()
end
if togo >= 10 then
if (i % 10 == 0) then
turtle.placeDown()
end
end
end
--Lets assume that worked and he made it
turnaround()
for r = 1, togo do
tfuel(1)
turtle.forward()
end