jonassvensson4

FTB | Main monitor

Mar 7th, 2016
105
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. mon.setTextScale(2)
  9. mon.write("Reactor")
  10.  
  11. while true do
  12. -- Reactor
  13.     id, msg = rednet.receive()
  14.     table = textutils.unserialize(msg)
  15.  
  16.     energy = table[1]
  17.     fuel = table[2]
  18.     maxfuel = table[3]
  19.     active = table[4]
  20.  
  21. -- Status
  22.     mon.setCursorPos(1,3)
  23.     mon.setTextColor(colors.green)
  24.     mon.write("Status: ")
  25.     mon.setTextColor(colors.red)
  26.     if active == true then
  27.         mon.write("Online")
  28.     else
  29.         mon.write("Offline")
  30.     end
  31.    
  32. -- Fuel
  33.     mon.setCursorPos(1,4)    
  34.     mon.setTextColor(colors.green)
  35.     mon.write("Fuel: ")
  36.  
  37.     mon.setTextColor(colors.red)
  38.     mon.write(fuel)
  39.     mon.write("/")
  40.     mon.write(maxfuel)
  41.  
  42. -- Energy
  43.     mon.setCursorPos(1,5)
  44.     mon.setTextColor(colors.green)
  45.     mon.write("Energy: ")
  46.     mon.setTextColor(colors.red)
  47.     mon.write(energy)
  48.     mon.write("/10000000")
  49.  
  50. -- Lava and water tank
  51. --  mon.setCursorPos(1,7)
  52. --  mon.setTextColor(colors.green)
  53. --  mon.write("Tanks: ")
  54. --  mon.setTextColor(colors.red)
  55. --  mon.write(energy)
  56.  
  57.     sleep(0)
  58. end
Advertisement
Add Comment
Please, Sign In to add comment