SHOW:
|
|
- or go back to the newest paste.
| 1 | - | -- Reactor- und Turbine control by Thor_s_Crafter -- |
| 1 | + | -- Installationsprogramm des Reaktor- und Turbinenprogramms von Thor_s_Crafter -- |
| 2 | - | -- Version 2.3 -- |
| 2 | + | -- Hinweis: Das Benutzung des Programms geschieht auf eigene Gefahr des Nutzers. -- |
| 3 | - | -- Installer (Deutsch) -- |
| 3 | + | |
| 4 | -- Version 1.0 (beta) | |
| 5 | - | --Loads the option file if not present yet |
| 5 | + | |
| 6 | - | if not fs.exists("/reactor-turbine-program/config/options.txt") then
|
| 6 | + | |
| 7 | - | shell.run("pastebin get KFcHD2Bj /reactor-turbine-program/config/options.txt")
|
| 7 | + | |
| 8 | ||
| 9 | print("-- Installationsprogramm des Reaktor- und Turbinenprogramms von Thor_s_Crafter --")
| |
| 10 | - | --Reads the version --Currently deprecated |
| 10 | + | print("-- Version 1.0 (beta) --")
|
| 11 | - | local optionList = {}
|
| 11 | + | print() |
| 12 | - | file = fs.open("/reactor-turbine-program/config/options.txt","r")
|
| 12 | + | print("HINWEIS: Das Benutzung des Programms geschieht auf eigene Gefahr.")
|
| 13 | - | listElement = file.readLine() |
| 13 | + | print() |
| 14 | - | while listElement do |
| 14 | + | print("Es wird empfohlen den Computer zu labeln.")
|
| 15 | - | table.insert(optionList,listElement) |
| 15 | + | |
| 16 | - | listElement = file.readLine() |
| 16 | + | if not fs.exists("turbineControl") then
|
| 17 | out = true | |
| 18 | - | file.close() |
| 18 | + | while out do |
| 19 | write("Computer labeln? (j/n): ")
| |
| 20 | - | local version = optionList[3] |
| 20 | + | input = read() |
| 21 | - | local nVersion = 2.3 |
| 21 | + | if input == "j" then |
| 22 | shell.run("label set \"TurbineComputer\"")
| |
| 23 | - | --Update? |
| 23 | + | print("ComputerLabel auf \"TurbineComputer\" gesetzt.")
|
| 24 | - | if fs.exists("/reactor-turbine-program/program/turbineControl.lua") then
|
| 24 | + | out = false |
| 25 | - | update = true |
| 25 | + | end |
| 26 | - | else update = false |
| 26 | + | if input == "n" then |
| 27 | print("ComputerLabel wurde nicht gesetzt.")
| |
| 28 | out = false | |
| 29 | - | --First time installation |
| 29 | + | else |
| 30 | - | if not update then |
| 30 | + | print("Ungueltige Eingabe.")
|
| 31 | - | --Description |
| 31 | + | end |
| 32 | - | term.clear() |
| 32 | + | end |
| 33 | - | term.setCursorPos(1,1) |
| 33 | + | else |
| 34 | - | print("Reaktor- und Turbinenprogramm von Thor_s_Crafter")
|
| 34 | + | print("Update Programm...")
|
| 35 | - | print("Version 2.3")
|
| 35 | + | |
| 36 | - | print() |
| 36 | + | |
| 37 | - | print("Ueber das Programm:")
|
| 37 | + | sleep(1) |
| 38 | - | print("Das Programm kontrolliert einen BigReactors-Reaktor.")
|
| 38 | + | |
| 39 | - | print("Es koennen auch bis zu 32 Turbinen angeschlossen werden.")
|
| 39 | + | |
| 40 | - | print("Der Computer muss mit Wired Modems am Reaktor (und ggf. Turbinen) verbunden werden.")
|
| 40 | + | |
| 41 | - | print("Ausserdem muss ein Energiespeicher und ein Monitor angeschlossen werden.")
|
| 41 | + | |
| 42 | - | print("Der Monitor muss min. 7 Bloecke breit und 4 Bloecke hoch sein.")
|
| 42 | + | print("Checke auf vorhandene Programme...")
|
| 43 | - | print("Wird das Programm mit Turbinen betrieben, sollte der Reaktor pro Turbine mindestens 2000mb/t Steam produzieren koennen.")
|
| 43 | + | if fs.exists("button") then
|
| 44 | - | print() |
| 44 | + | shell.run("delete button")
|
| 45 | - | write("Bitte Enter druecken...")
|
| 45 | + | print("Button geloescht.")
|
| 46 | - | leer = read() |
| 46 | + | |
| 47 | if fs.exists("turbineControl") then
| |
| 48 | - | --Computer label |
| 48 | + | shell.run("delete turbineControl")
|
| 49 | - | local out = true |
| 49 | + | print("turbineControl geloescht.")
|
| 50 | - | while out do |
| 50 | + | |
| 51 | - | term.clear() |
| 51 | + | |
| 52 | - | term.setCursorPos(1,1) |
| 52 | + | print("Lade Button-Programm...")
|
| 53 | - | print("Es wird empfohlen den Computer zu labeln.")
|
| 53 | + | shell.run("pastebin get pDtimDT2 button")
|
| 54 | - | term.write("Computer labeln? (j/n): ")
|
| 54 | + | print("Lade Reaktor-Programm...")
|
| 55 | shell.run("pastebin get 8ib4JesQ turbineControl")
| |
| 56 | - | local input = read() |
| 56 | + | print("Download abgeschlossen.")
|
| 57 | - | if input == "j" then |
| 57 | + | print() |
| 58 | - | print() |
| 58 | + | |
| 59 | - | shell.run("label set \"TurbineComputer\"")
|
| 59 | + | sleep(1) |
| 60 | - | print() |
| 60 | + | |
| 61 | - | print("ComputerLabel auf \"TurbineComputer\" gesetzt.")
|
| 61 | + | |
| 62 | - | print() |
| 62 | + | |
| 63 | - | sleep(2) |
| 63 | + | if not fs.exists("startup") then
|
| 64 | - | out = false |
| 64 | + | out2 = true |
| 65 | while out2 do | |
| 66 | - | elseif input == "n" then |
| 66 | + | print("Startup hinzufuegen? (j/n): ")
|
| 67 | - | print() |
| 67 | + | input = read() |
| 68 | - | print("ComputerLabel wurde nicht gesetzt.")
|
| 68 | + | if input == "j" then |
| 69 | - | print() |
| 69 | + | local file = fs.open("startup","w")
|
| 70 | - | out = false |
| 70 | + | file.writeLine("shell.run(\"turbineControl\")")
|
| 71 | - | end |
| 71 | + | file.close() |
| 72 | - | end |
| 72 | + | print("Startup wurde installiert.")
|
| 73 | out2 = false | |
| 74 | - | --Startup |
| 74 | + | end |
| 75 | - | local out2 = true |
| 75 | + | if input == "n" then |
| 76 | - | while out2 do |
| 76 | + | print("Startup wurde nicht installiert.")
|
| 77 | - | term.clear() |
| 77 | + | out2 = false |
| 78 | - | term.setCursorPos(1,1) |
| 78 | + | else |
| 79 | - | print("Es wird empfohlen das Programm zum Startup hinzuzufugen.")
|
| 79 | + | print("Ungueltige Eingabe.")
|
| 80 | - | print("Dadurch wird das Programm beim Starten des Computers automatisch ausgefuehrt.")
|
| 80 | + | end |
| 81 | - | term.write("Startup hinzufuegen? (j/n): ")
|
| 81 | + | end |
| 82 | end | |
| 83 | - | local input = read() |
| 83 | + | |
| 84 | - | if input == "j" then |
| 84 | + | print() |
| 85 | - | local file = fs.open("startup","w")
|
| 85 | + | print("-- Installation abgeschlossen. --")
|
| 86 | - | file.writeLine("shell.run(\"/reactor-turbine-program/start/start.lua\")")
|
| 86 | + | print() |
| 87 | - | file.close() |
| 87 | + | term.setTextColor(colors.yellow) |
| 88 | - | print() |
| 88 | + | print("Reboote...")
|
| 89 | - | print("Startup wurde installiert.")
|
| 89 | + | sleep(1) |
| 90 | - | print() |
| 90 | + | os.reboot() |