Elrol

ComputerInstaller

Nov 23rd, 2019 (edited)
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.24 KB | None | 0 0
  1. --Computer Installer
  2. console = "pGhFuMWX"
  3. gui = "j44YAb9F"
  4. master = "J438Usuq"
  5. mainDoor = "Ln6eXbAg"
  6. spawner = "aGW702uP"
  7. lights = "Mzv5RFSC"
  8.  
  9. function install(link,file)
  10.     if fs.exists(file) then
  11.         fs.delete(file)
  12.         shell.run("pastebin", "get", link, file)
  13.         print("Updated "..file)
  14.     else
  15.         shell.run("pastebin", "get", link, file)
  16.         print("Installed "..file)
  17.     end
  18. end
  19.  
  20.  function start()
  21.     term.clear()
  22.     term.setCursorPos(1,1)
  23.     print("Please define computer type:")
  24.     print("Options are: [master, main door, spawner, lights]")
  25.     write(">")
  26.     compType = read()
  27.     if compType == "master" then
  28.         install(console, "console")
  29.         install(gui, "gui")
  30.         install(master, "startup")
  31.     elseif compType == "main door" then
  32.         install(console, "console")
  33.         install(mainDoor, "startup")
  34.     elseif compType == "spawner" then
  35.         install(spawner, "startup")
  36.     elseif compType == "lights" then
  37.         install(console, "console")
  38.         install(lights, "startup")
  39.     else
  40.         print("Invalid computer type.")
  41.         return
  42.     end
  43.     print("Files Downloaded and installed. Make sure to set the variables in startup, then restart")
  44. end
  45.  
  46. start()
Add Comment
Please, Sign In to add comment