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
peripheral.call("right","pushFluid","left",lava - 300)
end
sleep(10)
end

View file

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

View file

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

View file

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

View file

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

View file

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