Advertisement
RiseAboveHate

Siren System Installer

Dec 14th, 2014
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.63 KB | None | 0 0
  1. fs.delete("startup")
  2. fs.delete("SCode")
  3.  
  4. local SirenCodeTable = {"175", "217", "218", "220"}
  5.  
  6. local SirenServer = {"HLtsrcGt", "startup"}
  7. local SirenClient = {"ARL1VeTU", "startup"}
  8.  
  9. local function SirensACode(tTable, tText)
  10.   local resault = "(Not found!)"
  11.   for i=1, #tTable do
  12.     if tText == tTable[i] then
  13.       resault = tTable[i]
  14.     end
  15.   end
  16.   return resault  
  17. end
  18.  
  19. local type
  20. print("Please enter the system that you want to install: \nThe options are server OR client (Remember to write this in lower case!)")
  21. write("")
  22. type = read()
  23. --if pExists == 1 then break end
  24.  
  25. --while pExists == 1 do
  26. if type == "server" then
  27.   shell.run("pastebin", "get", SirenServer[1], SirenServer[2])
  28. elseif type == "client" then
  29.   shell.run("pastebin", "get", SirenClient[1], SirenClient[2])
  30. else
  31. error("You can only choose server OR client")
  32. end
  33.  
  34. local SiCode = ""
  35.  
  36. if not fs.exists("SCode") then
  37.   --print("Successfully downloaded Siren "..type.."\nNow please enter the siren area code: \n")
  38.   if SirensACode(SirenCodeTable, SiCode) == "(Not found!)" then
  39.     print("Please enter the siren codes\nThe Codes are\n175 | 217 | 218 | 219 | 220")
  40.     write("")
  41.     SiCode = read()    
  42.   end
  43.  
  44.   local SCodeFile = fs.open("SCode", "w")
  45.     SCodeFile.write(SiCode)
  46.   SCodeFile.close()
  47.  
  48. end
  49.  
  50. print("Successfully installed Siren "..type.."\n")
  51. textutils.slowPrint("Restarting in 5")
  52. textutils.slowPrint("Restarting in 4")
  53. textutils.slowPrint("Restarting in 3")
  54. textutils.slowPrint("Restarting in 2")
  55. textutils.slowPrint("Restarting in 1")
  56. textutils.slowPrint("Restarting Now!")
  57. sleep(1)
  58. fs.delete("installer")
  59. os.reboot()
  60. --end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement