Advertisement
Bendresz

Untitled

Nov 20th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 18.48 KB | None | 0 0
  1. mon = peripheral.wrap("left")
  2. r1 = peripheral.wrap("BigReactors-Reactor_2")
  3. r2 = peripheral.wrap("BigReactors-Reactor_3")
  4. r3 = peripheral.wrap("BigReactors-Reactor_4")
  5. mod = 1
  6. x = 0
  7. y = 0
  8. r1mod = 0
  9. r1min = 2000000
  10. r1max = 7000000
  11. r1minarl = 50
  12. r1maxarl = 90
  13. r1ossz = 50
  14. r2mod = 0
  15. r2min = 2000000
  16. r2max = 7000000
  17. r2minarl = 50
  18. r2maxarl = 90
  19. r2ossz = 50
  20. automata1 = 0
  21. automata2 = 0
  22. function click()
  23.     event, pos, x, y = os.pullEvent("monitor_touch")
  24. end
  25.  
  26. function drawLine(x,y,l,s,c)
  27.     for yPos = y, y+l-1 do
  28.         mon.setBackgroundColor(c)
  29.         mon.setCursorPos(x, yPos)
  30.         mon.write(string.rep(" ", s))
  31.     end
  32.     mon.setBackgroundColor(colors.black)
  33. end
  34.  
  35. function futas()
  36.     mon.setTextScale(0.8)
  37.     mon.setBackgroundColor(colors.black)
  38.     mon.clear()
  39.    
  40.     if x > 2 and x < 18 and y > 2 and y < 6 then
  41.         mod = 1
  42.     elseif x > 2 and x < 18 and y > 6 and y < 10 then
  43.         mod = 2
  44.     elseif x > 2 and x < 18 and y > 10 and y < 14 then
  45.         mod = 3
  46.     end
  47.    
  48.     if mod == 1 then
  49.         if  x > 59 and x < 71 and y > 2 and y < 6 then
  50.             r1.setActive(true)
  51.             x=0
  52.             y=0
  53.         elseif x > 71 and x < 83 and y > 2 and y < 6 then
  54.             r1.setActive(false)
  55.             x=0
  56.             y=0
  57.         elseif x > 71 and x < 83 and y > 6 and y < 10 then
  58.             if automata1 == 0 then
  59.                 automata1 = 1
  60.             else
  61.                 automata1 = 0
  62.             end
  63.             x=0
  64.             y=0
  65.         end
  66.         if automata1 == 0 then
  67.             if  r1min < r1max and x > 24 and x < 43 and y > 13 and y < 15 then
  68.                 r1min = r1min + 1000000
  69.                 x=0
  70.                 y=0
  71.             elseif r1min > 0 and x > 24 and x < 43 and y > 15 and y < 17 then
  72.                 r1min = r1min - 1000000
  73.                 x=0
  74.                 y=0
  75.             elseif r1max < 10000000 and x > 59 and x < 78 and y > 13 and y < 15 then
  76.                 r1max = r1max + 1000000
  77.                 x=0
  78.                 y=0
  79.             elseif r1max > r1min and x > 59 and x < 78 and y > 15 and y < 17 then
  80.                 r1max = r1max - 1000000
  81.                 x=0
  82.                 y=0
  83.                
  84.             elseif r1minarl < r1maxarl and x > 24 and x < 43 and y > 18 and y < 20 then
  85.                 r1minarl = r1minarl + 10
  86.                 x=0
  87.                 y=0
  88.             elseif r1minarl > 0 and x > 24 and x < 43 and y > 19 and y < 21 then
  89.                 r1minarl = r1minarl - 10
  90.                 x=0
  91.                 y=0
  92.             elseif r1maxarl < 100 and x > 59 and x < 78 and y > 18 and y < 20 then
  93.                 r1maxarl = r1maxarl + 10
  94.                 x=0
  95.                 y=0
  96.             elseif r1maxarl > r1minarl and x > 59 and x < 78 and y > 19 and y < 21 then
  97.                 r1maxarl = r1maxarl - 10
  98.                 x=0
  99.                 y=0
  100.             end
  101.         else
  102.             if  x > 59 and x < 71 and y > 6 and y < 10 then
  103.                 if r1mod == 0 then
  104.                     r1mod = 1
  105.                     x = 0
  106.                     y = 0
  107.                 else
  108.                     r1mod = 0
  109.                     x = 0
  110.                     y = 0
  111.                 end
  112.             end
  113.             if r1mod == 0 then
  114.                 if r1ossz > 0 and x > 59 and x < 63 and y > 10 and y < 14 then
  115.                     r1ossz = r1ossz - 10
  116.                     x = 0
  117.                     y = 0
  118.                 elseif r1ossz < 100 and x > 66 and x < 71 and y > 10 and y < 14 then
  119.                     r1ossz = r1ossz + 10
  120.                     x = 0
  121.                     y = 0
  122.                 end
  123.             else
  124.            
  125.             end
  126.         end
  127.            
  128.     elseif mod == 2 then
  129.         if  x > 59 and x < 71 and y > 2 and y < 6 then
  130.             r2.setActive(true)
  131.             x=0
  132.             y=0
  133.         elseif x > 71 and x < 83 and y > 2 and y < 6 then
  134.             r2.setActive(false)
  135.             x=0
  136.             y=0
  137.         elseif x > 71 and x < 83 and y > 6 and y < 10 then
  138.             if automata2 == 0 then
  139.                 automata2 = 1
  140.             else
  141.                 automata2 = 0
  142.             end
  143.             x=0
  144.             y=0
  145.         end
  146.         if automata2 == 0 then
  147.             if  r2min < r2max and x > 24 and x < 43 and y > 13 and y < 15 then
  148.                 r2min = r2min + 1000000
  149.                 x=0
  150.                 y=0
  151.             elseif r2min > 0 and x > 24 and x < 43 and y > 15 and y < 17 then
  152.                 r1min = r1min - 1000000
  153.                 x=0
  154.                 y=0
  155.             elseif r2max < 10000000 and x > 59 and x < 78 and y > 13 and y < 15 then
  156.                 r2max = r2max + 1000000
  157.                 x=0
  158.                 y=0
  159.             elseif r2max > r2min and x > 59 and x < 78 and y > 15 and y < 17 then
  160.                 r2max = r2max - 1000000
  161.                 x=0
  162.                 y=0
  163.                
  164.             elseif r2minarl < r2maxarl and x > 24 and x < 43 and y > 18 and y < 20 then
  165.                 r2minarl = r2minarl + 10
  166.                 x=0
  167.                 y=0
  168.             elseif r2minarl > 0 and x > 24 and x < 43 and y > 19 and y < 21 then
  169.                 r2minarl = r2minarl - 10
  170.                 x=0
  171.                 y=0
  172.             elseif r2maxarl < 100 and x > 59 and x < 78 and y > 18 and y < 20 then
  173.                 r2maxarl = r2maxarl + 10
  174.                 x=0
  175.                 y=0
  176.             elseif r2maxarl > r2minarl and x > 59 and x < 78 and y > 19 and y < 21 then
  177.                 r2maxarl = r2maxarl - 10
  178.                 x=0
  179.                 y=0
  180.             end
  181.         else
  182.             if  x > 59 and x < 71 and y > 6 and y < 10 then
  183.                 if r2mod == 0 then
  184.                     r2mod = 1
  185.                     x = 0
  186.                     y = 0
  187.                 else
  188.                     r2mod = 0
  189.                     x = 0
  190.                     y = 0
  191.                 end
  192.             end
  193.             if r2mod == 0 then
  194.                 if r2ossz > 0 and x > 59 and x < 63 and y > 10 and y < 14 then
  195.                     r2ossz = r2ossz - 10
  196.                     x = 0
  197.                     y = 0
  198.                 elseif r2ossz < 100 and x > 66 and x < 71 and y > 10 and y < 14 then
  199.                     r2ossz = r2ossz + 10
  200.                     x = 0
  201.                     y = 0
  202.                 end
  203.             else
  204.            
  205.             end
  206.         end
  207.  
  208.     elseif mod == 3 then
  209.    
  210.     end
  211.    
  212.     if mod == 1 then
  213.         mon.setCursorPos(3,3)
  214.         mon.setBackgroundColor(colors.lightBlue)
  215.         mon.write("              ")
  216.         mon.setCursorPos(3,4)
  217.         mon.write(" 1-es reaktor ")
  218.         mon.setCursorPos(3,5)
  219.         mon.write("              ")
  220.         mon.setBackgroundColor(colors.blue)
  221.         mon.setCursorPos(3,7)
  222.         mon.write("              ")
  223.         mon.setCursorPos(3,8)
  224.         mon.write(" 2-es reaktor ")
  225.         mon.setCursorPos(3,9)
  226.         mon.write("              ")
  227.         mon.setBackgroundColor(colors.blue)
  228.         mon.setCursorPos(3,11)
  229.         mon.write("              ")
  230.         mon.setCursorPos(3,12)
  231.         mon.write(" 3-es reaktor ")
  232.         mon.setCursorPos(3,13)
  233.         mon.write("              ")
  234.         mon.setBackgroundColor(colors.black)
  235.         mon.setCursorPos(25,4)
  236.         mon.write("Allapot: ")
  237.         mon.setCursorPos(36,4)
  238.         if r1.getActive() == true then
  239.             mon.setTextColor(colors.green)
  240.             mon.write("Aktiv")
  241.             mon.setTextColor(colors.white)
  242.             mon.setBackgroundColor(colors.green)
  243.             mon.setCursorPos(60,3)
  244.             mon.write("          ")
  245.             mon.setCursorPos(60,4)
  246.             mon.write("    ON    ")
  247.             mon.setCursorPos(60,5)
  248.             mon.write("          ")
  249.             mon.setBackgroundColor(colors.red)
  250.             mon.setCursorPos(72,3)
  251.             mon.write("          ")
  252.             mon.setCursorPos(72,4)
  253.             mon.write("    OFF   ")
  254.             mon.setCursorPos(72,5)
  255.             mon.write("          ")
  256.             mon.setBackgroundColor(colors.black)
  257.         else
  258.             mon.setTextColor(colors.red)
  259.             mon.write("Inaktiv")
  260.             mon.setTextColor(colors.white)
  261.             mon.setBackgroundColor(colors.lime)
  262.             mon.setCursorPos(60,3)
  263.             mon.write("          ")
  264.             mon.setCursorPos(60,4)
  265.             mon.write("    ON    ")
  266.             mon.setCursorPos(60,5)
  267.             mon.write("          ")
  268.             mon.setBackgroundColor(colors.pink)
  269.             mon.setCursorPos(72,3)
  270.             mon.write("          ")
  271.             mon.setCursorPos(72,4)
  272.             mon.write("    OFF   ")
  273.             mon.setCursorPos(72,5)
  274.             mon.write("          ")
  275.             mon.setBackgroundColor(colors.black)
  276.         end
  277.        
  278.         if automata1 == 0 then
  279.             mon.setCursorPos(25,14)
  280.             mon.setBackgroundColor(colors.blue)
  281.             mon.write("        +++        ")
  282.             mon.setCursorPos(25,16)
  283.             mon.write("        ---        ")
  284.             mon.setBackgroundColor(colors.black)
  285.             mon.setCursorPos(25,15)
  286.             mon.write("Energia min: "..math.floor(r1min/1000000).." mRF")
  287.            
  288.             mon.setCursorPos(25,18)
  289.             mon.setBackgroundColor(colors.blue)
  290.             mon.write("        +++        ")
  291.             mon.setCursorPos(25,20)
  292.             mon.write("        ---        ")
  293.             mon.setBackgroundColor(colors.black)
  294.             mon.setCursorPos(25,19)
  295.             mon.write("Rodok szintje: "..r1minarl.."%")
  296.            
  297.             mon.setCursorPos(60,14)
  298.             mon.setBackgroundColor(colors.blue)
  299.             mon.write("        +++        ")
  300.             mon.setCursorPos(60,16)
  301.             mon.write("        ---        ")
  302.             mon.setBackgroundColor(colors.black)
  303.             mon.setCursorPos(60,15)
  304.             mon.write("Energia max: "..math.floor(r1max/1000000).." mRF")
  305.            
  306.             mon.setCursorPos(60,18)
  307.             mon.setBackgroundColor(colors.blue)
  308.             mon.write("        +++        ")
  309.             mon.setCursorPos(60,20)
  310.             mon.write("        ---        ")
  311.             mon.setBackgroundColor(colors.black)
  312.             mon.setCursorPos(60,19)
  313.             mon.write("Rodok szintje: "..r1maxarl.."%")
  314.         else
  315.             mon.setCursorPos(60,7)
  316.             mon.setBackgroundColor(colors.blue)
  317.             mon.write("          ")
  318.             mon.setCursorPos(60,9)
  319.             mon.write("          ")
  320.             mon.setCursorPos(60,8)
  321.             if r1mod == 0 then
  322.                 mon.write("  OSSZES  ")
  323.                 mon.setCursorPos(60,11)
  324.                 mon.write("   ")
  325.                 mon.setCursorPos(60,13)
  326.                 mon.write("   ")
  327.                 mon.setCursorPos(60,12)
  328.                 mon.write(" - ")
  329.                 mon.setCursorPos(67,11)
  330.                 mon.write("   ")
  331.                 mon.setCursorPos(67,13)
  332.                 mon.write("   ")
  333.                 mon.setCursorPos(67,12)
  334.                 mon.write(" + ")
  335.                 mon.setBackgroundColor(colors.black)
  336.                 mon.setCursorPos(64,12)
  337.                 mon.write(r1ossz.."%")
  338.                 r1.setAllControlRodLevels(r1ossz)
  339.             else
  340.                 mon.write("  KULON   ")
  341.             end
  342.         end
  343.        
  344.         mon.setCursorPos(72,7)
  345.         mon.setBackgroundColor(colors.blue)
  346.         mon.write("          ")
  347.         mon.setCursorPos(72,9)
  348.         mon.write("          ")
  349.         mon.setCursorPos(72,8)
  350.         if automata1 == 0 then
  351.             mon.write(" AUTOMATA ")
  352.         elseif automata1 == 1 then
  353.             mon.write("  MANUAL  ")
  354.         end
  355.         mon.setBackgroundColor(colors.black)
  356.         mon.setCursorPos(25,5)
  357.         mon.write("Yellorium:")
  358.         mon.setCursorPos(35,5)
  359.         if r1.getFuelAmount() < 35000 then
  360.             mon.setTextColor(colors.red)
  361.         else
  362.             mon.setTextColor(colors.green)
  363.         end
  364.         mon.write(" "..r1.getFuelAmount().." mB")
  365.         mon.setTextColor(colors.white)
  366.         mon.setCursorPos(25,7)
  367.         mon.write("Energia:")
  368.         mon.setCursorPos(25,9)
  369.         mon.write("Tarolt: "..(math.floor(r1.getEnergyStored()/10000)/100).." mRF")
  370.         mon.setCursorPos(25,10)
  371.         mon.write("Termelt: "..math.floor(r1.getEnergyProducedLastTick()).." RF/t")
  372.        
  373.         mon.setCursorPos(25,23)
  374.         mon.write("0. rod: ")
  375.         drawLine(27,25,10,2,colors.gray)
  376.         drawLine(27,25,math.floor(r1.getControlRodLevel(0)/10),2,colors.yellow)
  377.         mon.setCursorPos(26,37)
  378.         mon.write(r1.getControlRodLevel(0).." %")
  379.        
  380.         mon.setCursorPos(38,23)
  381.         mon.write("1. rod: ")
  382.         drawLine(40,25,10,2,colors.gray)
  383.         drawLine(40,25,math.floor(r1.getControlRodLevel(1)/10),2,colors.yellow)
  384.         mon.setCursorPos(39,37)
  385.         mon.write(r1.getControlRodLevel(1).." %")
  386.        
  387.         mon.setCursorPos(51,23)
  388.         mon.write("2. rod: ")
  389.         drawLine(53,25,10,2,colors.gray)
  390.         drawLine(53,25,math.floor(r1.getControlRodLevel(2)/10),2,colors.yellow)
  391.         mon.setCursorPos(52,37)
  392.         mon.write(r1.getControlRodLevel(2).." %")
  393.        
  394.         mon.setCursorPos(64,23)
  395.         mon.write("3. rod: ")
  396.         drawLine(66,25,10,2,colors.gray)
  397.         drawLine(66,25,math.floor(r1.getControlRodLevel(3)/10),2,colors.yellow)
  398.         mon.setCursorPos(65,37)
  399.         mon.write(r1.getControlRodLevel(3).." %")
  400.        
  401.         mon.setCursorPos(77,23)
  402.         mon.write("4. rod: ")
  403.         drawLine(79,25,10,2,colors.gray)
  404.         drawLine(79,25,math.floor(r1.getControlRodLevel(4)/10),2,colors.yellow)
  405.         mon.setCursorPos(78,37)
  406.         mon.write(r1.getControlRodLevel(4).." %")
  407.  
  408.         mon.setBackgroundColor(colors.black)
  409.        
  410.        
  411.        
  412.     elseif mod == 2 then
  413.         mon.setCursorPos(3,3)
  414.         mon.setBackgroundColor(colors.blue)
  415.         mon.write("              ")
  416.         mon.setCursorPos(3,4)
  417.         mon.write(" 1-es reaktor ")
  418.         mon.setCursorPos(3,5)
  419.         mon.write("              ")
  420.         mon.setBackgroundColor(colors.lightBlue)
  421.         mon.setCursorPos(3,7)
  422.         mon.write("              ")
  423.         mon.setCursorPos(3,8)
  424.         mon.write(" 2-es reaktor ")
  425.         mon.setCursorPos(3,9)
  426.         mon.write("              ")
  427.         mon.setBackgroundColor(colors.blue)
  428.         mon.setCursorPos(3,11)
  429.         mon.write("              ")
  430.         mon.setCursorPos(3,12)
  431.         mon.write(" 3-es reaktor ")
  432.         mon.setCursorPos(3,13)
  433.         mon.write("              ")
  434.         mon.setBackgroundColor(colors.black)
  435.         mon.setCursorPos(25,4)
  436.         mon.write("Allapot: ")
  437.         mon.setCursorPos(36,4)
  438.        
  439.         if r2.getActive() == true then
  440.             mon.setTextColor(colors.green)
  441.             mon.write("Aktiv")
  442.             mon.setTextColor(colors.white)
  443.             mon.setBackgroundColor(colors.green)
  444.             mon.setCursorPos(60,3)
  445.             mon.write("          ")
  446.             mon.setCursorPos(60,4)
  447.             mon.write("    ON    ")
  448.             mon.setCursorPos(60,5)
  449.             mon.write("          ")
  450.             mon.setBackgroundColor(colors.red)
  451.             mon.setCursorPos(72,3)
  452.             mon.write("          ")
  453.             mon.setCursorPos(72,4)
  454.             mon.write("    OFF   ")
  455.             mon.setCursorPos(72,5)
  456.             mon.write("          ")
  457.             mon.setBackgroundColor(colors.black)
  458.         else
  459.             mon.setTextColor(colors.red)
  460.             mon.write("Inaktiv")
  461.             mon.setTextColor(colors.white)
  462.             mon.setBackgroundColor(colors.lime)
  463.             mon.setCursorPos(60,3)
  464.             mon.write("          ")
  465.             mon.setCursorPos(60,4)
  466.             mon.write("    ON    ")
  467.             mon.setCursorPos(60,5)
  468.             mon.write("          ")
  469.             mon.setBackgroundColor(colors.pink)
  470.             mon.setCursorPos(72,3)
  471.             mon.write("          ")
  472.             mon.setCursorPos(72,4)
  473.             mon.write("    OFF   ")
  474.             mon.setCursorPos(72,5)
  475.             mon.write("          ")
  476.             mon.setBackgroundColor(colors.black)
  477.         end
  478.        
  479.         if automata2 == 0 then
  480.             mon.setCursorPos(25,14)
  481.             mon.setBackgroundColor(colors.blue)
  482.             mon.write("        +++        ")
  483.             mon.setCursorPos(25,16)
  484.             mon.write("        ---        ")
  485.             mon.setBackgroundColor(colors.black)
  486.             mon.setCursorPos(25,15)
  487.             mon.write("Energia min: "..math.floor(r2min/1000000).." mRF")
  488.            
  489.             mon.setCursorPos(25,18)
  490.             mon.setBackgroundColor(colors.blue)
  491.             mon.write("        +++        ")
  492.             mon.setCursorPos(25,20)
  493.             mon.write("        ---        ")
  494.             mon.setBackgroundColor(colors.black)
  495.             mon.setCursorPos(25,19)
  496.             mon.write("Rodok szintje: "..r2minarl.."%")
  497.            
  498.             mon.setCursorPos(60,14)
  499.             mon.setBackgroundColor(colors.blue)
  500.             mon.write("        +++        ")
  501.             mon.setCursorPos(60,16)
  502.             mon.write("        ---        ")
  503.             mon.setBackgroundColor(colors.black)
  504.             mon.setCursorPos(60,15)
  505.             mon.write("Energia max: "..math.floor(r2max/1000000).." mRF")
  506.            
  507.             mon.setCursorPos(60,18)
  508.             mon.setBackgroundColor(colors.blue)
  509.             mon.write("        +++        ")
  510.             mon.setCursorPos(60,20)
  511.             mon.write("        ---        ")
  512.             mon.setBackgroundColor(colors.black)
  513.             mon.setCursorPos(60,19)
  514.             mon.write("Rodok szintje: "..r2maxarl.."%")
  515.         else
  516.             mon.setCursorPos(60,7)
  517.             mon.setBackgroundColor(colors.blue)
  518.             mon.write("          ")
  519.             mon.setCursorPos(60,9)
  520.             mon.write("          ")
  521.             mon.setCursorPos(60,8)
  522.             if r2mod == 0 then
  523.                 mon.write("  OSSZES  ")
  524.                 mon.setCursorPos(60,11)
  525.                 mon.write("   ")
  526.                 mon.setCursorPos(60,13)
  527.                 mon.write("   ")
  528.                 mon.setCursorPos(60,12)
  529.                 mon.write(" - ")
  530.                 mon.setCursorPos(67,11)
  531.                 mon.write("   ")
  532.                 mon.setCursorPos(67,13)
  533.                 mon.write("   ")
  534.                 mon.setCursorPos(67,12)
  535.                 mon.write(" + ")
  536.                 mon.setBackgroundColor(colors.black)
  537.                 mon.setCursorPos(64,12)
  538.                 mon.write(r2ossz.."%")
  539.                 r2.setAllControlRodLevels(r2ossz)
  540.             else
  541.                 mon.write("  KULON   ")
  542.             end
  543.         end
  544.        
  545.         mon.setCursorPos(72,7)
  546.         mon.setBackgroundColor(colors.blue)
  547.         mon.write("          ")
  548.         mon.setCursorPos(72,9)
  549.         mon.write("          ")
  550.         mon.setCursorPos(72,8)
  551.         if automata2 == 0 then
  552.             mon.write(" AUTOMATA ")
  553.         elseif automata2 == 1 then
  554.             mon.write("  MANUAL  ")
  555.         end
  556.         mon.setBackgroundColor(colors.black)
  557.         mon.setCursorPos(25,5)
  558.         mon.write("Blutonium:")
  559.         mon.setCursorPos(35,5)
  560.         if r2.getFuelAmount() < 35000 then
  561.             mon.setTextColor(colors.red)
  562.         else
  563.             mon.setTextColor(colors.green)
  564.         end
  565.         mon.write(" "..r2.getFuelAmount().." mB")
  566.         mon.setTextColor(colors.white)
  567.         mon.setCursorPos(25,7)
  568.         mon.write("Energia:")
  569.         mon.setCursorPos(25,9)
  570.         mon.write("Tarolt: "..(math.floor(r2.getEnergyStored()/10000)/100).." mRF")
  571.         mon.setCursorPos(25,10)
  572.         mon.write("Termelt: "..math.floor(r2.getEnergyProducedLastTick()).." RF/t")
  573.        
  574.         mon.setCursorPos(25,23)
  575.         mon.write("0. rod: ")
  576.         drawLine(27,25,10,2,colors.gray)
  577.         drawLine(27,25,math.floor(r2.getControlRodLevel(0)/10),2,colors.yellow)
  578.         mon.setCursorPos(26,37)
  579.         mon.write(r2.getControlRodLevel(0).." %")
  580.        
  581.         mon.setCursorPos(38,23)
  582.         mon.write("1. rod: ")
  583.         drawLine(40,25,10,2,colors.gray)
  584.         drawLine(40,25,math.floor(r2.getControlRodLevel(1)/10),2,colors.yellow)
  585.         mon.setCursorPos(39,37)
  586.         mon.write(r2.getControlRodLevel(1).." %")
  587.        
  588.         mon.setCursorPos(51,23)
  589.         mon.write("2. rod: ")
  590.         drawLine(53,25,10,2,colors.gray)
  591.         drawLine(53,25,math.floor(r2.getControlRodLevel(2)/10),2,colors.yellow)
  592.         mon.setCursorPos(52,37)
  593.         mon.write(r2.getControlRodLevel(2).." %")
  594.        
  595.         mon.setCursorPos(64,23)
  596.         mon.write("3. rod: ")
  597.         drawLine(66,25,10,2,colors.gray)
  598.         drawLine(66,25,math.floor(r2.getControlRodLevel(3)/10),2,colors.yellow)
  599.         mon.setCursorPos(65,37)
  600.         mon.write(r2.getControlRodLevel(3).." %")
  601.        
  602.         mon.setCursorPos(77,23)
  603.         mon.write("4. rod: ")
  604.         drawLine(79,25,10,2,colors.gray)
  605.         drawLine(79,25,math.floor(r2.getControlRodLevel(4)/10),2,colors.yellow)
  606.         mon.setCursorPos(78,37)
  607.         mon.write(r2.getControlRodLevel(4).." %")
  608.  
  609.         mon.setBackgroundColor(colors.black)
  610.        
  611.     elseif mod == 3 then
  612.         mon.setCursorPos(3,3)
  613.         mon.setBackgroundColor(colors.blue)
  614.         mon.write("              ")
  615.         mon.setCursorPos(3,4)
  616.         mon.write(" 1-es reaktor ")
  617.         mon.setCursorPos(3,5)
  618.         mon.write("              ")
  619.         mon.setBackgroundColor(colors.blue)
  620.         mon.setCursorPos(3,7)
  621.         mon.write("              ")
  622.         mon.setCursorPos(3,8)
  623.         mon.write(" 2-es reaktor ")
  624.         mon.setCursorPos(3,9)
  625.         mon.write("              ")
  626.         mon.setBackgroundColor(colors.lightBlue)
  627.         mon.setCursorPos(3,11)
  628.         mon.write("              ")
  629.         mon.setCursorPos(3,12)
  630.         mon.write(" 3-es reaktor ")
  631.         mon.setCursorPos(3,13)
  632.         mon.write("              ")
  633.         mon.setBackgroundColor(colors.black)
  634.         mon.setCursorPos(25,4)
  635.         mon.write("Allapot: ")
  636.         mon.setCursorPos(36,4)
  637.         if r3.getActive() == true then
  638.             mon.setTextColor(colors.green)
  639.             mon.write("Aktiv")
  640.             mon.setTextColor(colors.white)
  641.         else
  642.             mon.setTextColor(colors.red)
  643.             mon.write("Inaktiv")
  644.             mon.setTextColor(colors.white)
  645.         end
  646.         mon.setCursorPos(25,5)
  647.         mon.write("Yellorium:")
  648.         mon.setCursorPos(35,5)
  649.         if r3.getFuelAmount() < 35000 then
  650.             mon.setTextColor(colors.red)
  651.         else
  652.             mon.setTextColor(colors.green)
  653.         end
  654.         mon.write(" "..r3.getFuelAmount().." mB")
  655.         mon.setTextColor(colors.white)
  656.         mon.setCursorPos(25,7)
  657.         mon.write("Energia:")
  658.         mon.setCursorPos(25,9)
  659.         mon.write("Tarolt: "..(math.floor(r3.getEnergyStored()/10000)/100).." mRF")
  660.         mon.setCursorPos(25,10)
  661.         mon.write("Termelt: "..math.floor(r3.getEnergyProducedLastTick()).." RF/t")
  662.         mon.setCursorPos(25,12)
  663.         mon.write("Control rodok: "..r3.getControlRodLevel(0).." %")
  664.     end
  665.    
  666.     if automata1 == 0 then
  667.         if r1.getEnergyStored() >= r1max then
  668.             r1.setAllControlRodLevels(r1maxarl)
  669.         elseif r1.getEnergyStored() <= r1min then
  670.             r1.setAllControlRodLevels(r1minarl)
  671.         end
  672.     end
  673.     if automata2 == 0 then
  674.         if r2.getEnergyStored() >= r2max then
  675.             r2.setAllControlRodLevels(r2maxarl)
  676.         elseif r2.getEnergyStored() <= r2min then
  677.             r2.setAllControlRodLevels(r2minarl)
  678.         end
  679.     end
  680.     term.clear()
  681.     term.setCursorPos(1,1)
  682.     print(mod)
  683.     sleep(1)
  684. end
  685.  
  686. while true do
  687.     parallel.waitForAny(click,futas)
  688. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement