Advertisement
Xelostar

LightspeedInstaller

Mar 27th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.67 KB | None | 0 0
  1. term.setBackgroundColor(colors.black)
  2. term.setTextColor(colors.white)
  3. term.clear()
  4. term.setCursorPos(1, 1)
  5.  
  6. proceed = false
  7.  
  8. if (fs.exists("Lightspeed")) then
  9.     print("Lightspeed is already installed, would you like to uninstall it? (y/n)")
  10.     write("> ")
  11.     local c = read()
  12.  
  13.     if (c == "y") then
  14.         print("Uninstalling Lightspeed...")
  15.        
  16.         write("Deleting main program...")
  17.         shell.run("delete Lightspeed")
  18.         print("DONE!")
  19.         write("Deleting pShip1.img...")
  20.         shell.run("delete pShip1.img")
  21.         print("DONE!")
  22.         write("Deleting eShip1.img...")
  23.         shell.run("delete eShip1.img")
  24.         print("DONE!")
  25.         print(" ")
  26.  
  27.         print("Lightspeed is uninstalled. Press any key to close...")
  28.         os.pullEventRaw()
  29.         term.clear()
  30.         term.setCursorPos(1, 1)
  31.     else
  32.         print("Not uninstalling. Press any key to close...")
  33.         os.pullEventRaw()
  34.         term.clear()
  35.         term.setCursorPos(1, 1)
  36.     end
  37. else
  38.     print("Lightspeed is not yet installed.")
  39.  
  40.     print("Would you like to install it? (y/n)")
  41.     write("> ")
  42.     local c = read()
  43.  
  44.     if (c == "y") then
  45.         proceed = true
  46.     else
  47.         print("Not installing. Press any key to close...")
  48.         os.pullEventRaw()
  49.         term.clear()
  50.         term.setCursorPos(1, 1)
  51.     end
  52. end
  53.  
  54. if (proceed == true) then
  55.     print("Installing Lightspeed...")
  56.  
  57.     write("Downloading main program...")
  58.     shell.run("pastebin get 3FNwiPA6 Lightspeed")
  59.     print("DONE!")
  60.     write("Downloading pShip1.img...")
  61.     shell.run("pastebin get KRwgnS35 pShip1.img")
  62.     print("DONE!")
  63.     write("Downloading eShip1.img...")
  64.     shell.run("pastebin get ut2kB9DX eShip1.img")
  65.     print("DONE!")
  66.     print(" ")
  67.  
  68.     print("Done installing. Press any key to close...")
  69.     os.pullEventRaw()
  70.     term.clear()
  71.     term.setCursorPos(1, 1)
  72. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement