Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if fs.exists("DEV") then
- Database = "https://dl.dropboxusercontent.com/u/34308546/Computercraft_Folder/Downloads/EnergyReader_2_0/DEV"
- else
- Database = "https://dl.dropboxusercontent.com/u/34308546/Computercraft_Folder/Downloads/EnergyReader_2_0"
- end
- local ProgramName =
- "Tom's RF Reader 2.0"
- local pastebincode =
- "C45iaMup"
- local DownloadLink =
- tostring(Database)
- local supVersion = {
- "CraftOS 1.5",
- "CraftOS 1.6"
- }
- DownloadNames = {
- "startup",
- "p",
- "var",
- "EbOS_Concept",
- "EnergyReader",
- "FAQ",
- "Installer",
- "updater",
- "version"
- }
- PackFile =
- "TRFR2.insl"
- local function ChangeColor(color)
- term.setBackgroundColor(color)
- term.setTextColor(color)
- end
- if fs.exists("unpack") == false then
- print("This program requires an unpacking program.")
- print("It will be downloaded and installed on you computer now")
- shell.run("pastebin","get",pastebincode, "unpack")
- sleep(2)
- end
- term.setTextColor(colors.red)
- term.clear()
- term.setCursorPos(1,1)
- print("Current version: "..os.version())
- print(" ")
- print("A warning message should appear. If not, you are running a version on CraftOS that this porgram is not yet tested for! Any bugs or crashes will happend on own risk!")
- print(" ")
- if supVersion[1] == os.version() then
- print("WARNING! Make sure your http api is enabled befor starting this installation!")
- end
- if supVersion[2] == os.version() then
- print("WARNING! Make sure that http whitelist is disabled or add Dropbox.com to the whitelist!")
- end
- print("Press Y to start the installation")
- e, k = os.pullEvent("key")
- if k ~= 21 then
- print(":)")
- sleep(1)
- os.shutdown()
- end
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- term.clear()
- term.setCursorPos(1,1)
- term.write("Installer for "..ProgramName)
- fs.makeDir(PackFile)
- for i = 1,#DownloadNames do
- ChangeColor(colors.gray)
- term.setCursorPos(15,5)
- term.write("XXXXXXXXXXXXXXXXXXXX")
- ChangeColor(colors.lightGray)
- for i=6,12 do
- term.setCursorPos(15,i)
- term.write("XXXXXXXXXXXXXXXXXXXX")
- end
- term.setTextColor(colors.black)
- term.setCursorPos(16,7)
- term.write("Installing...")
- term.setCursorPos(17,8)
- term.write(DownloadNames[i])
- term.setCursorPos(16,10)
- term.setBackgroundColor(colors.gray)
- for x = 1,#DownloadNames do
- term.write(" ")
- end
- term.setCursorPos(16,10)
- term.setBackgroundColor(colors.green)
- for c = 1,i do
- term.write(" ")
- end
- Download = http.get(DownloadLink.."/"..DownloadNames[i])
- d = fs.open(PackFile.."/"..DownloadNames[i],"w")
- d.write(Download.readAll())
- d.close()
- end
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- term.setCursorPos(16,11)
- term.write("Done")
- term.setCursorPos(16,12)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- shell.run("unpack",PackFile)
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.black)
- write(" Success!")
- sleep(2)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement