Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- rednet.open("left")
- serverId = 13
- while true do
- shell.run("clear")
- print("Enter username:")
- local usr = read()
- if usr == "shutdown" then
- break
- else
- rednet.send(serverId, "create")
- id1,msg = rednet.receive()
- if id1 == serverId then
- if msg == "continue" then
- rednet.send(serverId, usr)
- id,msg = rednet.receive()
- if msg == "continue" then
- print("Enter password:")
- local pwd = read("*")
- rednet.send(serverId, pwd)
- id,msg = rednet.receive()
- if msg == "created" then
- print("Account created")
- while true do
- if disk.hasData("bottom") then
- local label = disk.getLabel("bottom")
- if label ~= nil then
- disk.eject("bottom")
- os.pullEvent("disk")
- else
- disk.setLabel("bottom", usr)
- disk.eject("bottom")
- print("Account "..usr.." created")
- sleep(3)
- break
- end
- elseif disk.isPresent("bottom") then
- disk.eject("bottom")
- os.pullEvent("disk")
- else
- print("Please wait for a disk")
- os.pullEvent("disk")
- end
- end
- else
- print("Error, please try again")
- sleep(3)
- end
- else
- print("Password already in use, please try again")
- sleep(3)
- end
- end
- else
- print("Could not authenticate server, retry")
- sleep(3)
- end
- end
- end
Add Comment
Please, Sign In to add comment