optimussnorr

easydownloader

Nov 16th, 2013
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.84 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("> EasyDownloader loaded and shortcutted..")
  4. print("> You are about to download: Installer for OSROS-r")
  5. print("")
  6. print("> Do you wish to download the installer for OSROS-r? (y/n)")
  7.  
  8. write("> ")
  9. local ui = read()
  10.  
  11. if ui == "y" then
  12.  local get = http.get("https://raw.github.com/optimussnorr/osros/master/installer")
  13.  local data = get.readAll()
  14.  get.close()
  15.  local file = fs.open("installer","w")
  16.  file.write(data)
  17.  file.close()
  18.  print("> downloaded. running now...")
  19.  print("> (can be run later with 'installer'")
  20.  sleep(2)
  21.  shell.run("installer")
  22. elseif ui == "n" then
  23.  print("> download aborted.")
  24.  sleep(1)
  25.  print("> closing easyDloader...")
  26.  sleep(2)
  27.  term.clear()
  28.  term.setCursorPos(1,1)
  29. else
  30.  print("> use 'y' or 'n'! case sensitive!")
  31.  sleep(1)
  32.  print("> operation closed")
  33. end
Add Comment
Please, Sign In to add comment