Untitled
  1. -- ATM10 Hostile Neural Networks Dual Chamber & Data Center Dashboard
  2. -- Compatible with Minecraft 1.21.1 / NeoForge / ModernFix
  3.  
  4. local monitor = peripheral.find("monitor")
  5. local display = monitor or term
  6.  
  7. if monitor then
  8. monitor.setTextScale(0.5)
  9. end
  10.  
  11. local width, height = display.getSize()
  12. local buffer = window.create(display, 1, 1, width, height, false)
  13.  
  14. local function formatNumber(n)
  15. if not n then return "0" end
  16. if n >= 1e6 then return string.format("%.2fM", n / 1e6)
  17. elseif n >= 1e3 then return string.format("%.1fk", n / 1e3)
  18. else return tostring(math.floor(n)) end
  19. end
  20.  
  21. local function drawProgressBar(x, y, barWidth, percent, fgColor, bgColor)
  22. buffer.setCursorPos(x, y)
  23. local filled = math.floor((math.min(100, math.max(0, percent)) / 100) * barWidth)
  24. buffer.setTextColor(fgColor)
  25. buffer.write(string.rep("|", filled))
  26. buffer.setTextColor(bgColor)
  27. buffer.write(string.rep("-", math.max(0, barWidth - filled)))
  28. end
  29.  
  30. -- Deep inspector to decode 1.21 Data Components & calculate exact Accuracy %
  31. local function parseDataModel(item)
  32. if not item then return nil end
  33.  
  34. local modelInfo = {
  35. target = item.displayName:gsub(" Data Model", ""):gsub("Model: ", ""),
  36. tier = "Faulty",
  37. accuracy = "5.00%",
  38. data = 0,
  39. maxData = 0
  40. }
  41.  
  42. local rawStrings = {}
  43. local function inspectNode(tbl)
  44. if type(tbl) ~= "table" then return end
  45. for k, v in pairs(tbl) do
  46. local kStr = tostring(k):lower()
  47. if type(v) == "string" then
  48. table.insert(rawStrings, v)
  49. local vLow = v:lower()
  50. if vLow:find("self_aware") or vLow:find("self%-aware") or vLow:find("self aware") then
  51. modelInfo.tier = "Self-Aware"
  52. elseif vLow:find("superior") then
  53. modelInfo.tier = "Superior"
  54. elseif vLow:find("advanced") then
  55. modelInfo.tier = "Advanced"
  56. elseif vLow:find("basic") then
  57. modelInfo.tier = "Basic"
  58. end
  59. elseif type(v) == "number" then
  60. if kStr == "tier" or kStr == "model_tier" then
  61. local tierMap = { [0] = "Faulty", [1] = "Basic", [2] = "Advanced", [3] = "Superior", [4] = "Self-Aware" }
  62. if tierMap[v] then modelInfo.tier = tierMap[v] end
  63. elseif kStr == "data" or kStr == "data_collected" or kStr == "sim_data" then
  64. modelInfo.data = v
  65. elseif kStr == "max_data" or kStr == "data_needed" or kStr == "target_data" then
  66. modelInfo.maxData = v
  67. end
  68. elseif type(v) == "table" then
  69. inspectNode(v)
  70. end
  71. end
  72. end
  73. inspectNode(item)
  74.  
  75. local fullText = table.concat(rawStrings, " "):gsub("Β§.", "")
  76.  
  77. -- Fallback string matches
  78. if fullText:find("Self%-Aware") or fullText:find("Self Aware") or fullText:find("self_aware") then
  79. modelInfo.tier = "Self-Aware"
  80. elseif fullText:find("Superior") or fullText:find("superior") then
  81. modelInfo.tier = "Superior"
  82. elseif fullText:find("Advanced") or fullText:find("advanced") then
  83. modelInfo.tier = "Advanced"
  84. elseif fullText:find("Basic") or fullText:find("basic") then
  85. modelInfo.tier = "Basic"
  86. end
  87.  
  88. -- Accuracy calculation based on HNN 1.21 formulas
  89. local accMatch = fullText:match("Accuracy:%s*([%d%.]+%%)") or fullText:match("([%d%.]+%%)")
  90. if accMatch then
  91. modelInfo.accuracy = accMatch
  92. else
  93. if modelInfo.tier == "Superior" then
  94. local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 900
  95. local progress = math.min(1.0, modelInfo.data / maxD)
  96. modelInfo.accuracy = string.format("%.2f%%", 72.43 + (progress * 12.57))
  97. elseif modelInfo.tier == "Advanced" then
  98. local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 256
  99. local progress = math.min(1.0, modelInfo.data / maxD)
  100. modelInfo.accuracy = string.format("%.2f%%", 67.00 + (progress * 5.43))
  101. elseif modelInfo.tier == "Basic" then
  102. local maxD = modelInfo.maxData > 0 and modelInfo.maxData or 48
  103. local progress = math.min(1.0, modelInfo.data / maxD)
  104. modelInfo.accuracy = string.format("%.2f%%", 30.00 + (progress * 37.00))
  105. elseif modelInfo.tier == "Self-Aware" then
  106. modelInfo.accuracy = "99.50%"
  107. else
  108. modelInfo.accuracy = "5.00%"
  109. end
  110. end
  111.  
  112. return modelInfo
  113. end
  114.  
  115. local function getEnergyData(p)
  116. local energy, maxEnergy = 0, 1
  117. if p.getEnergy then
  118. energy = p.getEnergy()
  119. maxEnergy = p.getEnergyCapacity() or 1
  120. elseif p.getEnergyStored then
  121. energy = p.getEnergyStored()
  122. maxEnergy = p.getMaxEnergyStored() or 1
  123. end
  124. return energy, maxEnergy
  125. end
  126.  
  127. while true do
  128. local chambers = { peripheral.find("hostilenetworks:sim_chamber") }
  129. local dataCenterIO = peripheral.find("hostilenetworks:data_center_io_port") or peripheral.wrap("data_center_io_port_0")
  130.  
  131. if #chambers == 0 then
  132. for _, name in ipairs(peripheral.getNames()) do
  133. if name:find("sim_chamber") then
  134. table.insert(chambers, peripheral.wrap(name))
  135. end
  136. end
  137. end
  138.  
  139. buffer.setVisible(false)
  140. buffer.setBackgroundColor(colors.black)
  141. buffer.clear()
  142.  
  143. -- Title Bar
  144. buffer.setCursorPos(1, 1)
  145. buffer.setTextColor(colors.cyan)
  146. buffer.write("=== HOSTILE NETWORKS DATA CENTER ===")
  147.  
  148. local startY = 3
  149.  
  150. -- Render Simulation Chambers
  151. if #chambers == 0 then
  152. buffer.setCursorPos(1, 3)
  153. buffer.setTextColor(colors.red)
  154. buffer.write("ERROR: No simulation chambers found on network!")
  155. startY = startY + 2
  156. else
  157. for i = 1, math.min(#chambers, 2) do
  158. local chamber = chambers[i]
  159. local energy, maxEnergy = getEnergyData(chamber)
  160. local energyPct = math.min(100, math.floor((energy / maxEnergy) * 100))
  161.  
  162. local modelItem = chamber.getItemDetail(1)
  163. local matrix = chamber.getItemDetail(2)
  164. local output1 = chamber.getItemDetail(3)
  165. local output2 = chamber.getItemDetail(4)
  166. local modelData = parseDataModel(modelItem)
  167.  
  168. -- Header
  169. buffer.setCursorPos(1, startY)
  170. buffer.setTextColor(colors.yellow)
  171. buffer.write(string.format("[ Simulation Chamber %d ]", i))
  172.  
  173. -- Target & Model Tier
  174. buffer.setCursorPos(3, startY + 1)
  175. buffer.setTextColor(colors.lightGray)
  176. buffer.write("Target: ")
  177. if modelData then
  178. buffer.setTextColor(colors.cyan)
  179. buffer.write(modelData.target)
  180. buffer.setTextColor(colors.lightGray)
  181. buffer.write(" | Tier: ")
  182. buffer.setTextColor(colors.magenta)
  183. buffer.write(modelData.tier)
  184. else
  185. buffer.setTextColor(colors.red)
  186. buffer.write("NO MODEL")
  187. end
  188.  
  189. -- Model Accuracy
  190. buffer.setCursorPos(3, startY + 2)
  191. buffer.setTextColor(colors.lightGray)
  192. buffer.write("Accuracy: ")
  193. buffer.setTextColor(modelData and colors.magenta or colors.gray)
  194. buffer.write(modelData and modelData.accuracy or "N/A")
  195.  
  196. -- Power Bar
  197. buffer.setCursorPos(3, startY + 3)
  198. buffer.setTextColor(colors.lightGray)
  199. buffer.write("Power: ")
  200. drawProgressBar(10, startY + 3, 12, energyPct, colors.green, colors.gray)
  201. buffer.setTextColor(colors.white)
  202. buffer.write(string.format(" %s/%s FE (%d%%)", formatNumber(energy), formatNumber(maxEnergy), energyPct))
  203.  
  204. -- Matrix Slot Count
  205. buffer.setCursorPos(3, startY + 4)
  206. buffer.setTextColor(colors.lightGray)
  207. buffer.write("Matrix: ")
  208. if matrix then
  209. buffer.setTextColor(matrix.count < 8 and colors.yellow or colors.green)
  210. buffer.write(string.format("%d items (Loaded)", matrix.count))
  211. else
  212. buffer.setTextColor(colors.red)
  213. buffer.write("EMPTY (Halted)")
  214. end
  215.  
  216. -- Outputs
  217. buffer.setCursorPos(3, startY + 5)
  218. buffer.setTextColor(colors.lightGray)
  219. buffer.write("Output: ")
  220. local outList = {}
  221. if output1 then table.insert(outList, string.format("%s (%d)", output1.displayName or output1.name:gsub(".*:", ""), output1.count)) end
  222. if output2 then table.insert(outList, string.format("%s (%d)", output2.displayName or output2.name:gsub(".*:", ""), output2.count)) end
  223.  
  224. if #outList > 0 then
  225. buffer.setTextColor(colors.purple)
  226. buffer.write(table.concat(outList, ", "))
  227. else
  228. buffer.setTextColor(colors.gray)
  229. buffer.write("None / Clear")
  230. end
  231.  
  232. startY = startY + 7
  233. end
  234. end
  235.  
  236. -- Render Data Center IO Port Telemetry
  237. if dataCenterIO then
  238. buffer.setCursorPos(1, startY)
  239. buffer.setTextColor(colors.yellow)
  240. buffer.write("[ Data Center IO Port ]")
  241.  
  242. local totalMatrices = 0
  243. local totalOutputs = 0
  244. local items = dataCenterIO.list() or {}
  245.  
  246. for slot, item in pairs(items) do
  247. if item.name:find("prediction_matrix") then
  248. totalMatrices = totalMatrices + item.count
  249. else
  250. totalOutputs = totalOutputs + item.count
  251. end
  252. end
  253.  
  254. buffer.setCursorPos(3, startY + 1)
  255. buffer.setTextColor(colors.lightGray)
  256. buffer.write("Buffer Matrices: ")
  257. buffer.setTextColor(totalMatrices > 0 and colors.green or colors.yellow)
  258. buffer.write(string.format("%d items in IO buffer", totalMatrices))
  259.  
  260. buffer.setCursorPos(3, startY + 2)
  261. buffer.setTextColor(colors.lightGray)
  262. buffer.write("Buffered Outputs: ")
  263. buffer.setTextColor(colors.purple)
  264. buffer.write(string.format("%d items pending export", totalOutputs))
  265.  
  266. startY = startY + 4
  267. end
  268.  
  269. -- Footer
  270. buffer.setCursorPos(1, height - 1)
  271. buffer.setTextColor(colors.gray)
  272. buffer.write(string.rep("-", width))
  273. buffer.setCursorPos(1, height)
  274. buffer.setTextColor(colors.lightGray)
  275. buffer.write("Status: Live Telemetry | Double-Buffered")
  276.  
  277. buffer.setVisible(true)
  278. sleep(1)
  279. end
Pasted 2026-08-26 00:07:13

Short link: