Client:
Spoiler
server= changeme
rednet.open("back")
while true do
textutils.slowPrint("please log in")
textutils.slowPrint("Username:")
user = io.read()
rednet.send(server, user)
textutils.slowPrint("waiting for server")
repeat
id, pass_s = rednet.receive()
until id == server
if pass_s == "fail" then
textutils.slowPrint("user not registered")
else
textutils.slowPrint("Password:")
pass_l = io.read()
if pass_s == pass_l then
textutils.slowPrint("acces granted for 10 seconds")
redstone.setOutput("right",true)
os.sleep(10)
redstone.setOutput("right",false)
term.clear()
term.setCursorPos(1,1)
else
textutils.slowPrint("acces denied")
term.clear()
term.setCursorPos(1,1)
end
end
end
Server:
Spoiler
client=changeme
usr="changeme"
pass="changeme"
rednet.open("back")
while true do
repeat
id, user = rednet.receive()
until id == client
if user == usr then
os.sleep(5)
rednet.send(client,pass)
else
os.sleep(5)
rednet.send(client,"fail")
end
end
ps: @Espen if u wanna improve have fun ^^












