Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local programName = "Emac Editor"
- local creatorName = "MineRobber"
- local function getFile(user,repo,branch,file,outfile)
- local fileg = http.get("https://raw.githubusercontent.com/"..user.."/"..repo.."/"..branch.."/"..file)
- --print("https://raw.githubusercontent.com/"..user.."/"..repo.."/"..branch.."/"..file)
- local out = fs.open(outfile,"w")
- out.write(fileg.readAll())
- out.close()
- fileg.close()
- end
- local function setColor(c)
- if term.isColor() then term.setTextColor(c) end
- end
- local function install()
- print("Installing...")
- getFile("MineRobber9000","CC-Scripts","master","emac/src/main.lua","emac.lua")
- sleep(1)
- setColor(colors.green)
- print("Done!")
- setColor(colors.white)
- end
- -- main functionality begins here
- term.clear()
- term.setCursorPos(1,1)
- print(programName.." by "..creatorName)
- write("Do you want to install?(y/N) ")
- local tEvent = { os.pullEvent("char") }
- if tEvent[2]=="y" then
- setColor(colors.green)
- print("[YES]")
- setColor(colors.white)
- install()
- else
- setColor(colors.red)
- print("[NO]")
- setColor(colors.white)
- print("Thank you for considering!")
- end
Add Comment
Please, Sign In to add comment