Untitled
- -- ATM10 Hostile Neural Networks Dual Chamber & Data Center Dashboard
- -- Compatible with Minecraft 1.21.1 / NeoForge / ModernFix
- local monitor = peripheral.find("monitor")
- local display = monitor or term
- if monitor then
- monitor.setTextScale(0.5)
- end
- local width, height = display.getSize()
- local buffer = window.create(display, 1, 1, width, height, false)
- local function formatNumber(n)
- if not n then return "0" end
- if n >= 1e6 then return string.format("%.2fM", n / 1e6)
- elseif n >= 1e3 then return string.format("%.1fk", n / 1e3)
- else return tostring(math.floor(n)) end
- end
- local function drawProgressBar(x, y, barWidth, percent, fgColor, bgColor)
- buffer.setCursorPos(x, y)
- local filled = math.floor((math.min(100, math.max(0, percent)) / 100) * barWidth)
- buffer.setTextColor(fgColor)
- buffer.write(string.rep("|", filled))
- buffer.setTextColor(bgColor)
- buffer.write(string.rep("-", math.max(0, barWidth - filled)))
- end
- -- Deep inspector to decode 1.21 Data Components & calculate exact Accuracy %
- local function parseDataModel(item)
- if not item then return nil end
- local modelInfo = {
- target = item.displayName:gsub(" Data Model", ""):gsub("Model: ", ""),
- tier = "Faulty",
- accuracy = "5.00%",
- data = 0,
- maxData = 0
- }
- local rawStrings = {}
- local function inspectNode(tbl)
- if type(tbl) ~= "table" then return end
- for k, v in pairs(tbl) do
- local kStr = tostring(k):lower()
- if type(v) == "string" then
- table.insert(rawStrings, v)
- local vLow = v:lower()
- if vLow:find("self_aware") or vLow:find("self%-aware") or vLow:find("self aware") then
- modelInfo.tier = "Self-Aware"
- elseif vLow:find("superior") then
- modelInfo.tier = "Superior"
- elseif vLow:find("advanced") then
- modelInfo.tier = "Advanced"
- elseif vLow:find("basic") then
- modelInfo.tier = "Basic"
- end
- elseif type(v) == "number" then
- if kStr == "tier" or kStr == "model_tier" then
- local tierMap = { [0] = "Faulty", [1] = "Basic", [2] = "Advanced", [3] = "Superior", [4] = "Self-Aware" }
- if tierMap[v] then modelInfo.tier = tierMap[v] end
- elseif kStr == "data" or kStr == "data_collected" or kStr == "sim_data" then
- modelInfo.data = v
- elseif kStr == "max_data" or kStr == "data_needed" or kStr == "target_data" then
- modelInfo.maxData = v
- end
- elseif type(v) == "table" then
- inspectNode(v)
- end
- end
- end
- inspectNode(item)
- local fullText = table.concat(rawStrings, " "):gsub("Β§.", "")
- -- Fallback string matches
- if fullText:find("Self%-Aware") or fullText:find("Self Aware") or fullText:find("self_aware") then
- modelInfo.tier = "Self-Aware"
- elseif fullText:find("Superior") or fullText:find("superior") then
- modelInfo.tier = "Superior"
- elseif fullText:find("Advanced") or fullText:find("advanced") then
- modelInfo.tier = "Advanced"
- elseif fullText:find("Basic") or fullText:find("basic") then
- modelInfo.tier = "Basic"
- end
- -- Accuracy calculation based on HNN 1.21 formulas
- local accMatch = fullText:match("Accuracy:%s*([%d%.]+%%)") or fullText:match("([%d%.]+%%)")
- if accMatch then
- modelInfo.accuracy = accMatch
- else
- if modelInfo.tier == "Superior" then
- local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 900
- local progress = math.min(1.0, modelInfo.data / maxD)
- modelInfo.accuracy = string.format("%.2f%%", 72.43 + (progress * 12.57))
- elseif modelInfo.tier == "Advanced" then
- local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 256
- local progress = math.min(1.0, modelInfo.data / maxD)
- modelInfo.accuracy = string.format("%.2f%%", 67.00 + (progress * 5.43))
- elseif modelInfo.tier == "Basic" then
- local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 48
- local progress = math.min(1.0, modelInfo.data / maxD)
- modelInfo.accuracy = string.format("%.2f%%", 30.00 + (progress * 37.00))
- elseif modelInfo.tier == "Self-Aware" then
- modelInfo.accuracy = "99.50%"
- else
- modelInfo.accuracy = "5.00%"
- end
- end
- return modelInfo
- end
- local function getEnergyData(p)
- local energy, maxEnergy = 0, 1
- if p.getEnergy then
- energy = p.getEnergy()
- maxEnergy = p.getEnergyCapacity() or 1
- elseif p.getEnergyStored then
- energy = p.getEnergyStored()
- maxEnergy = p.getMaxEnergyStored() or 1
- end
- return energy, maxEnergy
- end
- while true do
- local chambers = { peripheral.find("hostilenetworks:sim_chamber") }
- local dataCenterIO = peripheral.find("hostilenetworks:data_center_io_port") or peripheral.wrap("data_center_io_port_0")
- if #chambers == 0 then
- for _, name in ipairs(peripheral.getNames()) do
- if name:find("sim_chamber") then
- table.insert(chambers, peripheral.wrap(name))
- end
- end
- end
- buffer.setVisible(false)
- buffer.setBackgroundColor(colors.black)
- buffer.clear()
- -- Title Bar
- buffer.setCursorPos(1, 1)
- buffer.setTextColor(colors.cyan)
- buffer.write("=== HOSTILE NETWORKS DATA CENTER ===")
- local startY = 3
- -- Render Simulation Chambers
- if #chambers == 0 then
- buffer.setCursorPos(1, 3)
- buffer.setTextColor(colors.red)
- buffer.write("ERROR: No simulation chambers found on network!")
- startY = startY + 2
- else
- for i = 1, math.min(#chambers, 2) do
- local chamber = chambers[i]
- local energy, maxEnergy = getEnergyData(chamber)
- local energyPct = math.min(100, math.floor((energy / maxEnergy) * 100))
- local modelItem = chamber.getItemDetail(1)
- local matrix = chamber.getItemDetail(2)
- local output1 = chamber.getItemDetail(3)
- local output2 = chamber.getItemDetail(4)
- local modelData = parseDataModel(modelItem)
- -- Header
- buffer.setCursorPos(1, startY)
- buffer.setTextColor(colors.yellow)
- buffer.write(string.format("[ Simulation Chamber %d ]", i))
- -- Target & Model Tier
- buffer.setCursorPos(3, startY + 1)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Target: ")
- if modelData then
- buffer.setTextColor(colors.cyan)
- buffer.write(modelData.target)
- buffer.setTextColor(colors.lightGray)
- buffer.write(" | Tier: ")
- buffer.setTextColor(colors.magenta)
- buffer.write(modelData.tier)
- else
- buffer.setTextColor(colors.red)
- buffer.write("NO MODEL")
- end
- -- Model Accuracy
- buffer.setCursorPos(3, startY + 2)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Accuracy: ")
- buffer.setTextColor(modelData and colors.magenta or colors.gray)
- buffer.write(modelData and modelData.accuracy or "N/A")
- -- Power Bar
- buffer.setCursorPos(3, startY + 3)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Power: ")
- drawProgressBar(10, startY + 3, 12, energyPct, colors.green, colors.gray)
- buffer.setTextColor(colors.white)
- buffer.write(string.format(" %s/%s FE (%d%%)", formatNumber(energy), formatNumber(maxEnergy), energyPct))
- -- Matrix Slot Count
- buffer.setCursorPos(3, startY + 4)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Matrix: ")
- if matrix then
- buffer.setTextColor(matrix.count < 8 and colors.yellow or colors.green)
- buffer.write(string.format("%d items (Loaded)", matrix.count))
- else
- buffer.setTextColor(colors.red)
- buffer.write("EMPTY (Halted)")
- end
- -- Outputs
- buffer.setCursorPos(3, startY + 5)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Output: ")
- local outList = {}
- if output1 then table.insert(outList, string.format("%s (%d)", output1.displayName or output1.name:gsub(".*:", ""), output1.count)) end
- if output2 then table.insert(outList, string.format("%s (%d)", output2.displayName or output2.name:gsub(".*:", ""), output2.count)) end
- if #outList > 0 then
- buffer.setTextColor(colors.purple)
- buffer.write(table.concat(outList, ", "))
- else
- buffer.setTextColor(colors.gray)
- buffer.write("None / Clear")
- end
- startY = startY + 7
- end
- end
- -- Render Data Center IO Port Telemetry
- if dataCenterIO then
- buffer.setCursorPos(1, startY)
- buffer.setTextColor(colors.yellow)
- buffer.write("[ Data Center IO Port ]")
- local totalMatrices = 0
- local totalOutputs = 0
- local items = dataCenterIO.list() or {}
- for slot, item in pairs(items) do
- if item.name:find("prediction_matrix") then
- totalMatrices = totalMatrices + item.count
- else
- totalOutputs = totalOutputs + item.count
- end
- end
- buffer.setCursorPos(3, startY + 1)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Buffer Matrices: ")
- buffer.setTextColor(totalMatrices > 0 and colors.green or colors.yellow)
- buffer.write(string.format("%d items in IO buffer", totalMatrices))
- buffer.setCursorPos(3, startY + 2)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Buffered Outputs: ")
- buffer.setTextColor(colors.purple)
- buffer.write(string.format("%d items pending export", totalOutputs))
- startY = startY + 4
- end
- -- Footer
- buffer.setCursorPos(1, height - 1)
- buffer.setTextColor(colors.gray)
- buffer.write(string.rep("-", width))
- buffer.setCursorPos(1, height)
- buffer.setTextColor(colors.lightGray)
- buffer.write("Status: Live Telemetry | Double-Buffered")
- buffer.setVisible(true)
- sleep(1)
- end
Pasted 2026-08-26 00:07:13
Short link:
Short link:
Recent Public Pastes