From 45e6ec6e95c09ba21419cbec519a4402293f10d5 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Thu, 3 Jul 2025 19:37:25 +0200 Subject: [PATCH] :3c --- computer/14/startup.lua | 1 + computer/15/dirt.lua | 51 ++++++++++++++++++++++------------------ computer/15/startup.lua | 3 ++- computer/26/expand.lua | 13 ++++++---- computer/26/progress.lua | 4 ++-- computer/3/startup.lua | 6 ++--- computer/4/startup.lua | 6 ++--- ids.json | 4 ++-- 8 files changed, 49 insertions(+), 39 deletions(-) diff --git a/computer/14/startup.lua b/computer/14/startup.lua index 1e5b3ca..d7ed058 100644 --- a/computer/14/startup.lua +++ b/computer/14/startup.lua @@ -10,4 +10,5 @@ while true do if lava > 300 then peripheral.call("right","pushFluid","left",lava - 300) end + sleep(10) end diff --git a/computer/15/dirt.lua b/computer/15/dirt.lua index 56dc978..9386672 100644 --- a/computer/15/dirt.lua +++ b/computer/15/dirt.lua @@ -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 \ No newline at end of file +end diff --git a/computer/15/startup.lua b/computer/15/startup.lua index 91d6733..e080dfd 100644 --- a/computer/15/startup.lua +++ b/computer/15/startup.lua @@ -1,3 +1,4 @@ --require("multishell") -shell.execute("dirt") +--sleep(1) +shell.run("dirt") diff --git a/computer/26/expand.lua b/computer/26/expand.lua index 3fa6ca1..482bccd 100644 --- a/computer/26/expand.lua +++ b/computer/26/expand.lua @@ -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() diff --git a/computer/26/progress.lua b/computer/26/progress.lua index 9e71bd1..1245b51 100644 --- a/computer/26/progress.lua +++ b/computer/26/progress.lua @@ -1,2 +1,2 @@ -progress = 1 -layer_start = 1 +progress = 2 +layer_start = 0 diff --git a/computer/3/startup.lua b/computer/3/startup.lua index d2e828a..df5cdd7 100644 --- a/computer/3/startup.lua +++ b/computer/3/startup.lua @@ -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 diff --git a/computer/4/startup.lua b/computer/4/startup.lua index 2c768bb..6b5aa13 100644 --- a/computer/4/startup.lua +++ b/computer/4/startup.lua @@ -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 diff --git a/ids.json b/ids.json index 69abf7e..f275103 100644 --- a/ids.json +++ b/ids.json @@ -1,11 +1,11 @@ { - "computer": 29, + "computer": 30, "disk": 4, "peripheral.create:fluid_tank": 2, "peripheral.create:item_vault": 0, "peripheral.create:chute": 0, "peripheral.redrouter": 5, - "peripheral.computer": 5, + "peripheral.computer": 6, "peripheral.turtle": 1, "peripheral.create_source": 1, "peripheral.animatronic": 1,