nate90909

Untitled

Apr 28th, 2014
123
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,18)
  13. section1.clear()
  14. local section2 = mon.createSection(21,1,51,18)
  15. section2.clear()
  16. local section3 = mon.createSection(52,1,82,18)
  17. section3.clear()
  18. local section4 = mon.createSection(83,1,114,18)
  19. section4.clear()
  20.  
  21.  
  22. while true do
  23.   rednet.open("back")
  24.   id,message = rednet.receive()
  25.  
  26.   if  id == 158 then
  27.    section2.clear()
  28.    section2.setTextColor(colors.yellow)
  29.    section2.drawBorder('#','#','+')
  30.    section2.setCursorPos(2,3)
  31.    section2.setTextColor(colors.white)
  32.    section2.write('Turbine - Reactor Bank 1')
  33.    section2.setCursorPos(2,4)
  34.    section2.write('Data Broadcast Received')
  35.    section2.setCursorPos(2,5)
  36.    section2.write('System Status')
  37.    section2.setCursorPos(2,7)
  38.    section2.write('Turbine:')
  39.    section2.setCursorPos(2,8)
  40.     if message["turbine1rpm"] >= 1725 then
  41.       section2.setTextColor(colors.green)
  42.      elseif message["turbine1rpm"] >= 800 then
  43.       section2.setTextColor(colors.orange)
  44.      else
  45.       section2.setTextColor(colors.red)
  46.     end
  47.    section2.write('RPM: '..message["turbine1rpm"]..'')
  48.    section2.setCursorPos(2,9)
  49.     if message["turbine1Flow"] >= 1950 then
  50.       section2.setTextColor(colors.green)
  51.      elseif message["turbine1Flow"] >= 1000 then
  52.       section2.setTextColor(colors.orange)
  53.      else
  54.       section2.setTextColor(colors.red)
  55.     end
  56.    section2.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
  57.    section2.setCursorPos(2,10)
  58.     if message["turbine1RFT"] >= 25000 then
  59.       section2.setTextColor(colors.green)
  60.      elseif message["turbine1RFT"] >= 14000 then
  61.       section2.setTextColor(colors.orange)
  62.      else
  63.       section2.setTextColor(colors.red)
  64.     end
  65.    section2.write('Generation: '..message["turbine1RFT"]..' rf/t')
  66.    section2.setCursorPos(2,11)
  67.     if message["turbine1capacitor"] >= 900000 then
  68.       section2.setTextColor(colors.green)
  69.      elseif message["turbine1capacitor"] >= 400000 then
  70.       section2.setTextColor(colors.orange)
  71.      else
  72.       section2.setTextColor(colors.red)
  73.     end
  74.    section2.write('Capacitor: '..message["turbine1capacitor"]..'')
  75.    section2.setCursorPos(2,13)
  76.    section2.setTextColor(colors.white)
  77.    section2.write('Reactor:')
  78.    section2.setCursorPos(2,14)
  79.     if message["reactor1Temp"] <= 700 then
  80.       section2.setTextColor(colors.green)
  81.      elseif message["reactor1Temp"] <= 800 then
  82.       section2.setTextColor(colors.orange)
  83.      else
  84.       section2.setTextColor(colors.red)
  85.     end
  86.    section2.write('Temp: '..message["reactor1Temp"]..'')
  87.    section2.setCursorPos(2,15)
  88.     if message["reactor1Steam"] >= 1950 then
  89.       section2.setTextColor(colors.green)
  90.      elseif message["reactor1Steam"] >= 1000 then
  91.       section2.setTextColor(colors.orange)
  92.      else
  93.       section2.setTextColor(colors.red)
  94.     end
  95.    section2.write('Steam Pressure: '..message["reactor1Steam"]..'')
  96.    section2.setCursorPos(2,16)
  97.     if message["reactor1Fuel"] <= 0.06 then
  98.       section2.setTextColor(colors.green)
  99.      elseif message["reactor1Fuel"] <= 0.05 then
  100.       section2.setTextColor(colors.orange)
  101.      else
  102.       section2.setTextColor(colors.red)
  103.     end
  104.    section2.write('Fuel Consumption: '..message["reactor1Fuel"]..'')  
  105.  
  106.  elseif id  == 159 then
  107.    section3.clear()
  108.    section3.setTextColor(colors.yellow)
  109.    section3.drawBorder('#','#','+')
  110.    section3.setCursorPos(2,3)
  111.    section3.setTextColor(colors.white)
  112.    section3.write('Turbine - Reactor Bank 2')
  113.    section3.setCursorPos(2,4)
  114.    section3.write('Data Broadcast Received')
  115.    section3.setCursorPos(2,5)
  116.    section3.write('System Status')
  117.    section3.setCursorPos(2,7)
  118.    section3.write('Turbine:')
  119.    section3.setCursorPos(2,8)
  120.     if message["turbine1rpm"] >= 1725 then
  121.       section3.setTextColor(colors.green)
  122.      elseif message["turbine1rpm"] >= 800 then
  123.       section3.setTextColor(colors.orange)
  124.      else
  125.       section3.setTextColor(colors.red)
  126.     end
  127.    section3.write('RPM: '..message["turbine1rpm"]..'')
  128.    section3.setCursorPos(2,9)
  129.     if message["turbine1Flow"] >= 1950 then
  130.       section3.setTextColor(colors.green)
  131.      elseif message["turbine1Flow"] >= 1000 then
  132.       section3.setTextColor(colors.orange)
  133.      else
  134.       section3.setTextColor(colors.red)
  135.     end
  136.    section3.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
  137.    section3.setCursorPos(2,10)
  138.     if message["turbine1RFT"] >= 25000 then
  139.       section3.setTextColor(colors.green)
  140.      elseif message["turbine1RFT"] >= 14000 then
  141.       section3.setTextColor(colors.orange)
  142.      else
  143.       section3.setTextColor(colors.red)
  144.     end
  145.    section3.write('Generation: '..message["turbine1RFT"]..' rf/t')
  146.    section3.setCursorPos(2,11)
  147.     if message["turbine1capacitor"] >= 900000 then
  148.       section3.setTextColor(colors.green)
  149.      elseif message["turbine1capacitor"] >= 400000 then
  150.       section3.setTextColor(colors.orange)
  151.      else
  152.       section3.setTextColor(colors.red)
  153.     end
  154.    section3.write('Capacitor: '..message["turbine1capacitor"]..'')
  155.    section3.setCursorPos(2,13)
  156.    section3.setTextColor(colors.white)
  157.    section3.write('Reactor:')
  158.    section3.setCursorPos(2,14)
  159.     if message["reactor1Temp"] <= 700 then
  160.       section3.setTextColor(colors.green)
  161.      elseif message["reactor1Temp"] <= 800 then
  162.       section3.setTextColor(colors.orange)
  163.      else
  164.       section3.setTextColor(colors.red)
  165.     end
  166.    section3.write('Temp: '..message["reactor1Temp"]..'')
  167.    section3.setCursorPos(2,15)
  168.     if message["reactor1Steam"] >= 1950 then
  169.       section3.setTextColor(colors.green)
  170.      elseif message["reactor1Steam"] >= 1000 then
  171.       section3.setTextColor(colors.orange)
  172.      else
  173.       section3.setTextColor(colors.red)
  174.     end
  175.    section3.write('Steam Pressure: '..message["reactor1Steam"]..'')
  176.    section3.setCursorPos(2,16)
  177.     if message["reactor1Fuel"] <= 0.06 then
  178.       section3.setTextColor(colors.green)
  179.      elseif message["reactor1Fuel"] <= 0.05 then
  180.       section3.setTextColor(colors.orange)
  181.      else
  182.       section3.setTextColor(colors.red)
  183.     end
  184.    section3.write('Fuel Consumption: '..message["reactor1Fuel"]..'')  
  185.  
  186.   elseif id  == 161 then
  187.    section4.clear()
  188.    section4.setTextColor(colors.yellow)
  189.    section4.drawBorder('#','#','+')
  190.    section4.setCursorPos(2,3)
  191.    section4.setTextColor(colors.white)
  192.    section4.write('Turbine - Reactor Bank 2')
  193.    section4.setCursorPos(2,4)
  194.    section4.write('Data Broadcast Received')
  195.    section4.setCursorPos(2,5)
  196.    section4.write('System Status')
  197.    section4.setCursorPos(2,7)
  198.    section4.write('Turbine:')
  199.    section4.setCursorPos(2,8)
  200.     if message["turbine1rpm"] >= 1725 then
  201.       section4.setTextColor(colors.green)
  202.      elseif message["turbine1rpm"] >= 800 then
  203.       section4.setTextColor(colors.orange)
  204.      else
  205.       section4.setTextColor(colors.red)
  206.     end
  207.    section4.write('RPM: '..message["turbine1rpm"]..'')
  208.    section4.setCursorPos(2,9)
  209.     if message["turbine1Flow"] >= 1950 then
  210.       section4.setTextColor(colors.green)
  211.      elseif message["turbine1Flow"] >= 1000 then
  212.       section4.setTextColor(colors.orange)
  213.      else
  214.       section4.setTextColor(colors.red)
  215.     end
  216.    section4.write('Flow Rate: '..message["turbine1Flow"]..'mb/t')
  217.    section4.setCursorPos(2,10)
  218.     if message["turbine1RFT"] >= 25000 then
  219.       section4.setTextColor(colors.green)
  220.      elseif message["turbine1RFT"] >= 14000 then
  221.       section4.setTextColor(colors.orange)
  222.      else
  223.       section4.setTextColor(colors.red)
  224.     end
  225.    section4.write('Generation: '..message["turbine1RFT"]..' rf/t')
  226.    section4.setCursorPos(2,11)
  227.     if message["turbine1capacitor"] >= 900000 then
  228.       section4.setTextColor(colors.green)
  229.      elseif message["turbine1capacitor"] >= 400000 then
  230.       section4.setTextColor(colors.orange)
  231.      else
  232.       section4.setTextColor(colors.red)
  233.     end
  234.    section4.write('Capacitor: '..message["turbine1capacitor"]..'')
  235.    section4.setCursorPos(2,13)
  236.    section4.setTextColor(colors.white)
  237.    section4.write('Reactor:')
  238.    section4.setCursorPos(2,14)
  239.     if message["reactor1Temp"] <= 700 then
  240.       section4.setTextColor(colors.green)
  241.      elseif message["reactor1Temp"] <= 800 then
  242.       section4.setTextColor(colors.orange)
  243.      else
  244.       section4.setTextColor(colors.red)
  245.     end
  246.    section4.write('Temp: '..message["reactor1Temp"]..'')
  247.    section4.setCursorPos(2,15)
  248.     if message["reactor1Steam"] >= 1950 then
  249.       section4.setTextColor(colors.green)
  250.      elseif message["reactor1Steam"] >= 1000 then
  251.       section4.setTextColor(colors.orange)
  252.      else
  253.       section4.setTextColor(colors.red)
  254.     end
  255.    section4.write('Steam Pressure: '..message["reactor1Steam"]..'')
  256.    section4.setCursorPos(2,16)
  257.     if message["reactor1Fuel"] <= 0.06 then
  258.       section4.setTextColor(colors.green)
  259.      elseif message["reactor1Fuel"] <= 0.05 then
  260.       section4.setTextColor(colors.orange)
  261.      else
  262.       section4.setTextColor(colors.red)
  263.     end
  264.    section4.write('Fuel Consumption: '..message["reactor1Fuel"]..'')  
  265.  end
  266.  
  267.  end
Advertisement
Add Comment
Please, Sign In to add comment