-- -- dc_loadtest.lua -- -- Diagnoses why models don't enter the data center. Reads this DC RTU's config, -- pushes ONE data model from the models barrel into the model port, and watches -- whether the multiblock then absorbs it out of the port. -- -- dc_loadtest -- run on the data-center RTU computer -- -- Output is short - it fits on screen. Paste it back. -- require("/initenv").init_env() local facility = require("facility") local cfg = facility.load_config() local src = cfg.dc_model_source local port = cfg.dc_model_port print("source barrel : " .. tostring(src)) print("model port : " .. tostring(port)) if not src or not port then error("config is missing dc_model_source / dc_model_port", 0) end local sp = peripheral.wrap(src) local pp = peripheral.wrap(port) if not sp then error("cannot wrap source '" .. tostring(src) .. "'", 0) end if not pp then error("cannot wrap port '" .. tostring(port) .. "'", 0) end local function countModels(p) local n = 0 local ok, l = pcall(p.list) if ok and l then for _, it in pairs(l) do if it.name:find("data_model") then n = n + it.count end end end return n end local function firstModelSlot(p) local ok, l = pcall(p.list) if ok and l then for slot, it in pairs(l) do if it.name:find("data_model") then return slot end end end end print("---") print("barrel models before : " .. countModels(sp)) print("port models before : " .. countModels(pp)) local slot = firstModelSlot(sp) if not slot then error("no data model in the barrel to test with", 0) end local moved = sp.pushItems(port, slot, 1) print("pushItems moved : " .. tostring(moved)) print("barrel models after : " .. countModels(sp)) print("port models after : " .. countModels(pp)) print("waiting 3s for the multiblock to absorb it...") sleep(3) print("port models +3s : " .. countModels(pp)) print("---") print("moved=0 -> port rejected the model") print("port went up then back to 0 -> center absorbed it (working)") print("port stays up -> center is NOT pulling models from this port")