Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("M3C/utils")
- os.loadAPI("M3C/kvApi")
- local glasses = utils.findAndWrap("openperipheral_bridge")
- local boxBgColor = 0xFFFFFF
- local boxTextColor = 0xF5F5F5
- local boxStartXCoord = 0
- local boxStartYCoord = 20
- function drawBox(height)
- glasses.addBox(boxStartXCoord, boxStartYCoord, 170, height, boxBgColor, .2)
- end
- function display(text)
- glasses.clear()
- local yPos = boxStartYCoord
- for index,line in utils.orderTable(text) do
- glasses.addText(boxStartXCoord + 5, yPos, index .. ": " .. line, boxTextColor)
- yPos = yPos + 10
- end
- drawBox(yPos - boxStartYCoord)
- glasses.sync()
- end
- kvApi.initializeWirelessModems()
- while true do
- local powerStatus = kvApi.deserializeKvResponse(kvApi.clientGet("powerStatus"))
- sleep(5)
- local meStatus = kvApi.deserializeKvResponse(kvApi.clientGet("meStatus"))
- sleep(5)
- local reactor = kvApi.deserializeKvResponse(kvApi.clientGet("reactorStatus"))
- local displayText={}
- if powerStatus ~= "No key found!" then
- displayText["Power"] = utils.formatInt(powerStatus.Available) .. "%" .. " @ " .. powerStatus.Updated
- end
- if meStatus ~= "No key found!" then
- displayText["ME Slots"] = utils.formatInt(meStatus.usedSlots) .. "/" .. utils.formatInt(meStatus.totalSlots) .. " @ " .. meStatus.Updated
- displayText["ME Bytes"] = utils.convertMEBytes(meStatus.usedBytes) .. "/" .. utils.convertMEBytes(meStatus.totalBytes) .. " @ " .. meStatus.Updated
- end
- if reactor ~= "No key found!" then
- displayText["Blutonium"] = utils.formatInt(reactor["Blutonium Ingot"]) .. " @ " .. reactor["Updated"]
- displayText["Yellorium"] = utils.formatInt(reactor["Yellorium Ingot"]) .. " @ " .. reactor["Updated"]
- end
- display(displayText)
- sleep(25)
- end
Add Comment
Please, Sign In to add comment