Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local links = {
- ["Main"] = {link = "EsDc0Kjt", path = "grimShellMain"},
- ["Menu"] = {link = "tYhxmTBk", path = "GrimShell/menu"},
- ["Screen"] = {link = "L9UqyZXB", path = "GrimShell/screen"},
- ["Interface"] = {link = "rsNZVufk", path = "GrimShell/interface"},
- ["Utilities"] = {link = "sCU7ZF3g", path = "GrimShell/utilities"},
- ["Click"] = {link = "BW3MQECY", path = "GrimShell/click"},
- ["Color"] = {link = "ynLqZDYq",path = "GrimShell/color"}
- }
- -- Retrieves a file from pastebin using http.get, then
- -- saves it to the desired destination.
- function downloadFromPastebin(link, destination)
- http.request("http://pastebin.com/raw.php?i=" .. textutils.urlEncode(link))
- while true do
- local event, url, download = os.pullEvent()
- if event == "http_success" then
- if not fs.isDir("/GrimShell") then
- fs.makeDir("/GrimShell")
- end
- local file = fs.open(destination, 'w')
- local downloadContents = download.readAll()
- download.close()
- if file then
- file.write(downloadContents)
- file.close()
- else
- error(destination .. " already exists.")
- end
- return
- elseif event == "http_failure" then
- error("Download from " .. lin .. " failed.")
- end
- end
- end
- -- Downloads and installs all necessary APIs for the grim shell to
- -- run.
- function installShell()
- for index, item in pairs(links) do
- print("Installing " .. index .. " to " .. item.path)
- downloadFromPastebin(item.link, item.path)
- end
- end
- installShell()
Advertisement
Add Comment
Please, Sign In to add comment