jonassvensson4

Monitor - WCC server

Aug 30th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local mon = peripheral.wrap("right")
  2. rednet.open("top")
  3. mon.clear()
  4.  
  5. -- Print
  6. mon.setCursorPos(1,1)
  7. mon.setTextColor(colors.blue)
  8. monitor.setTextScale(2)
  9. mon.write("Energy storage")
  10.  
  11. while true do
  12. -- Reactor
  13.     id, msg = rednet.receive()
  14.     table = textutils.unserialize(msg)
  15.  
  16.     energy = table[1]
  17.     maxenergy = table[2]
  18.  
  19. -- Energy
  20.     mon.setCursorPos(1,3)
  21.     mon.setTextColor(colors.green)
  22.     mon.write("Energy: ")
  23.     mon.setTextColor(colors.red)
  24.     mon.write(energy)
  25.     mon.write(maxenergy)
  26.  
  27.     sleep(0)
  28. end
Add Comment
Please, Sign In to add comment