supreamcallum45

turbine.lua

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