Guest User

Untitled

a guest
May 10th, 2017
59
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 me = require('me')
  4. local zn = require('zn')
  5.  
  6. local watch = {"deuterium", "tritium"}
  7. local from = "gases_reactor"
  8.  
  9. function monitor()
  10.     zn.connect()
  11.     local storage = me:new()
  12.     local message = {
  13.         from = from
  14.     }
  15.     local d
  16.     while true do
  17.         d = storage:getGases(watch)
  18.         message["data"] = d
  19.         local n = 2
  20.         for i,v in pairs(d) do
  21.             gpu.set(1, n, i .. ": " .. v .. " mB")
  22.             n = n + 1
  23.         end
  24.         zn.broadcast(message)
  25.         os.sleep(1)
  26.     end
  27.     zn.disconnect()
  28. end
RAW Paste Data