Advertisement
Guest User

Untitled

a guest
Mar 24th, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. -- * Bank Core by Wes (eastly878) *
  2. -- Filename: bankCore
  3.  
  4. -- Libraries
  5. os.load("bank/bankAPI")
  6.  
  7. -- Variables
  8. account = nil
  9. password = nil
  10. operation = nil
  11.  
  12.  
  13. --
  14. -- Interface
  15. --
  16. -- Interface Init.
  17. term.clear()
  18. term.setCursorPos(1,1)
  19.  
  20. print "Hello! Please enter one of the following commands:"
  21. print "Withdrawl"
  22. print "Deposit"
  23. print "Check Balance"
  24. print "Create Account"
  25. operation = read()
  26.  
  27. -- Recieve User Input
  28. if operation == "Withdrawl" or "Deposit" or "Check Balance" then
  29. print "Please enter your account name:"
  30. account = read()
  31. print "Please enter account password:"
  32. password = read()
  33.  
  34. aBalance = bankAPI.checkAccount(account, password) -- retrieve account balance
  35. if aBalance == nil then handleError("incorrect password") -- incorrect password handler
  36.  
  37. -- Withdrawl
  38. if operation == "Withdrawl" then
  39. bankAPI.handleError("operation doesn't exist yet")
  40. end
  41.  
  42. -- Deposit
  43. if operation == "Deposit" then
  44. bankAPI.handleError("operation doesn't exist yet")
  45. end
  46.  
  47. -- Check Balance
  48. if operation == "Check Balance" then
  49. term.clear()
  50. term.setCursorPos(1,1)
  51. print ("Your current balance is:", aBalance)
  52. print ("Press ENTER to continue.")
  53. bankAPI.continueCheck()
  54. end
  55. elseif operation == Create Account then
  56. print "Please enter your username:"
  57. local userName = read()
  58.  
  59. print "Please enter a password (DO NOT USE THE SAME PASSWORD AS YOUR MINECRAFT ACCOUNT!!!):"
  60. local password = read()
  61.  
  62. bankAPI.createAccount(userName, password)
  63. else
  64. bankAPI.handleError("No operation chosen")
  65. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement