require("ui") peripheral.find("modem", rednet.open) local mon = peripheral.wrap("back") or error("No monitor found") term.redirect(mon) local w,h = mon.getSize() function processData() local senderId, message, protocol = rednet.receive("cakehud") local data = textutils.unserialize(message) mon.setTextScale(0.5) mon.setBackgroundColor(colors.purple) mon.setCursorPos(4,4) mon.clear() -- Boxes Box(2, 1, w - 2, h - 2, colors.gray, nil) Box(2, 14, w - 2, 1, colors.purple, nil) -- Texts Text(2, 2, "TPS: " .. math.floor(data.tps), "medium", colors.gray, colors.white) Text(2, 6, "Power: " .. data.power.power .. "/" .. data.power.maxPower, "medium", colors.gray, colors.white) Text(2, 10, "Reactor status: " .. (data.reactorStatus and "charging" or "discharging"), "medium", colors.gray, colors.white) -- Todo list Text(0, 13, "Todo list", "medium", colors.purple, colors.white) for i = 1, #data.todo do Text(2, 14 + i * 3, string.format("#%s %s %s", i, string.char(16), data.todo[i]), "medium", colors.gray, colors.white) end end while true do processData() end