-- definition
local function collect()
local bFull = true
local nTotalItems = 0
for n = 1, 16 do
local nCount = turtle.getItemCount(n)
if nCount == 0 then
bFull = false
end
nTotalItems = nTotalItems + nCount
end
if nTotalItems > collected then
collected = nTotalItems
if math.fmod(collected + unloaded, 50) == 0 then
print("Mined " .. (collected + unloaded) .. " items.")
end
end
if bFull then
print("No empty slots left.")
return false
end
return true
end
-- export
return { collect = collect }
Comments