xXm0dzXx

Untitled

Jul 16th, 2012
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. rednet.open("top")
  2. local bankID = 217;
  3. local w, h = term.getSize()
  4.  
  5. function cPrint(str, ypos)
  6. term.setCursorPos(w/2-#str/2, ypos)
  7. write(str)
  8. end
  9.  
  10. function clear()
  11. term.clear()
  12. term.setCursorPos(1,1)
  13. end
  14.  
  15. print("Entering fullscreen in 3...")
  16. sleep(1)
  17. print("2...")
  18. sleep(1)
  19. print("1...")
  20. sleep(1)
  21. selection = 1
  22.  
  23. while true do
  24. clear()
  25. if selection == 1 then
  26. print("> Login < Register \n")
  27. else
  28. print(" Login > Register <\n")
  29. end
  30.  
  31. cPrint("+-------------------+", 3)
  32. cPrint("| |", 4)
  33. cPrint("| Username: |", 5)
  34. cPrint("| Password: |", 6)
  35. cPrint("| |", 7)
  36. cPrint("+-------------------+", 8)
  37.  
  38. local event, key = os.pullEvent("key")
  39.  
  40. if key == 203 then
  41. selection = 1
  42. elseif key == 205 then
  43. selection = 94897983697
  44. elseif key == 28 then
  45. break
  46. end
  47. end
  48.  
  49. statusMessage = "| |"
  50.  
  51. while true do
  52. clear()
  53. cPrint("+-------------------+", 3)
  54. cPrint(statusMessage, 4)
  55. cPrint("| Username: |", 5)
  56. cPrint("| Password: |", 6)
  57. cPrint("| |", 7)
  58. cPrint("+-------------------+", 8)
  59.  
  60. str = "| Username: |"
  61. map = w/2-#str/2+string.len("| Username: ")
  62. term.setCursorPos(map, 5)
  63. username = read()
  64. term.setCursorPos(map, 6)
  65. password = read()
  66.  
  67. if selection == 1 then
  68. rednet.send(bankID, "VERIFY:" ..username.. ":" ..password)
  69. repeat
  70. id, message = rednet.receive()
  71. until id == bankID
  72.  
  73. if message == "Correct" then
  74. break
  75. else
  76. statusMessage = "| Login failed. |"
  77. end
  78. else
  79. break
  80. end
  81. end
  82.  
  83. if username == "" and password == "" then
  84. clear()
  85. print(os.version().." - Paypal crashed... CUZ OF U! >:O (fixing...)")
  86. shell.exit()
  87. else
  88. if selection == 94897983697 then
  89. rednet.send(bankID, "NEW:" ..username.. ":" ..password)
  90. end
  91.  
  92. function updateBalance()
  93. rednet.send(bankID, "CHECK:" ..username)
  94. repeat
  95. id, balance = rednet.receive()
  96. until id == bankID
  97.  
  98. print("Balance: " ..balance.. "$ (CTRL = Update)")
  99. end
  100.  
  101. function hai()
  102. clear()
  103. print("Welcome, " ..username.. "!")
  104. updateBalance()
  105. for i=1,w-1 do
  106. write("-")
  107. end
  108.  
  109. print("Recent Actions: ")
  110. print("<Coming Soon>\n")
  111. print("Press Enter to donate.")
  112. while true do
  113. event, key = os.pullEvent("key")
  114. if key == 29 then
  115. hai()
  116. elseif key == 28 then
  117. donate()
  118. end
  119. end
  120. end
  121.  
  122. function donate()
  123. clear()
  124. write("Who would you like to donate to? ")
  125. input = read()
  126. write("How much would you like to donate? $")
  127. test = read()
  128.  
  129. --GIVE:<YOUR NAME>:<YOUR PASS>:<HOW MUCH U WANNA GIVE TO...>:<YOUR FRIEND>
  130. rednet.send(bankID, "GIVE:" ..username.. ":" ..password.. ":" ..test.. ":" ..input)
  131. hai()
  132. end
  133.  
  134. hai()
  135. end
Advertisement
Add Comment
Please, Sign In to add comment