Advertisement
m1cr0man

M1cr0S Installer

Jul 9th, 2012
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. --M1cr0S Installer
  2. term.clear()
  3. print("M1cr0S Installation\n")
  4. local apidir, link = "/files", "YfV1CAHb"
  5. if fs.exists("/disk/m1") ~= true then
  6.     print("M1cr0API not found, Download now? (http_api must be enabled)")
  7.     if string.lower(read()) == "yes" then
  8.         print("Downloading...")
  9.         shell.run("pastebin", "get", link, "/disk/m1")
  10.     else error("Please put m1cr0api in /disk/m1") end
  11. end
  12. print("Select a Program (1, 2 or 3):\n")
  13. print("1. Server")
  14. print("2. MEMail Client")
  15. print("3. Door Locker")
  16. local choice = tonumber(read())
  17. if fs.exists("/startup") then fs.delete("/startup") end
  18. if choice < 1 or choice > 3 then error("Invalid Choice, please type 1, 2 or 3")
  19. elseif choice == 1 then
  20.     print("Please Wait, Floppy will eject momentarily...")
  21.     fs.copy("/disk/server", "/startup")
  22.     if fs.exists(apidir) ~= true then fs.makeDir(apidir) end
  23.     if fs.exists(apidir.."/m1") then fs.delete(apidir.."/m1") end
  24.     fs.copy("/disk/m1", apidir.."/m1")
  25.     shell.run(apidir.."/m1")
  26. elseif choice == 2 then
  27.     print("Please Wait, Floppy will eject momentarily...")
  28.     fs.copy("/disk/memail", "/startup")
  29.     if fs.exists("/m1") then fs.delete("/m1") end
  30.     fs.copy("/disk/m1", "/m1")
  31.     shell.run("/m1")
  32. elseif choice == 3 then
  33.     print("Please Wait, Floppy will eject momentarily...")
  34.     fs.copy("/disk/door", "/startup")
  35.     if fs.exists("/m1") then fs.delete("/m1") end
  36.     fs.copy("/disk/m1", "/m1")
  37.     shell.run("/m1")
  38. end
  39. disk.eject(getperipheral("drive"))
  40. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement