xXm0dzXx

Untitled

Jul 16th, 2012
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. bankID = 217
  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:lotftw123:" ..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:lotftw123:" ..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 = tonumber(read())
  65.  
  66. rednet.send(bankID, "VERIFY:" ..username.. ":" ..password)
  67. repeat
  68. id, message = rednet.receive()
  69. until id == bankID
  70.  
  71. if message == "Correct" then else
  72. print("Unknown username/password.")
  73. sleep(1)
  74. os.reboot()
  75. end
  76.  
  77. function updateBalance()
  78. rednet.send(bankID, "CHECK:" ..username)
  79. repeat
  80. id, balance = rednet.receive()
  81. until id == bankID
  82.  
  83. rednet.send(bankID, "CHECK:Lottery")
  84. repeat
  85. id, balance2 = rednet.receive()
  86. until id == bankID
  87.  
  88. print("Tokens: " ..balance.. "$")
  89. print("Jackpot: " ..balance2.. "$")
  90. print("Bet: " ..input.. "$")
  91. if tonumber(balance) < input then
  92. print("Not enough Tokens!")
  93. sleep(4)
  94. os.reboot()
  95. sleep(999)
  96. end
  97. end
  98.  
  99. function test()
  100. shell.run("clear")
  101. updateBalance()
  102. print("Press Enter to insert $" ..input)
  103. random1 = 0
  104. random2 = 0
  105. random3 = 0
  106. print("+-+-+-+")
  107. print("|" ..random1.. "|" ..random2.. "|" ..random3.. "|")
  108. print("+-+-+-+")
  109. print("1 = 100$, 2 = 200$, 3 = 300$, etc...")
  110. print("7 = jackpot")
  111. repeat
  112. event, key = os.pullEvent("key")
  113. until key == 28
  114.  
  115. a()
  116.  
  117. end
  118.  
  119. test()
  120. end
  121.  
  122. lottery()
Advertisement
Add Comment
Please, Sign In to add comment