avgItemPerBreak = 3
state = "walking"
checksUntilRedo = 0
function checkFull()
full = false
if checksUntilRedo <= 0 then
minItemsLeft = math.huge
for i=1,16,1 do
turtle.select(i)
spaceLeft = turtle.getItemSpace()
full = full or spaceLeft < 5
if spaceLeft < minItemsLeft then
minItemsLeft = spaceLeft
end
end
checksUntilRedo = math.floor(minItemsLeft/avgItemPerBreak)
print(string.format("Checked if full\nmin remaining items: %d\nrecheck in %d requests", minItemsLeft, checksUntilRedo))
else
checksUntilRedo = checksUntilRedo-1
print(string.format("check in %d check requests", checksUntilRedo))
end
return full
end
while true do
if state == "walking" then
turtle.forward()
end
local exists, block = turtle.inspectDown()
if not exists then block = {} end
if block.name == "minecraft:red_wool" then
state="depo"
for i=1,16,1 do
turtle.select(i)
turtle.drop()
end
turtle.turnLeft()
turtle.turnLeft()
state = "walking"
elseif block.name=="create:polished_cut_veridium" then
state = "mining"
turtle.dig()
full = checkFull()
if full then
turtle.turnLeft()
turtle.turnLeft()
state="walking"
end
end
end