Advertisement
m1cr0man

RC Installer

Jul 9th, 2012
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.19 KB | None | 0 0
  1. --Reactor Controller Installer
  2. print("Reactor Controller Installation\n")
  3. local apidir, link = "/reactor", "YfV1CAHb"
  4. if fs.exists("/disk/m1") ~= true then
  5.     print("M1cr0API not found, Download now? (http_api must be enabled)")
  6.     if string.lower(read()) == "yes" then
  7.         print("Downloading...")
  8.         shell.run("pastebin", "get", link, "/disk/m1")
  9.     else error("Please put m1cr0api in /disk/m1") end
  10. end
  11. print("Select a Program (1 or 2):\n")
  12. print("1. Reactor Controller")
  13. print("2. RC RAT")
  14. local choice = tonumber(read())
  15. print("Please Wait, Floppy will eject momentarily...")
  16. if choice == 1 then
  17.     if fs.exists("/startup") then fs.delete("/startup") end
  18.     fs.copy("/disk/controller", "/startup")
  19.     if fs.exists(apidir) ~= true then fs.makeDir(apidir) end
  20.     if fs.exists(apidir.."/m1") then fs.delete(apidir.."/m1") end
  21.     fs.copy("/disk/m1", apidir.."/m1")
  22. elseif choice == 2 then
  23.     if fs.exists("/startup") then fs.delete("/startup") end
  24.     fs.copy("/disk/rat", "/startup")
  25.     if fs.exists("/m1") then fs.delete("/m1") end
  26.     fs.copy("/disk/m1", "/m1")
  27. else error("Invalid Choice, please type 1 or 2") end
  28. if not shell.run(apidir.."/m1") then shell.run("/m1") end
  29. disk.eject(getperipheral("drive"))
  30. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement