-- -- chamber_probe.lua -- -- Dumps every sim chamber's methods and the return value of every read-only -- (get*/is*/has*) method, so we can see whether the peripheral exposes a -- model's TIER / progress - which decides if self-aware detection + auto-eject -- is possible. Writes to chamber_probe.txt (only calls read-only methods, so -- it won't trigger any chamber action). -- -- chamber_probe -- -- BEST DUMP: load a SELF-AWARE model in one chamber and a LOWER-TIER model in -- another before running, so we can compare which field/method reveals the tier. -- Then: pastebin put chamber_probe.txt -- local CHAMBER_TYPE = "hostilenetworks:sim_chamber" local OUT = "chamber_probe.txt" local f = fs.open(OUT, "w") if not f then error("cannot open " .. OUT, 0) end local function w(s) f.writeLine(s or "") end local chambers = {} for _, n in ipairs(peripheral.getNames()) do if peripheral.getType(n) == CHAMBER_TYPE then chambers[#chambers + 1] = n end end w("chamber_probe - " .. os.date("%Y-%m-%d %H:%M:%S")) w("found " .. #chambers .. " '" .. CHAMBER_TYPE .. "' peripheral(s)") local function isReadOnly(m) if m == "getItemDetail" or m == "getItemLimit" then return false end -- need a slot arg return m:match("^get") or m:match("^is") or m:match("^has") end local LIMIT = math.min(#chambers, 4) -- a few in detail is enough to compare for i = 1, LIMIT do local n = chambers[i] local p = peripheral.wrap(n) w(string.rep("=", 52)) w(n) local methods = peripheral.getMethods(n) or {} table.sort(methods) w("methods: " .. table.concat(methods, ", ")) w(string.rep("-", 52)) -- inventory contents + item detail (does the model item itself carry tier?) if p.list then local ok, list = pcall(p.list) if ok and list then for slot, item in pairs(list) do w(string.format(" slot %d: %s x%d", slot, item.name, item.count)) local ok2, det = pcall(p.getItemDetail, slot) if ok2 and type(det) == "table" then w(" displayName=" .. tostring(det.displayName) .. " nbt=" .. tostring(det.nbt)) end end end end -- every read-only method's return value w(" --- read-only method returns ---") for _, mth in ipairs(methods) do if isReadOnly(mth) then local ok, r1, r2 = pcall(p[mth]) if ok then local s = textutils.serialize(r1) if r2 ~= nil then s = s .. " | " .. textutils.serialize(r2) end w(" " .. mth .. "() = " .. s) else w(" " .. mth .. "() ERR " .. tostring(r1)) end end end end f.close() print("wrote /" .. OUT .. " for " .. LIMIT .. " chamber(s).") print("Send it: pastebin put " .. OUT)