nate90909

Untitled

Apr 28th, 2014
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI "monAPI"
  2. local turbine1
  3. local reactor1
  4. local mon = monAPI.wrapMonitor("right")
  5.  
  6. mon.setTextColor(colors.white)
  7. mon.setBackgroundColor(colors.black)
  8. mon.clear()
  9. mon.setCursorPos(1,1)
  10. mon.setTextScale(0.5)
  11.  
  12. local section1 = mon.createSection(1,1,20,19)
  13. section1.clear()
  14. local section2 = mon.createSection(21,1,51,19)
  15. section2.clear()
  16. local section3 = mon.createSection(52,1,82,19)
  17. section3.clear()
  18.  
  19.  
  20. while true do
  21.   rednet.open("back")
  22.   id,message = rednet.receive()
  23.  
  24.   if  id == 158 then
  25.    section2.clear()
  26.    section2.setTextColor(colors.yellow)
  27.    section2.drawBorder('#','#','+')
  28.    section2.setCursorPos(2,3)
  29.    section2.setTextColor(colors.white)
  30.    section2.write('Turbine - Reactor Bank 1')
  31.    section2.setCursorPos(2,4)
  32.    section2.write('Data Broadcast Received')
  33.    section2.setCursorPos(2,5)
  34.    section2.write('System Status')
  35.    section2.setCursorPos(2,7)
  36.    section2.write('Turbine:')
  37.    section2.setCursorPos(2,8)
  38.     if message["turbine1rpm"] >= 1725 then
  39.       section2.setTextColor(colors.green)
  40.      elseif message["turbine1rpm"] >= 800 then
  41.       section2.setTextColor(colors.orange)
  42.      else
  43.       section2.setTextColor(colors.red)
  44.     end
  45.    section2.write('RPM: '..message["turbine1rpm"]..'')
  46.    section2.setCursorPos(2,9)
  47.     if message["turbine1Flow"] >= 1950 then
  48.       section2.setTextColor(colors.green)
  49.      elseif message["turbine1Flow"] >= 1000 then
  50.       section2.setTextColor(colors.orange)
  51.      else
  52.       section2.setTextColor(colors.red)
  53.     end
  54.    section2.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
  55.    section2.setCursorPos(2,10)
  56.     if message["turbine1RFT"] >= 25000 then
  57.       section2.setTextColor(colors.green)
  58.      elseif message["turbine1RFT"] >= 14000 then
  59.       section2.setTextColor(colors.orange)
  60.      else
  61.       section2.setTextColor(colors.red)
  62.     end
  63.    section2.write('Generation: '..message["turbine1RFT"]..' rf/t')
  64.    section2.setCursorPos(2,11)
  65.     if message["turbine1capacitor"] >= 900000 then
  66.       section2.setTextColor(colors.green)
  67.      elseif message["turbine1capacitor"] >= 400000 then
  68.       section2.setTextColor(colors.orange)
  69.      else
  70.       section2.setTextColor(colors.red)
  71.     end
  72.    section2.write('Capacitor: '..message["turbine1capacitor"]..'')
  73.    section2.setCursorPos(2,13)
  74.    section2.setTextColor(colors.white)
  75.    section2.write('Reactor:')
  76.    section2.setCursorPos(2,14)
  77.     if message["reactor1Temp"] <= 700 then
  78.       section2.setTextColor(colors.green)
  79.      elseif message["reactor1Temp"] <= 800 then
  80.       section2.setTextColor(colors.orange)
  81.      else
  82.       section2.setTextColor(colors.red)
  83.     end
  84.    section2.write('Temp: '..message["reactor1Temp"]..'')
  85.    section2.setCursorPos(2,15)
  86.     if message["reactor1Steam"] >= 1950 then
  87.       section2.setTextColor(colors.green)
  88.      elseif message["reactor1Steam"] >= 1000 then
  89.       section2.setTextColor(colors.orange)
  90.      else
  91.       section2.setTextColor(colors.red)
  92.     end
  93.    section2.write('Steam Pressure: '..message["reactor1Steam"]..'')
  94.    section2.setCursorPos(2,16)
  95.     if message["reactor1Fuel"] <= 0.06 then
  96.       section2.setTextColor(colors.green)
  97.      elseif message["reactor1Fuel"] <= 0.05 then
  98.       section2.setTextColor(colors.orange)
  99.      else
  100.       section2.setTextColor(colors.red)
  101.     end
  102.    section2.write('Fuel Consumption: '..message["reactor1Fuel"]..'')  
  103.  
  104.  elseif id  == 159 then
  105.    section3.clear()
  106.    section3.setTextColor(colors.yellow)
  107.    section3.drawBorder('#','#','+')
  108.    section3.setCursorPos(2,3)
  109.    section3.setTextColor(colors.white)
  110.    section3.write('Turbine - Reactor Bank 2')
  111.    section3.setCursorPos(2,4)
  112.    section3.write('Data Broadcast Received')
  113.    section3.setCursorPos(2,5)
  114.    section3.write('System Status')
  115.    section3.setCursorPos(2,7)
  116.    section3.write('Turbine:')
  117.    section3.setCursorPos(2,8)
  118.     if message["turbine1rpm"] >= 1725 then
  119.       section3.setTextColor(colors.green)
  120.      elseif message["turbine1rpm"] >= 800 then
  121.       section3.setTextColor(colors.orange)
  122.      else
  123.       section3.setTextColor(colors.red)
  124.     end
  125.    section3.write('RPM: '..message["turbine1rpm"]..'')
  126.    section3.setCursorPos(2,9)
  127.     if message["turbine1Flow"] >= 1950 then
  128.       section3.setTextColor(colors.green)
  129.      elseif message["turbine1Flow"] >= 1000 then
  130.       section3.setTextColor(colors.orange)
  131.      else
  132.       section3.setTextColor(colors.red)
  133.     end
  134.    section3.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
  135.    section3.setCursorPos(2,10)
  136.     if message["turbine1RFT"] >= 25000 then
  137.       section3.setTextColor(colors.green)
  138.      elseif message["turbine1RFT"] >= 14000 then
  139.       section3.setTextColor(colors.orange)
  140.      else
  141.       section3.setTextColor(colors.red)
  142.     end
  143.    section3.write('Generation: '..message["turbine1RFT"]..' rf/t')
  144.    section3.setCursorPos(2,11)
  145.     if message["turbine1capacitor"] >= 900000 then
  146.       section3.setTextColor(colors.green)
  147.      elseif message["turbine1capacitor"] >= 400000 then
  148.       section3.setTextColor(colors.orange)
  149.      else
  150.       section3.setTextColor(colors.red)
  151.     end
  152.    section3.write('Capacitor: '..message["turbine1capacitor"]..'')
  153.    section3.setCursorPos(2,13)
  154.    section3.setTextColor(colors.white)
  155.    section3.write('Reactor:')
  156.    section3.setCursorPos(2,14)
  157.     if message["reactor1Temp"] <= 700 then
  158.       section3.setTextColor(colors.green)
  159.      elseif message["reactor1Temp"] <= 800 then
  160.       section3.setTextColor(colors.orange)
  161.      else
  162.       section3.setTextColor(colors.red)
  163.     end
  164.    section3.write('Temp: '..message["reactor1Temp"]..'')
  165.    section3.setCursorPos(2,15)
  166.     if message["reactor1Steam"] >= 1950 then
  167.       section3.setTextColor(colors.green)
  168.      elseif message["reactor1Steam"] >= 1000 then
  169.       section3.setTextColor(colors.orange)
  170.      else
  171.       section3.setTextColor(colors.red)
  172.     end
  173.    section3.write('Steam Pressure: '..message["reactor1Steam"]..'')
  174.    section3.setCursorPos(2,16)
  175.     if message["reactor1Fuel"] <= 0.06 then
  176.       section3.setTextColor(colors.green)
  177.      elseif message["reactor1Fuel"] <= 0.05 then
  178.       section3.setTextColor(colors.orange)
  179.      else
  180.       section3.setTextColor(colors.red)
  181.     end
  182.    section3.write('Fuel Consumption: '..message["reactor1Fuel"]..'')  
  183.  end
  184.  
  185.  end
Advertisement
Add Comment
Please, Sign In to add comment