Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- rednet.broadcast("SERVER LOCATE")
- local id, message = rednet.receive(5)
- if not message then
- error("No server located. Server may have crashed. (ERR: CALL_TIMEOUT)")
- end
- serverid = id
- print("Located Server: ", serverid)
- print("Client starting")
- write("Username: ")
- username = read()
- write("Password: ")
- password = read("*")
- rednet.send(serverid, "login_start")
- local id, message = rednet.receive()
- if message == "AUTHENTICATE NOW" then
- rednet.send(serverid, username)
- rednet.send(serverid, password)
- id, session = rednet.receive()
- if session == "err" then
- error("Incorrect username or password (ERR: Server 404 (usr/pass not found))")
- end
- print("Got session. ", session)
- id, message = rednet.receive()
- print(message)
- print("When you're finished with the computer. Please type 'logout'")
- end
- while true do
- write("> ")
- message = read()
- if message == "logout" or message == "exit" or message == "shutdown" then
- os.shutdown()
- end
- if message == "upgrade" then
- shell.run("rm startup")
- shell.run("pastebin get 1VHszN6d startup")
- os.reboot()
- end
- if message == "chat" then
- shell.run("chat join smyd ", username)
- end
- end
Add Comment
Please, Sign In to add comment