Morphik08

BigReactor control Edit

May 5th, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 17.86 KB | None | 0 0
  1. -----BigReactor Control
  2. -----by jaranvil aka jared314
  3.  
  4. -----feel free to use and/or mondify this code
  5. -----------------------------------------------
  6.  
  7. version = 1
  8. term.clear()
  9. -------------------FORMATTING-------------------------------
  10. function clear()
  11.     mon.setBackgroundColor(colors.black)
  12.     mon.clear()
  13.     mon.setCursorPos(1,1)
  14. end
  15.  
  16. function draw_text_term(x, y, text, text_color, bg_color)
  17.     term.setTextColor(text_color)
  18.     term.setBackgroundColor(bg_color)
  19.     term.setCursorPos(x,y)
  20.     write(text)
  21. end
  22.  
  23. function draw_text(x, y, text, text_color, bg_color)
  24.     mon.setBackgroundColor(bg_color)
  25.     mon.setTextColor(text_color)
  26.     mon.setCursorPos(x,y)
  27.     mon.write(text)
  28. end
  29.  
  30. function draw_line(x, y, length, color)
  31.         mon.setBackgroundColor(color)
  32.         mon.setCursorPos(x,y)
  33.         mon.write(string.rep(" ", length))
  34. end
  35.  
  36. function draw_line_term(x, y, length, color)
  37.         term.setBackgroundColor(color)
  38.         term.setCursorPos(x,y)
  39.         term.write(string.rep(" ", length))
  40. end
  41.  
  42. function progress_bar(x, y, length, minVal, maxVal, bar_color, bg_color)
  43.     draw_line(x, y, length, bg_color) --backgoround bar
  44.     local barSize = math.floor((minVal/maxVal) * length)
  45.     draw_line(x, y, barSize, bar_color) --progress so far
  46. end
  47.  
  48. function progress_bar_term(x, y, length, minVal, maxVal, bar_color, bg_color)
  49.     draw_line_term(x, y, length, bg_color) --backgoround bar
  50.     local barSize = math.floor((minVal/maxVal) * length)
  51.     draw_line_term(x, y, barSize, bar_color)    --progress so far
  52. end
  53.  
  54. function button(x, y, length, text, txt_color, bg_color)
  55.     draw_line(x, y, length, bg_color)
  56.     draw_text((x+2), y, text, txt_color, bg_color)
  57. end
  58.  
  59. function menu_bar()
  60.     draw_line(1, 1, monX, colors.blue)
  61.     draw_text(2, 1, "Power    Tools    Settings", colors.white, colors.blue)
  62.     draw_line(1, 19, monX, colors.blue)
  63.     draw_text(2, 19, "     Turbine Control", colors.white, colors.blue)
  64. end
  65.  
  66. function power_menu()
  67.     draw_line(1, 2, 9, colors.gray)
  68.     draw_line(1, 3, 9, colors.gray)
  69.     if active then
  70.         draw_text(2, 2, "ON", colors.lightGray, colors.gray)
  71.         draw_text(2, 3, "OFF", colors.white, colors.gray)
  72.     else
  73.         draw_text(2, 2, "ON", colors.white, colors.gray)
  74.         draw_text(2, 3, "OFF", colors.lightGray, colors.gray)
  75.     end
  76. end
  77.  
  78. function tools_menu()
  79.     draw_line(10, 2, 14, colors.gray)
  80.     draw_line(10, 3, 14, colors.gray)
  81.     draw_text(11, 2, "Flow Rate", colors.white, colors.gray)
  82.     draw_text(11, 3, "Coils", colors.white, colors.gray)
  83.    
  84.    
  85. end
  86.  
  87. function settings_menu()
  88.     draw_line(12, 2, 18, colors.gray)
  89.     draw_line(12, 3, 18, colors.gray)
  90.     draw_text(13, 2, "Check for Updates", colors.white, colors.gray)
  91.     draw_text(13, 3, "Reset peripherals", colors.white, colors.gray)
  92. end
  93.  
  94. function popup_screen(y, title, height)
  95.     clear()
  96.     menu_bar()
  97.  
  98.     draw_line(4, y, 22, colors.blue)
  99.     draw_line(25, y, 1, colors.red)
  100.  
  101.     for counter = y+1, height+y do
  102.         draw_line(4, counter, 22, colors.white)
  103.     end
  104.  
  105.     draw_text(25, y, "X", colors.white, colors.red)
  106.     draw_text(5, y, title, colors.white, colors.blue)
  107. end
  108.  
  109. function save_config()
  110.     sw = fs.open("turbine_config.txt", "w")    
  111.         sw.writeLine(version)
  112.         sw.writeLine(side)
  113.         sw.writeLine(name)
  114.         sw.writeLine(auto_string)
  115.         sw.writeLine(on)
  116.         sw.writeLine(off)
  117.     sw.close()
  118. end
  119.  
  120. function load_config()
  121.     sr = fs.open("turbine_config.txt", "r")
  122.         version = tonumber(sr.readLine())
  123.         side = sr.readLine()
  124.         name = sr.readLine()
  125.         auto_string = sr.readLine()
  126.         on = tonumber(sr.readLine())
  127.         off = tonumber(sr.readLine())
  128.     sr.close()
  129. end
  130.  
  131. --------------------------------------------------
  132.  
  133.  
  134.  
  135. function homepage()
  136.     while true do
  137.         clear()
  138.         menu_bar()
  139.         terminal_screen()
  140.  
  141.         active = turbine.getActive()
  142.         energy_stored = turbine.getEnergyStored()
  143.        
  144.  
  145.         --------POWER STAT--------------
  146.         draw_text(2, 3, "Power: ", colors.yellow, colors.black)
  147.        
  148.         if active then
  149.             draw_text(10, 3, "ONLINE", colors.lime, colors.black)
  150.         else
  151.             draw_text(10, 3, "OFFLINE", colors.red, colors.black)
  152.         end
  153.  
  154.  
  155.         -----------Router speed---------------------
  156.         draw_text(2, 5, "Router Speed: ", colors.yellow, colors.black)
  157.         local maxVal = 2000
  158.         local minVal = math.floor(turbine.getRotorSpeed())
  159.         draw_text(19, 5, minVal.." rpm", colors.white, colors.black)
  160.  
  161.         if minVal < 700 then
  162.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.lightBlue, colors.gray)
  163.         else if minVal < 900 then  
  164.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.lime, colors.gray)
  165.         else if minVal < 1700 then
  166.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.lightBlue, colors.gray)
  167.         else if minVal < 1900 then
  168.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.lime, colors.gray)
  169.         else if minVal < 2000 then
  170.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.yellow, colors.gray)
  171.         else if minVal >= 2000 then
  172.         progress_bar(2, 6, monX-2, minVal, maxVal, colors.red, colors.gray)
  173.         end
  174.         end
  175.         end
  176.         end
  177.         end
  178.         end
  179.  
  180.         -----------Steam Level---------------------
  181.         draw_text(2, 8, "Steam Amount: ", colors.yellow, colors.black)
  182.         local maxVal = 4000
  183.         local minVal = math.floor(turbine.getInputAmount())
  184.         draw_text(19, 8, minVal.." mB", colors.white, colors.black)
  185.         progress_bar(2, 9, monX-2, minVal, maxVal, colors.lightGray, colors.gray)
  186.        
  187.  
  188.         -----------Water Level---------------------
  189.         draw_text(2, 11, "Water Amount: ", colors.yellow, colors.black)
  190.         local maxVal = 4000
  191.         local minVal = math.floor(turbine.getOutputAmount())
  192.         draw_text(19, 11, minVal.." mB", colors.white, colors.black)
  193.         progress_bar(2, 12, monX-2, minVal, maxVal, colors.blue, colors.gray)
  194.    
  195.  
  196.         -------------OUTPUT-------------------
  197.         draw_text(2, 14, "RF/tick: ", colors.yellow, colors.black)
  198.         rft = math.floor(turbine.getEnergyProducedLastTick())
  199.         draw_text(19, 14, rft.." RF/T", colors.white, colors.black)
  200.  
  201.         -----------RF STORAGE---------------
  202.         draw_text(2, 15, "RF Stored:", colors.yellow, colors.black)
  203.         local maxVal = 1000000
  204.         local minVal = energy_stored
  205.         local percent = math.floor((energy_stored/maxVal)*100)
  206.         draw_text(19, 15, percent.."%", colors.white, colors.black)
  207.  
  208.         ------------FLOW RATE----------------
  209.         draw_text(2, 16, "Flow Rate: ", colors.yellow, colors.black)
  210.         flow_rate = turbine.getFluidFlowRateMax()
  211.         draw_text(19, 16, flow_rate.." mB/t", colors.white, colors.black)
  212.  
  213.         ------------COILS---------------------------
  214.         engaged = turbine.getInductorEngaged()
  215.         draw_text(2, 17, "Coils: ", colors.yellow, colors.black)
  216.  
  217.         if engaged then
  218.             draw_text(19, 17, "Engaged", colors.white, colors.black)
  219.         else
  220.             draw_text(19, 17, "Disengaged", colors.white, colors.black)
  221.         end
  222.        
  223.         if energy_stored > 1000000 then
  224.         turbine.setInductorEngaged(false)
  225.         end
  226.        
  227.         if energy_stored < 50000 then
  228.         turbine.setInductorEngaged(true)
  229.         end
  230.  
  231.  
  232.        
  233.         sleep(0.5)
  234.     end
  235. end
  236.  
  237. --------------MENU SCREENS--------------
  238.  
  239.  
  240.  
  241. -------------------Tools----------------------
  242.  
  243. function flow_rate_menu()
  244.     popup_screen(3, "Flow Rate", 12)
  245.     flow_rate = turbine.getFluidFlowRateMax()
  246.     current_flow = turbine.getFluidFlowRate()
  247.  
  248.     draw_text(5, 5, "Steam consumption", colors.lime, colors.white)
  249.     draw_text(5, 6, "last tick:", colors.lime, colors.white)
  250.     draw_text(13, 8, current_flow.." mB", colors.black, colors.white)
  251.  
  252.     draw_text(5, 10, "Flow Rate Setting:", colors.lime, colors.white)
  253.     draw_text(8, 12, " < ", colors.white, colors.black)
  254.     draw_text(13, 12, flow_rate.." mB", colors.black, colors.white)
  255.     draw_text(21, 12, " > ", colors.white, colors.black)
  256.  
  257.     draw_text(13, 14, " Okay ", colors.white, colors.black)
  258.  
  259.     local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  260.  
  261.     --decrease
  262.     if yPos == 12 and xPos >= 8 and xPos <= 11 then
  263.         turbine.setFluidFlowRateMax(flow_rate-10)
  264.         flow_rate_menu()
  265.     --increase
  266.     else if yPos == 12 and xPos >= 21 and xPos <= 24 then
  267.         turbine.setFluidFlowRateMax(flow_rate+10)
  268.         flow_rate_menu()
  269.     end
  270.     end
  271.  
  272.     --Okay button
  273.     if yPos == 14 and xPos >= 13 and xPos <= 19 then
  274.         call_homepage()
  275.     end
  276.  
  277.     --Exit button
  278.     if yPos == 3 and xPos == 25 then
  279.         call_homepage()
  280.     end
  281.     flow_rate_menu()
  282. end
  283.  
  284.  
  285. function coil_menu()
  286.     engaged = turbine.getInductorEngaged()
  287.  
  288.     popup_screen(3, "Induction Coils", 8)
  289.     draw_text(5, 5, "Coil Status:", colors.black, colors.white)
  290.  
  291.     if engaged then
  292.         draw_text(5, 6, "Engaged", colors.lime, colors.white)
  293.         draw_text(10, 8, " Disengage ", colors.white, colors.black)
  294.     else
  295.         draw_text(5, 6, "Disengaged", colors.red, colors.white)
  296.         draw_text(10, 8, " Engage ", colors.white, colors.black)
  297.     end
  298.  
  299.     draw_text(12, 10, " Okay ", colors.white, colors.black)
  300.  
  301.  
  302.     local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  303.  
  304.     if yPos == 8 and xPos >= 10 and xPos <= 21 then
  305.         if engaged then
  306.             turbine.setInductorEngaged(false)
  307.             coil_menu()
  308.         else
  309.             turbine.setInductorEngaged(true)
  310.             coil_menu()
  311.         end
  312.     end
  313.  
  314.     --okay button
  315.     if yPos == 10 and xPos >= 12 and xPos <= 18 then
  316.         call_homepage()
  317.     end
  318.  
  319.  
  320.     coil_menu()
  321. end
  322.  
  323. -----------------------Settings--------------------------------
  324.  
  325.  
  326.  
  327. function install_update(program, pastebin)
  328.         clear()
  329.         draw_line(4, 5, 22, colors.blue)
  330.  
  331.         for counter = 6, 10 do
  332.             draw_line(4, counter, 22, colors.white)
  333.         end
  334.  
  335.         draw_text(5, 5, "Updating...", colors.white, colors.blue)
  336.         draw_text(5, 7, "Open computer", colors.black, colors.white)
  337.         draw_text(5, 8, "terminal.", colors.black, colors.white)
  338.  
  339.         if fs.exists("install") then fs.delete("install") end
  340.         shell.run("pastebin get p4zeq7Ma install")
  341.         shell.run("install")
  342.  
  343. end
  344.  
  345. function update()
  346.     popup_screen(5, "Updates", 4)
  347.     draw_text(5, 7, "Connecting to", colors.black, colors.white)
  348.     draw_text(5, 8, "pastebin...", colors.black, colors.white)
  349.  
  350.     sleep(0.5)
  351.    
  352.     shell.run("pastebin get QP3qrzNu current_version.txt")
  353.     sr = fs.open("current_version.txt", "r")
  354.     current_version = tonumber(sr.readLine())
  355.     sr.close()
  356.     fs.delete("current_version.txt")
  357.     terminal_screen()
  358.  
  359.     if current_version > version then
  360.  
  361.         popup_screen(5, "Updates", 7)
  362.         draw_text(5, 7, "Update Available!", colors.black, colors.white)
  363.         draw_text(11, 9, " Intall ", colors.white, colors.black)
  364.         draw_text(11, 11, " Ignore ", colors.white, colors.black)
  365.  
  366.         local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  367.  
  368.         --Instatll button
  369.         if yPos == 9 and xPos >= 11 and xPos <= 17 then
  370.             install_update()
  371.         end
  372.  
  373.         --Exit button
  374.         if yPos == 5 and xPos == 25 then
  375.             call_homepage()
  376.         end
  377.         call_homepage()
  378.  
  379.     else
  380.         popup_screen(5, "Updates", 5)
  381.         draw_text(5, 7, "You are up to date!", colors.black, colors.white)
  382.         draw_text(11, 9, " Okay ", colors.white, colors.black)
  383.  
  384.         local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  385.  
  386.         --Okay button
  387.         if yPos == 9 and xPos >= 11 and xPos <= 17 then
  388.             call_homepage()
  389.         end
  390.  
  391.         --Exit button
  392.         if yPos == 5 and xPos == 25 then
  393.             call_homepage()
  394.         end
  395.         call_homepage()
  396.     end
  397.  
  398.    
  399.  
  400. end
  401.  
  402. function reset_peripherals()
  403.     clear()
  404.     draw_line(4, 5, 22, colors.blue)
  405.  
  406.     for counter = 6, 10 do
  407.         draw_line(4, counter, 22, colors.white)
  408.     end
  409.  
  410.     draw_text(5, 5, "Reset Peripherals", colors.white, colors.blue)
  411.     draw_text(5, 7, "Open computer", colors.black, colors.white)
  412.     draw_text(5, 8, "terminal.", colors.black, colors.white)
  413.     setup_wizard()
  414.  
  415. end
  416.  
  417. --stop running status screen if monitors was touched
  418. function stop()
  419.     while true do
  420.         local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  421.             x = xPos
  422.             y = yPos
  423.             stop_function = "monitor_touch"
  424.         return
  425.     end
  426. end
  427.  
  428. function mon_touch()
  429.     --when the monitor is touch on the homepage
  430.     if y == 1 then
  431.             if x < monX/3 then
  432.                 power_menu()
  433.                 local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  434.                 if xPos < 9 then
  435.                     if yPos == 2 then
  436.                         turbine.setActive(true)
  437.                         call_homepage()
  438.                     else if yPos == 3 then
  439.                         turbine.setActive(false)
  440.                         call_homepage()
  441.                     else
  442.                         call_homepage()
  443.                     end
  444.                     end
  445.                 else
  446.                     call_homepage()
  447.                 end
  448.                
  449.             else if x < 20 then
  450.                 tools_menu()
  451.                 local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  452.                 if xPos < 25 and xPos > 10 then
  453.                     if yPos == 2 then
  454.                         flow_rate_menu()
  455.                     else if yPos == 3 then
  456.                         coil_menu()
  457.                     else if yPos == 4 then
  458.                        
  459.                     else if yPos == 5 then
  460.                    
  461.                     else
  462.                         call_homepage()
  463.                     end
  464.                     end
  465.                     end
  466.                     end
  467.                 else
  468.                     call_homepage()
  469.                 end
  470.             else if x < monX then
  471.                 settings_menu()
  472.                 local event, side, xPos, yPos = os.pullEvent("monitor_touch")
  473.                 if xPos > 13 then
  474.                     if yPos == 2 then
  475.                         update()
  476.                     else if yPos == 3 then
  477.                         reset_peripherals()
  478.                     else
  479.                         call_homepage()
  480.                     end
  481.                     end
  482.                 else
  483.                     call_homepage()
  484.                 end
  485.             end
  486.             end
  487.             end
  488.         else
  489.             call_homepage()
  490.         end
  491. end
  492.  
  493. function terminal_screen()
  494.     term.clear()
  495.     draw_line_term(1, 1, 55, colors.blue)
  496.     draw_text_term(13, 1, "BigReactor Controls", colors.white, colors.blue)
  497.     draw_line_term(1, 19, 55, colors.blue)
  498.     draw_text_term(13, 19, "by jaranvil aka jared314", colors.white, colors.blue)
  499.  
  500.     draw_text_term(1, 3, "Current program:", colors.white, colors.black)
  501.     draw_text_term(1, 4, "Turbine Control v"..version, colors.blue, colors.black)
  502.    
  503.     draw_text_term(1, 6, "Installer:", colors.white, colors.black)
  504.     draw_text_term(1, 7, "pastebin.com/p4zeq7Ma", colors.blue, colors.black)
  505.  
  506.     draw_text_term(1, 9, "Please give me your feedback, suggestions,", colors.white, colors.black)
  507.     draw_text_term(1, 10, "and errors!", colors.white, colors.black)
  508.  
  509.     draw_text_term(1, 11, "reddit.com/r/br_controls", colors.blue, colors.black)
  510. end
  511.  
  512. --run both homepage() and stop() until one returns
  513. function call_homepage()
  514.     clear()
  515.     parallel.waitForAny(homepage, stop)
  516.  
  517.     if stop_function == "terminal_screen" then
  518.         stop_function = "nothing"
  519.         setup_wizard()
  520.     else if stop_function == "monitor_touch" then
  521.         stop_function = "nothing"
  522.         mon_touch()
  523.     end
  524.     end
  525. end
  526.  
  527. --try to wrap peripherals
  528. --catch any errors
  529.     function test_turbine_connection()
  530.         turbine = peripheral.wrap(name)  --wrap reactor
  531.         c = turbine.getConnected()
  532.         if unexpected_condition then error() end  
  533.     end
  534.  
  535.     function test_monitor_connection()
  536.         mon = peripheral.wrap(side) --wrap mon
  537.         monX, monY = mon.getSize() --get mon size ()
  538.         if unexpected_condition then error() end  
  539.     end
  540.  
  541. --test if the entered monitor and reactor can be wrapped
  542.     function test_configs()
  543.  
  544.         term.clear()
  545.         draw_line_term(1, 1, 55, colors.blue)
  546.         draw_text_term(10, 1, "BigReactor Controls v"..version, colors.white, colors.blue)
  547.         draw_line_term(1, 19, 55, colors.blue)
  548.         draw_text_term(10, 19, "by jaranvil aka jared314", colors.white, colors.blue)
  549.  
  550.         draw_text_term(1, 3, "Wrapping peripherals...", colors.blue, colors.black)
  551.         draw_text_term(2, 5, "wrap montior...", colors.white, colors.black)
  552.         sleep(0.1)
  553.         if pcall(test_monitor_connection) then
  554.             draw_text_term(18, 5, "success", colors.lime, colors.black)
  555.         else
  556.             draw_text_term(1, 4, "Error:", colors.red, colors.black)
  557.             draw_text_term(1, 8, "Could not connect to monitor on "..side.." side", colors.red, colors.black)
  558.             draw_text_term(1, 9, "Valid sides are 'left', 'right', 'top', 'bottom' and 'back'", colors.white, colors.black)
  559.             draw_text_term(1, 11, "Press Enter to continue...", colors.gray, colors.black)
  560.             wait = read()
  561.             setup_wizard()
  562.         end
  563.         sleep(0.1)
  564.         draw_text_term(2, 6, "wrap turbine...", colors.white, colors.black)
  565.         sleep(0.1)
  566.         if pcall(test_turbine_connection) then
  567.             draw_text_term(18, 6, "success", colors.lime, colors.black)
  568.         else
  569.             draw_text_term(1, 8, "Error:", colors.red, colors.black)
  570.             draw_text_term(1, 9, "Could not connect to "..name, colors.red, colors.black)
  571.             draw_text_term(1, 10, "Turbine must be connected with networking cable and wired modem", colors.white, colors.black)
  572.             draw_text_term(1, 12, "Press Enter to continue...", colors.gray, colors.black)
  573.             wait = read()
  574.             setup_wizard()
  575.         end
  576.         sleep(0.1)
  577.         draw_text_term(2, 8, "saving settings to file...", colors.white, colors.black) 
  578.  
  579.         save_config()
  580.  
  581.         sleep(0.1)
  582.         draw_text_term(1, 10, "Setup Complete!", colors.lime, colors.black)
  583.         sleep(3)
  584.  
  585.         auto = auto_string == "true"
  586.         call_homepage()
  587.  
  588. end
  589. ----------------SETUP-------------------------------
  590.  
  591. function setup_wizard()
  592.     term.clear()
  593.     draw_text_term(1, 1, "BigReactor Controls v"..version, colors.lime, colors.black)
  594.     draw_text_term(1, 2, "Peripheral setup wizard", colors.white, colors.black)
  595.     draw_text_term(1, 4, "Step 1:", colors.lime, colors.black)
  596.     draw_text_term(1, 5, "-Place 3x3 advanced monitors next to computer.", colors.white, colors.black)
  597.     draw_text_term(1, 7, "Step 2:", colors.lime, colors.black)
  598.     draw_text_term(1, 8, "-Place a wired modem on this computer and on the ", colors.white, colors.black)
  599.     draw_text_term(1, 9, " computer port of the turbine.", colors.white, colors.black)
  600.     draw_text_term(1, 10, "-connect modems with network cable.", colors.white, colors.black)
  601.     draw_text_term(1, 11, "-right click modems to activate.", colors.white, colors.black)
  602.     draw_text_term(1, 13, "Press Enter when ready...", colors.gray, colors.black)
  603.    
  604.     wait = read()
  605.    
  606.     term.clear()
  607.     draw_text_term(1, 1, "Peripheral Setup", colors.lime, colors.black)
  608.     draw_text_term(1, 3, "What side is your monitor on?", colors.yellow, colors.black)
  609.  
  610.     term.setTextColor(colors.white)
  611.     term.setCursorPos(1,4)
  612.     side = read()
  613.  
  614.     term.clear()
  615.     draw_text_term(1, 1, "Peripheral Setup", colors.lime, colors.black)
  616.     draw_text_term(1, 3, "What is the turbine's name?", colors.yellow, colors.black)
  617.     draw_text_term(1, 4, "type 'default' for  'BigReactors-Turbine_0'", colors.gray, colors.black)
  618.  
  619.     term.setTextColor(colors.white)
  620.     term.setCursorPos(1,5)
  621.     name = read()
  622.  
  623.     if name == "default" then name = "BigReactors-Turbine_0" end
  624.     auto_string = false
  625.     on = 0
  626.     off = 99
  627.  
  628.     test_configs()
  629. end
  630.  
  631. function start()
  632.     --if configs exists, load values and test
  633.     if fs.exists("turbine_config.txt") then
  634.             load_config()
  635.  
  636.             test_configs()
  637.     else
  638.         setup_wizard()
  639.     end
  640. end
  641.  
  642. start()
Add Comment
Please, Sign In to add comment