Advertisement
CaptainSpaceCat

CC IOS Initialization

May 17th, 2015
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. files = {}
  2. --IOS Files--
  3. files["ios"] = "rmnHYSkq"
  4. files["iostabs"] = "xSRZrcp6"
  5. files["iosvars"] = "7KuBG4NH"
  6. files["iosutils"] = "UHb5eAEx"
  7. files["iostabsinit"] = "6hcTn9T0"
  8.  
  9. --App Files--
  10. files["message"] = "D3sCfErD"
  11. files["calculator"] = "RmFguhxP"
  12. files["appstore"] = "KihpNLf8"
  13. files["settings"] = "QAvxJXTE"
  14. files["editor"] = "cZauu9Xm"
  15.  
  16. --Image Files--
  17. files["message.nfp"] = "Ezm4rXXv"
  18. files["calculator.nfp"] = "9p8s7bxb"
  19. files["appstore.nfp"] = "sRA16beb"
  20. files["settings.nfp"] = "L7hfnHB1"
  21. files["editor.nfp"] = "Z8JbW7zn"
  22. w, h = term.getSize()
  23.  
  24. if not fs.exists("luaide") then
  25.   shell.run("pastebin get vyAZc6tJ luaide")
  26. end
  27.  
  28. filenum = 0
  29. for i, v in pairs(files) do
  30.   filenum = filenum + 1
  31. end
  32.  
  33. function progressBar()
  34.   term.setCursorPos(1, h)
  35.   for n = 1, (num / filenum) * w do
  36.     term.write(" ")
  37.   end
  38. end
  39.  
  40. num = 1
  41. for i, v in pairs(files) do
  42.   term.clear()
  43.   term.setCursorPos(1, 1)
  44.   term.setBackgroundColor(colors.lightGray)
  45.   term.write("Downloading files...")
  46.   if fs.exists(i) then
  47.     term.setBackgroundColor(colors.red)
  48.     progressBar()
  49.     term.setBackgroundColor(colors.black)
  50.     term.setCursorPos(1, h - 4)
  51.     print("File " .. i .. " already exists. Delete original file or rename?")
  52.     term.setCursorPos(1, h - 1)
  53.     term.write("Delete   Rename")
  54.     issue = true
  55.     while issue do
  56.       select = {os.pullEvent("mouse_click")}
  57.       if select[3] >= 1 and select[3] <= 6 and select[4] == h - 1 then
  58.         shell.run("delete " .. i)
  59.         issue = false
  60.       elseif select[3] >= 10 and select[3] <= 15 and select[4] == h - 1 then
  61.         term.setCursorPos(1, h - 1)
  62.         term.write("Input new filename: ")
  63.         input = read()
  64.         shell.run("copy " .. i .. " " .. input)
  65.         shell.run("delete " .. i)
  66.         issue = false
  67.       end
  68.     end
  69.   else
  70.     term.setBackgroundColor(colors.green)
  71.     progressBar()
  72.   end
  73.   term.setBackgroundColor(colors.black)
  74.   term.setCursorPos(1, 4)
  75.   shell.run("pastebin get " .. v .. " " .. i)
  76.   num = num + 1
  77. end
  78.  
  79. term.setBackgroundColor(colors.black)
  80. term.clear()
  81. term.setCursorPos(1, 1)
  82. print("IOS files downloaded, run as \"ios\"")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement