Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("back")
- local msg
- local i = 1
- while true do
- write("Banking Terminal")
- write("\n Username: ")
- username = io.read("*l")
- --term.write(username)
- server = rednet.lookup("accounting","Banking")
- write("\n Server" ..server)
- rednet.send(server, username , "username")
- comp, exists, prot = rednet.receive("login")
- while msg ~= "success" do
- write("\n attempt" .. i .. "/5")
- write("\n" ..exists)
- if exists ~= "Password? " then
- os.reboot()
- end
- pass = io.read("*l")
- rednet.send(server, pass)
- comp, msg, prot = rednet.receive("logged")
- if i>5 then
- write("\nYou have failed to login 5 times")
- sleep(5)
- os.reboot()
- end
- i = i + 1
- end
- while true do
- write("\n You have logged in successfully")
- write("\n What would you like to do?")
- write("\n 1. Check Balance")
- write("\n 2. Deposit")
- write("\n 3. Withdraw")
- write("\n 4. log out")
- option = io.read()
- if option == "1" then
- rednet.send(server, "balance")
- comp, bal, prot = rednet.receive()
- write("\n" ..bal[0])
- write("\n" ..bal[1])
- write("\n" ..bal[2])
- end
- if option == "4" then
- os.reboot()
- end
- end
- end
Add Comment
Please, Sign In to add comment