Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function statsreq(jmeno)
- local myID = os.getComputerID()
- rednet.broadcast("requeststate", "ucel")
- rednet.broadcast(myID, "id")
- rednet.broadcast(jmeno, "kdo")
- local id, msgucet = rednet.receive()
- ucet = tonumber(msgucet)
- end
- --core
- rednet.open("right")
- passwordD = "david"
- passwordF = "filip"
- local heslonerozpoznano = true
- while heslonerozpoznano do
- write("Heslo: ")
- local input = read("*")
- if input == passwordD then
- heslonerozpoznano = false
- print ("Prihlasen jako uzivatel David.")
- statsreq("David")
- print("Stav uctu: " .. ucet)
- print("done")
- elseif input == passwordF then
- heslonerozpoznano = false
- print ("Prihlasen jako uzivatel Filip.")
- statsreq("Filip")
- print("Stav uctu: " .. ucet)
- print("done")
- else print ("Heslo nerozpoznano")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement