Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- function accounterstellen()
- rednet.send(7,"benutzername")
- id, username = rednet.receive()
- username = username
- if fs.exists(username) then
- rednet.send(7, "vorhanden")
- os.reboot()
- end
- rednet.send(7,"password")
- id, password = rednet.receive()
- password = password
- f = fs.open(..username.., "w")
- f.writeLine(password)
- f.close()
- os.reboot()
- end
- function anmelden()
- rednet.send(7, "anmeldename")
- id, anmeldename = rednet.receive()
- username = anmeldename
- id, password = rednet.receive()
- password = password
- f = fs.open(..username.., "r")
- serverpassword = f.readAll()
- f.close()
- if serverpassword == password then
- rednet.send(7, "akzeptiert")
- else
- rednet.send(7, "abgelehnt")
- end
- os.reboot()
- end
- while true do
- id, message = rednet.receive()
- if id == 8 and tonumber(message) == 1 then
- accounterstellen()
- end
- if id == 8 and tonumber(message) == 2 then
- anmelden()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement