Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ver = "0.2"
- local server = "QsUB5kWK"
- local client = "ccypr5E0"
- local vo = nil
- local valid = false
- if not http then
- printError("You must enable the http API in the ComputerCraft.cfg file to download DuoStep.")
- vo = false
- end
- while not vo do
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.clear()
- print("DuoStep - Setup v"..ver)
- print("")
- print("1: Install Server")
- print("2: Install Client")
- print("3: Exit")
- option = read()
- if option == "1" then
- vo = true
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.clear()
- print("DuoStep - Setup v"..ver)
- print("")
- term.write("Save as: ")
- local file = read()
- local _,y = term.getCursorPos()
- term.setCursorPos(1,y+1)
- print("Downloading server as "..file.."...")
- resp = http.get("http://pastebin.com/raw.php?i="..server)
- if resp then
- handler=io.open(file,"w")
- handler:write(resp.readAll())
- handler:close()
- print("Success! DuoStep Server v"..ver.." has been installed.")
- else
- printError("An error occurred, DuoStep Server v"..ver.." could not be installed at this time.")
- end
- elseif option == "2" then
- vo = true
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- term.setCursorPos(1,1)
- term.clear()
- print("DuoStep - Setup v"..ver)
- print("")
- term.write("Save as: ")
- local file = read()
- local _,y = term.getCursorPos()
- term.setCursorPos(1,y+1)
- print("Downloading client as "..file.."...")
- resp = http.get("http://pastebin.com/raw.php?i="..client)
- if resp then
- handler=io.open(file,"w")
- handler:write(resp.readAll())
- handler:close()
- print("Success! DuoStep Client v"..ver.." has been installed.")
- else
- printError("An error occurred, DuoStep Client v"..ver.." could not be installed at this time.")
- end
- else
- printError("Not a valid option!")
- sleep(3)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement