This commit is contained in:
Crispy 2025-07-03 19:37:25 +02:00
parent 68ec37f994
commit 45e6ec6e95
8 changed files with 49 additions and 39 deletions

View file

@ -10,4 +10,5 @@ while true do
if lava > 300 then if lava > 300 then
peripheral.call("right","pushFluid","left",lava - 300) peripheral.call("right","pushFluid","left",lava - 300)
end end
sleep(10)
end end

View file

@ -24,10 +24,21 @@ unpacked = {
43046721 43046721
} }
last_total = 0 startup_total = nil
last_estimate_time = 0 startup_time = os.epoch("utc")
estimate_interval_h = 30/3600 speed = 0
estimated_speed = 0
function format_time(seconds)
local t = math.floor(seconds)
local t_s = t % 60
local t_m = math.floor(t / 60) % 60
local t_h = math.floor(t / 3600) % 24
local t_d = math.floor(t / 86400)
function two_digit(n)
return n<10 and "0"..tostring(n) or tostring(n)
end
return t_d.."d "..two_digit(t_h)..":"..two_digit(t_m)..":"..two_digit(t_s)
end
function update() function update()
local counts = {} local counts = {}
@ -42,13 +53,11 @@ function update()
end end
end end
local time = os.time("utc") local time = os.epoch("utc")
if time - last_estimate_time >= estimate_interval_h then if not startup_total then
last_estimate_time = time startup_total = total
estimated_speed = (total - last_total) / (estimate_interval_h * 3600)
last_total = total
end end
speed = math.floor((total - startup_total) / ((time - startup_time) / 1000) * 100) / 100
-- draw -- draw
term.clear() term.clear()
@ -59,22 +68,18 @@ function update()
local bar = string.rep("#", count) .. string.rep(".", 9 - count) local bar = string.rep("#", count) .. string.rep(".", 9 - count)
print("lvl", level, bar) print("lvl", level, bar)
end end
print()
print("total: ", total) print("total: ", total)
local progress = math.floor(total / unpacked[8] * 10000) / 100 local progress = total / unpacked[8] * 100
print("progress to octuple: " .. progress .. "%") print(string.format("octuple: %.5f%%\n", progress))
print("speed:", estimated_speed, base_item.."/s") print("speed:", speed, base_item .. "/s")
local eta = math.floor((unpacked[8] - progress) / estimated_speed + 0.5) local eta = math.floor((unpacked[8] - progress) / speed + 0.5)
local eta_s = eta % 60 print("uptime:", format_time((time - startup_time) / 1000))
local eta_m = math.floor(eta / 60) % 60 print("remaining:", format_time(eta))
local eta_h = math.floor(eta / 3600) % 24
local eta_d = math.floor(eta / 86400)
-- print(eta)
print("time remaining: ", eta_d .. "d", eta_h .. ":" .. eta_m .. ":" .. eta_s)
local n = math.floor(30 * (time - last_estimate_time) / estimate_interval_h)
print(string.rep(",", n)..string.rep(".", 32-n))
end end
while true do while true do
update() update()
sleep(2) sleep(2)
end end

View file

@ -1,3 +1,4 @@
--require("multishell") --require("multishell")
shell.execute("dirt") --sleep(1)
shell.run("dirt")

View file

@ -49,11 +49,11 @@ function clear_tile_slice()
for layer = layer_start, 5 do for layer = layer_start, 5 do
save(layer) save(layer)
local y = 12 - layer * 3 local y = 12 - layer * 3
local x = 9 local x = 8
local length = 8 * TILES + 9 local length = 8 * TILES + 8
if layer == 5 then if layer == 5 then
x = x - 3 x = x - 2
length = length - 3 length = length - 2
end end
turnLeft = (layer % 2 == 0) ~= mirror turnLeft = (layer % 2 == 0) ~= mirror
local z = progress*8 + 1 + (layer % 2) * 7 local z = progress*8 + 1 + (layer % 2) * 7
@ -73,7 +73,10 @@ function clear_tile_slice()
for _ = 1, length do for _ = 1, length do
mine3_step() mine3_step()
end end
if strip ~= 8 then if strip == 8 then
turtle.digUp()
turtle.digDown()
else
turn() turn()
mine3_step() mine3_step()
turn() turn()

View file

@ -1,2 +1,2 @@
progress = 1 progress = 2
layer_start = 1 layer_start = 0

View file

@ -12,7 +12,7 @@ for i,v in pairs(term.native()) do
return v(...) return v(...)
end end
end end
term.redirect(forward) --term.redirect(forward)
W = window.create(term.current(),1,1,term.getSize()) W = window.create(term.current(),1,1,term.getSize())
term.redirect(W) term.redirect(W)
parallel.waitForAll( parallel.waitForAll(
@ -20,7 +20,7 @@ parallel.waitForAll(
shell.run("shell") shell.run("shell")
end, end,
function() function()
while true do while false do
id, message, protocol = rednet.receive( id, message, protocol = rednet.receive(
"pocketevent" "pocketevent"
) )
@ -29,7 +29,7 @@ parallel.waitForAll(
end end
, ,
function() function()
while true do while false do
W.redraw() W.redraw()
sleep(0.5) sleep(0.5)
end end

View file

@ -11,7 +11,7 @@ for i,v in pairs(term.native()) do
return v(...) return v(...)
end end
end end
term.redirect(forward) --term.redirect(forward)
W = window.create(term.current(),1,1,term.getSize()) W = window.create(term.current(),1,1,term.getSize())
W.setBackgroundColor(colors.white) W.setBackgroundColor(colors.white)
W.setTextColor(colors.black) W.setTextColor(colors.black)
@ -21,7 +21,7 @@ parallel.waitForAll(
shell.run("shell") shell.run("shell")
end, end,
function() function()
while true do while false do
id, message, protocol = rednet.receive( id, message, protocol = rednet.receive(
"pocketevent" "pocketevent"
) )
@ -30,7 +30,7 @@ parallel.waitForAll(
end end
, ,
function() function()
while true do while false do
W.redraw() W.redraw()
sleep(0.1) sleep(0.1)
end end

View file

@ -1,11 +1,11 @@
{ {
"computer": 29, "computer": 30,
"disk": 4, "disk": 4,
"peripheral.create:fluid_tank": 2, "peripheral.create:fluid_tank": 2,
"peripheral.create:item_vault": 0, "peripheral.create:item_vault": 0,
"peripheral.create:chute": 0, "peripheral.create:chute": 0,
"peripheral.redrouter": 5, "peripheral.redrouter": 5,
"peripheral.computer": 5, "peripheral.computer": 6,
"peripheral.turtle": 1, "peripheral.turtle": 1,
"peripheral.create_source": 1, "peripheral.create_source": 1,
"peripheral.animatronic": 1, "peripheral.animatronic": 1,