Advertisement
Marlingaming

Tablet Banking Script Version 1 Series Copper

Dec 2nd, 2021 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. local tArg = {..}
  2. local AccountName = 'guest'
  3. local AccountID = 000000
  4. local PreBalance = 0
  5. local AccountBalance = 0
  6. local AccountProtocol = AccountID
  7. local AccountKey = 0000
  8. local SecurityCode = 00000
  9.  
  10.  
  11. GetAccountDetails()
  12. PreBalance = AccountBalance
  13. getSecurityCode()
  14. CheckTransfer()
  15.  
  16.  
  17. local function CheckTransfer()
  18. if tArg[2] == SecurityCode then
  19. if tArg[0] == "Deposit" then
  20. AccountBalance = AccountBalance + tArg[1]
  21. elseif tArg[0] == "Withdraw" then
  22. AccountBalance = AccountBalance - tArg[1]
  23. end
  24. WriteRecept("Successful")
  25. print("Transfer Successful")
  26. os.sleep(10)
  27. os.reboot()
  28. else
  29. print("Invalid Security Code")
  30. WriteRecept("Failed")
  31. os.sleep(4)
  32. os.shutdown()
  33. end
  34. end
  35.  
  36. local function getSecurityCode()
  37. local file = fs.open(".Secure_SecurityCode","r")
  38. SecurityCode = fs.readAll()
  39. file.close()
  40. end
  41.  
  42. local function WriteRecept(Result)
  43. local file = fs.open(tArg[3].."_"..tArg[0].."-"..Result)
  44. file.writeLine(tArg[0].."_"..tArg[1])
  45. file.writeLine(tArg[2])
  46. file.writeLine(PreBalance)
  47. file.writeLine(AccountBalance)
  48. file.close()
  49. print("Recept Printed")
  50. end
  51.  
  52. local function GetAccountDetails()
  53. local file = fs.open(".Secure_Account","r")
  54. AccountName = file.readLine()
  55. AccountID = file.readLine()
  56. AccountBalance = file.readLine()
  57. AccountProtocol = file.readLine()
  58. AccountKey = file.readLine()
  59. file.close()
  60. end
  61.  
  62. local function UpdateAccount()
  63. local file = fs.open(".Secure_Account","w")
  64. file.clear()
  65. file.writeLine(AccountName)
  66. file.writeLine(AccountID)
  67. file.writeLine(AccountBalance)
  68. file.writeLine(AccountProtocol)
  69. file.writeLine(AccountKey)
  70. file.close()
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement