John5505

Minecraft Bank Client (incomplete)

Feb 10th, 2016
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. rednet.open("back")
  2. local msg
  3. local i = 1
  4. while true do
  5. write("Banking Terminal")
  6. write("\n Username: ")
  7. username = io.read("*l")
  8. --term.write(username)
  9. server = rednet.lookup("accounting","Banking")
  10. write("\n Server" ..server)
  11. rednet.send(server, username , "username")
  12. comp, exists, prot = rednet.receive("login")
  13. while msg ~= "success" do
  14. write("\n attempt" .. i .. "/5")
  15. write("\n" ..exists)
  16. if exists ~= "Password? " then
  17. os.reboot()
  18. end
  19. pass = io.read("*l")
  20. rednet.send(server, pass)
  21. comp, msg, prot = rednet.receive("logged")
  22. if i>5 then
  23. write("\nYou have failed to login 5 times")
  24. sleep(5)
  25. os.reboot()
  26. end
  27. i = i + 1
  28. end
  29. while true do
  30. write("\n You have logged in successfully")
  31. write("\n What would you like to do?")
  32. write("\n 1. Check Balance")
  33. write("\n 2. Deposit")
  34. write("\n 3. Withdraw")
  35. write("\n 4. log out")
  36. option = io.read()
  37. if option == "1" then
  38. rednet.send(server, "balance")
  39. comp, bal, prot = rednet.receive()
  40. write("\n" ..bal[0])
  41. write("\n" ..bal[1])
  42. write("\n" ..bal[2])
  43. end
  44. if option == "4" then
  45. os.reboot()
  46. end
  47. end
  48. end
Add Comment
Please, Sign In to add comment