Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.pullEvent = os.pullEventRaw
- bankID = 102
- rednet.open("back")
- function a()
- shell.run("clear")
- rednet.send(bankID, "GIVE:" ..username.. ":" ..password.. ":"..input..":Lottery")
- updateBalance()
- print("Press Enter to insert $" ..input)
- random1 = math.random(1,7)
- random2 = math.random(1,7)
- if math.random(1, 10) == 8 and math.random(1, 12) == 3 then
- random3 = math.random(1,7)
- elseif input > 100 then
- random3 = math.random(4,7)
- else
- random3 = math.random(1,6)
- end
- print("+-+-+-+")
- print("|" ..random1.. "|" ..random2.. "|" ..random3.. "|")
- print("+-+-+-+")
- if random1 == random2 and random2 == random3 then
- if random1 == 7 then
- textutils.slowPrint("Jackpot!")
- textutils.slowPrint("You got $" ..balance2)
- textutils.slowPrint("Transfering money...")
- sleep(1)
- rednet.send(bankID, "GIVE:Lottery:a9e908ha0he09gh09a09gj09je0a9jrg:" ..balance2.. ":" ..username)
- print("Done!")
- else
- wort = random1 * 100
- if tonumber(balance2) < wort then --If we dont have enough money then...
- wort = balance2
- print("We ran out a money, here is: ")
- end
- print("You got $" ..wort)
- rednet.send(bankID, "GIVE:Lottery:a9e908ha0he09gh09a09gj09je0a9jrg:" ..wort.. ":" ..username)
- end
- sleep(3)
- else
- print("Nothing... :C")
- end
- print("Press any key to reboot...")
- print("Press any enter to restart")
- event, key = os.pullEvent("key")
- if key == 28 then
- return a()
- end
- os.reboot()
- end
- function lottery()
- print("Please login to your paypal: ")
- write("Username: ")
- username = read()
- write("Password: ")
- password = read("*")
- write("Bet: $")
- input = read()
- debug = 10
- if username == "" or password == "" or input == "" then
- print("Please fill in all areas.")
- sleep(1)
- os.reboot()
- end
- input = tonumber(input)
- if input < 2 then
- print("You have to bet over 2$")
- sleep(1)
- os.reboot()
- elseif((input + debug) < debug)then
- print("You have to bet over 2$")
- sleep(1)
- os.reboot()
- end
- rednet.send(bankID, "VERIFY:" ..username.. ":" ..password)
- repeat
- id, message = rednet.receive()
- until id == bankID
- if message == "Correct" then else
- print("Unknown username/password.")
- sleep(1)
- os.reboot()
- end
- function updateBalance()
- rednet.send(bankID, "CHECK:" ..username)
- repeat
- id, balance = rednet.receive()
- until id == bankID
- rednet.send(bankID, "CHECK:Lottery")
- repeat
- id, balance2 = rednet.receive()
- until id == bankID
- print("Tokens: " ..balance.. "$")
- print("Jackpot: " ..balance2.. "$")
- print("Bet: " ..input.. "$")
- if tonumber(balance) < input then
- print("Not enough Tokens!")
- sleep(4)
- os.reboot()
- sleep(999)
- end
- end
- function test()
- shell.run("clear")
- updateBalance()
- print("Press Enter to insert $" ..input)
- random1 = 0
- random2 = 0
- random3 = 0
- print("+-+-+-+")
- print("|" ..random1.. "|" ..random2.. "|" ..random3.. "|")
- print("+-+-+-+")
- print("1 = 100$, 2 = 200$, 3 = 300$, etc...")
- print("7 = jackpot")
- repeat
- event, key = os.pullEvent("key")
- until key == 28
- a()
- end
- test()
- end
- lottery()
Advertisement
Add Comment
Please, Sign In to add comment