Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local gpu = component.gpu
- local power = component.induction_matrix
- local zn = require('zn')
- local from = "power_matrix"
- function monitor()
- zn.connect()
- local message = {
- from = from
- }
- local d = {}
- while true do
- d = {
- input = power.getInput()*0.4,
- output = power.getOutput()*0.4,
- current = power.getEnergy()*0.4,
- max = power.getMaxEnergy()*0.4
- }
- message["data"] = d
- local n = 2
- for i,v in pairs(d) do
- gpu.set(1, n, i .. ": " .. v .. " RF ")
- n = n+1
- end
- zn.broadcast(message)
- os.sleep(1)
- end
- zn.disconnect()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement