Guest User

Untitled

a guest
May 10th, 2017
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local component = require("component")
  2. local gpu = component.gpu
  3. local power = component.induction_matrix
  4. local zn = require('zn')
  5.  
  6. local from = "power_matrix"
  7.  
  8. function monitor()
  9.     zn.connect()
  10.     local message = {
  11.       from = from
  12.     }
  13.     local d = {}
  14.     while true do
  15.         d = {
  16.             input       = power.getInput()*0.4,
  17.             output      = power.getOutput()*0.4,
  18.             current     = power.getEnergy()*0.4,
  19.             max         = power.getMaxEnergy()*0.4
  20.         }
  21.         message["data"] = d
  22.         local n = 2
  23.         for i,v in pairs(d) do
  24.             gpu.set(1, n, i .. ": " .. v .. " RF                 ")
  25.             n = n+1
  26.         end
  27.         zn.broadcast(message)
  28.         os.sleep(1)
  29.     end
  30.     zn.disconnect()
  31. end
RAW Paste Data