Advertisement
Thor_s_Crafter

TurbineProgramPatcher

Aug 7th, 2016
2,873
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.70 KB | None | 0 0
  1. -- Reactor- und Turbine control by Thor_s_Crafter --
  2. -- Patcher for all versions --
  3.  
  4. --Currently for: Version 2.3
  5.  
  6. --Remove all previous program parts
  7. if fs.exists("changelog.txt") then shell.run("rm changelog.txt") end
  8. if fs.exists("editOptions") then shell.run("rm editOptions") end
  9. if fs.exists("installer") then shell.run("rm installer") end
  10. if fs.exists("installerUpdate") then shell.run("rm installerUpdate") end
  11. if fs.exists("menu") then shell.run("rm menu") end
  12. if fs.exists("options.txt") then shell.run("rm options.txt") end
  13. if fs.exists("reactorControl") then shell.run("rm reactorControl") end
  14. if fs.exists("start") then shell.run("rm start") end
  15. if fs.exists("startup") then shell.run("rm startup") end
  16. if fs.exists("touchpoint") then shell.run("rm touchpoint") end
  17. if fs.exists("turbineControl") then shell.run("rm turbineControl") end
  18.  
  19. --Create install directory
  20. if not fs.exists("/reactor-turbine-program/install/") then
  21. shell.run("mkdir /reactor-turbine-program/install/")
  22. else shell.run("rm /reactor-turbine-program/") end
  23.  
  24. --User Input
  25. local userInput = ""
  26. while true do
  27.   term.clear()
  28.   term.setCursorPos(1,1)
  29.   print("Bitte Sprache auswaehlen.")
  30.   print("Please choose your language.")
  31.   print("de / en")
  32.   term.write("-> ")
  33.   userInput = read()
  34.   if userInput == "de" or userInput == "en" then
  35.     break
  36.   end
  37. end
  38.  
  39. --Gets the current files
  40. if userInput == "de" then
  41.   shell.run("pastebin get 5BA3RTAf /reactor-turbine-program/install/installerUpdate.lua")
  42. elseif userInput == "en" then
  43.    shell.run("pastebin get np6WZLJw /reactor-turbine-program/install/installerUpdate.lua")
  44. end
  45.  
  46. --Start new installer
  47. shell.run("/reactor-turbine-program/install/installerUpdate.lua")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement