Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local vers = "2.0"
- term.clear()
- term.setCursorPos(1,1)
- --This is a function is part of Pastebin! I didn't write this--
- --Well, I rewrote it to be used inside of a program rather than as a program itself--
- function get(sCode,sFile)
- local sPath = shell.resolve( sFile )
- if fs.exists( sPath ) then
- return false
- end
- local response = http.get("http://pastebin.com/raw.php?i="..textutils.urlEncode( sCode ))
- if response then
- local sResponse = response.readAll()
- response.close()
- local file = fs.open( sPath, "w" )
- file.write( sResponse )
- file.close()
- return true
- else
- return false
- end
- end
- --Program--
- if not http then
- error("Http API not enabled")
- end
- if not term.isColor() then
- print("NOTE: Message System 2 is designed for advanced computers. It will not run on regular computers")
- print(" ")
- end
- print("Messagesystem Installer v"..vers.." is ready!")
- print("Press any key to continue...")
- os.pullEvent("key")
- print("Downloading MessageSystem...")
- if fs.exists("ms2") then
- print("File conflict! Deleting...")
- shell.run("delete ms2")
- print("Fixed. Retrying...")
- end
- if get("npEnj7XD","ms2") then
- print("Message System 2 successfully downloaded")
- else
- print("Something went wrong while downloading :/")
- return
- end
- print("Downloading background...")
- if fs.exists("msbg") then
- print("File conflict! Deleting...")
- shell.run("delete msbg")
- print("Fixed. Retrying...")
- end
- if get("79HdkjG7","msbg") then
- print("Background successfully downloaded")
- else
- print("Something went wrong while downloading :/")
- return
- end
- print("Install Completed")
- print("Run Message System 2 now?")
- print("y/n")
- local event,par1
- local run = false
- while true do
- event,par1 = os.pullEvent("char")
- if par1 == "y" then
- print("Running...")
- run = true
- break
- elseif par1 == "n" then
- print("Thank you for using Message System :)")
- break
- end
- end
- if run then
- shell.run("ms2")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement