xXm0dzXx

Untitled

Jul 16th, 2012
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. bankID = 102
  4. rednet.open("back")
  5.  
  6. function a()
  7. shell.run("clear")
  8. rednet.send(bankID, "GIVE:" ..username.. ":" ..password.. ":"..input..":Lottery")
  9. updateBalance()
  10. print("Press Enter to insert $" ..input)
  11.  
  12. random1 = math.random(1,7)
  13. random2 = math.random(1,7)
  14. if math.random(1, 10) == 8 and math.random(1, 12) == 3 then
  15. random3 = math.random(1,7)
  16. elseif input > 100 then
  17. random3 = math.random(4,7)
  18. else
  19. random3 = math.random(1,6)
  20. end
  21. print("+-+-+-+")
  22. print("|" ..random1.. "|" ..random2.. "|" ..random3.. "|")
  23. print("+-+-+-+")
  24. if random1 == random2 and random2 == random3 then
  25. if random1 == 7 then
  26. textutils.slowPrint("Jackpot!")
  27. textutils.slowPrint("You got $" ..balance2)
  28. textutils.slowPrint("Transfering money...")
  29. sleep(1)
  30. rednet.send(bankID, "GIVE:Lottery:a9e908ha0he09gh09a09gj09je0a9jrg:" ..balance2.. ":" ..username)
  31. print("Done!")
  32. else
  33. wort = random1 * 100
  34. if tonumber(balance2) < wort then --If we dont have enough money then...
  35. wort = balance2
  36. print("We ran out a money, here is: ")
  37. end
  38.  
  39. print("You got $" ..wort)
  40. rednet.send(bankID, "GIVE:Lottery:a9e908ha0he09gh09a09gj09je0a9jrg:" ..wort.. ":" ..username)
  41. end
  42.  
  43. sleep(3)
  44. else
  45. print("Nothing... :C")
  46. end
  47.  
  48. print("Press any key to reboot...")
  49. print("Press any enter to restart")
  50. event, key = os.pullEvent("key")
  51. if key == 28 then
  52. return a()
  53. end
  54. os.reboot()
  55. end
  56.  
  57. function lottery()
  58. print("Please login to your paypal: ")
  59. write("Username: ")
  60. username = read()
  61. write("Password: ")
  62. password = read("*")
  63. write("Bet: $")
  64. input = read()
  65. debug = 10
  66. if username == "" or password == "" or input == "" then
  67. print("Please fill in all areas.")
  68. sleep(1)
  69. os.reboot()
  70. end
  71.  
  72. input = tonumber(input)
  73.  
  74. if input < 2 then
  75. print("You have to bet over 2$")
  76. sleep(1)
  77. os.reboot()
  78. elseif((input + debug) < debug)then
  79. print("You have to bet over 2$")
  80. sleep(1)
  81. os.reboot()
  82. end
  83.  
  84. rednet.send(bankID, "VERIFY:" ..username.. ":" ..password)
  85. repeat
  86. id, message = rednet.receive()
  87. until id == bankID
  88.  
  89. if message == "Correct" then else
  90. print("Unknown username/password.")
  91. sleep(1)
  92. os.reboot()
  93. end
  94.  
  95. function updateBalance()
  96. rednet.send(bankID, "CHECK:" ..username)
  97. repeat
  98. id, balance = rednet.receive()
  99. until id == bankID
  100.  
  101. rednet.send(bankID, "CHECK:Lottery")
  102. repeat
  103. id, balance2 = rednet.receive()
  104. until id == bankID
  105.  
  106. print("Tokens: " ..balance.. "$")
  107. print("Jackpot: " ..balance2.. "$")
  108. print("Bet: " ..input.. "$")
  109. if tonumber(balance) < input then
  110. print("Not enough Tokens!")
  111. sleep(4)
  112. os.reboot()
  113. sleep(999)
  114. end
  115. end
  116.  
  117. function test()
  118. shell.run("clear")
  119. updateBalance()
  120. print("Press Enter to insert $" ..input)
  121. random1 = 0
  122. random2 = 0
  123. random3 = 0
  124. print("+-+-+-+")
  125. print("|" ..random1.. "|" ..random2.. "|" ..random3.. "|")
  126. print("+-+-+-+")
  127. print("1 = 100$, 2 = 200$, 3 = 300$, etc...")
  128. print("7 = jackpot")
  129. repeat
  130. event, key = os.pullEvent("key")
  131. until key == 28
  132.  
  133. a()
  134.  
  135. end
  136.  
  137. test()
  138. end
  139.  
  140. lottery()
Advertisement
Add Comment
Please, Sign In to add comment