Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Debug Mode Toggle 1/0
- debug = 0
- -- Y variable override - only works when in debug mode
- dY = 0
- -- Credit Variable - Leave it at 0 unless you are debugging or want to give out free plays for a while
- credits = 0
- -- Credits needed to complete the bet, used when the purchase credits screen pops up
- neededCred = 0
- -- Credit Screen Lock - triggers if not enough credits to cover the bet(s) were purchased
- credLock = 0
- -- Check for credit system, leave this alone
- check = 0
- -- Bet Variables
- -- Bet on red
- redBet = 0
- -- Bet on black
- blackBet = 0
- -- Bet on even
- evenBet = 0
- -- Bet on odd
- oddBet = 0
- -- Bet on 1st 12s
- bet112 = 0
- -- Bet on 2nd 12s
- bet212 = 0
- -- Bet on 3rd 12s
- bet312 = 0
- -- Total bet balance
- tBet = 0
- mon = peripheral.wrap("right")
- -- Scale 2: 14 Chars - Scale 3: 10 Chars
- mon.setTextScale(2)
- while true do
- -- Payment System disabled during testing phase
- -- Light Gray - End Cashout
- -- Magenta - Payment Screen Probe (from payment kiosk) - Input
- -- White - Payment Screen Confirmation - Output
- --[[
- payScreen = function()
- -- Checks for credits
- term.redirect(mon)
- if credits == 0 then
- while check == 0 do
- term.setBackgroundColor(colors.green)
- term.clear()
- term.setCursorPos(10,8)
- print("Please Purchase Credits")
- term.setCursorPos(10,9)
- print("Press the button when finished")
- term.setCursorPos(10,10)
- print("Credits Purchased: "..credits.." credits")
- if neededCred == 0 then
- sleep(0.1)
- credLock = 0
- elseif neededCred < credits then
- print("Credits Needed: " .. neededCred .. " credits")
- print("Sufficient Credits purchased")
- credLock = 0
- else
- print("Credits Needed: " .. neededCred .. " credits")
- print("Insufficient Credits to cover your bet(s)")
- print("Please purchase more credits")
- credLock = 1
- end
- local event = os.pullEvent("redstone")
- if rs.testBundledInput("back", colors.purple) == true then
- check = 1
- end
- if rs.testBundledInput("back", colors.lime) == true then
- credits = credits + 1
- elseif rs.testBundledInput("back", colors.green) == true then
- credits = credits + 5
- elseif rs.testBundledInput("back", colors.gray) == true then
- credits = credits + 10
- elseif rs.testBundledInput("back", colors.blue) == true then
- credits = credits + 50
- elseif rs.testBundledInput("back", colors.orange) == true then
- credits = credits + 100
- elseif rs.testBundledInput("back", colors.brown) == true then
- credits = credits + 500
- elseif rs.testBundledInput("back", colors.red) == true then
- credits = credits + 1000
- elseif rs.testBundledInput("back", colors.cyan) == true then
- credits = credits + 5000
- elseif rs.testBundledInput("back", colors.pink) == true then
- credits = credits + 10000
- end
- sleep(0.1)
- end
- end
- if credits == 0 then
- print("No credits purchased! Rebooting...")
- sleep(3)
- os.reboot()
- end
- term.restore()
- end
- payScreen(0)
- ]]--
- -- Wheel Data, this is so the wheel looks like the real deal in terms of number placement
- wheelDat = { 0, 32, 15, 19, 4, 21, 2, 25, 17, 34, 6, 27, 13, 36, 11, 30, 8, 23, 10, 5, 24, 16, 33, 1, 20, 14, 31, 9, 22, 18, 29, 7, 28, 12, 35, 3, 26}
- -- Timer Variable
- x = 0.1
- -- Roulette Numbers
- y = 1
- y1 = 0
- y2 = 0
- y3 = 0
- y4 = 0
- -- Timer Hold Variable
- z = math.random(72,200)
- -- Bets Code
- -- Generates table for bets on specific numbers
- wipeBets = function()
- numBets = 0
- numBets = {}
- for i = 0, 36 do
- numBets[i] = "0"
- if debug == 1 then
- print(numBets[i])
- end
- end
- -- Bet on red
- redBet = 0
- -- Bet on black
- blackBet = 0
- -- Bet on even
- evenBet = 0
- -- Bet on odd
- oddBet = 0
- -- Bet on 1st 12s
- bet112 = 0
- -- Bet on 2nd 12s
- bet212 = 0
- -- Bet on 3rd 12s
- bet312 = 0
- -- Total bet balance
- tBet = 0
- if debug == 1 then
- print("Bet data wiped. Ready for new bets!")
- sleep(2)
- end
- end
- -- "Wheel" Code
- term.setBackgroundColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Roulette V1 - by Rolcam \n ")
- print("Spinning the wheel...")
- print("Check the monitor")
- while x < 1.6 do
- mon.setBackgroundColor(colors.blue)
- mon.clear()
- mon.setCursorPos(7,1)
- -- V is the "Ball"/Pointer - Keep this on the middle number
- -- ##X##X##X##X##
- mon.write("V")
- -- Assigns the value of y - the # the "ball" is currently on top of
- if y < 37 then
- y = y + 1
- else
- y = 1
- end
- -- Assigns the value of y1 - The # that goes before y2 - 2 before y
- if y == 1 then
- y1 = 36
- elseif y == 2 then
- y1 = 37
- else
- y1 = y - 2
- end
- -- Assigns the value of y2 - The # that goes before y1
- if y == 1 then
- y2 = 37
- else
- y2 = y - 1
- end
- -- Assigns the value of y3 - The # that goes after y
- if y == 37 then
- y3 = 1
- else
- y3 = y + 1
- end
- -- Assigns the value of y4 - The # that goes after y3 - 2 after y
- if y == 37 then
- y4 = 2
- elseif y == 36 then
- y4 = 1
- else
- y4 = y + 2
- end
- -- Prints the "Wheel"
- if y1 == 1 then
- mon.setBackgroundColor(colors.green)
- elseif y1 % 2 == 0 then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.black)
- end
- mon.setCursorPos(1,2)
- mon.write(tostring(wheelDat[y1]))
- if y2 == 1 then
- mon.setBackgroundColor(colors.green)
- elseif y2 % 2 == 0 then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.black)
- end
- mon.setCursorPos(4,2)
- mon.write(tostring(wheelDat[y2]))
- if y == 1 then
- mon.setBackgroundColor(colors.green)
- elseif y % 2 == 0 then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.black)
- end
- mon.setCursorPos(7,2)
- mon.write(tostring(wheelDat[y]))
- if y3 == 1 then
- mon.setBackgroundColor(colors.green)
- elseif y3 % 2 == 0 then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.black)
- end
- mon.setCursorPos(10,2)
- mon.write(tostring(wheelDat[y3]))
- if y4 == 1 then
- mon.setBackgroundColor(colors.green)
- elseif y4 % 2 == 0 then
- mon.setBackgroundColor(colors.red)
- else
- mon.setBackgroundColor(colors.black)
- end
- mon.setCursorPos(13,2)
- mon.write(tostring(wheelDat[y4]))
- sleep(x)
- if z > 0 then
- z = z - 1
- else
- x = x + 0.1
- end
- end
- mon.setBackgroundColor(colors.blue)
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,4)
- mon.write("Spin Complete")
- mon.setCursorPos(1,5)
- mon.write("Check Computer")
- -- Display (Computer) Code
- term.setBackgroundColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- term.setTextColor(colors.white)
- print("Roulette V1 - by Rolcam \n ")
- print("Ball landed on: ")
- -- Checks if the number is even or odd
- if y == 1 then
- eoVar = "Zero"
- rbVar = "Green"
- term.setTextColor(colors.green)
- elseif wheelDat[y] % 2 == 0 then
- eoVar = "Even"
- term.setTextColor(colors.red)
- else
- eoVar = "Odd"
- term.setTextColor(colors.black)
- end
- if y == 1 then
- eoVar = "Zero"
- rbVar = "Green"
- term.setTextColor(colors.green)
- elseif wheelDat[y] % 2 == 0 then
- rbVar = "Red"
- term.setTextColor(colors.red)
- else
- rbVar = "Black"
- term.setTextColor(colors.black)
- end
- -- Checks if the number is high or low
- if y == 1 then
- twlvVar = 0
- elseif 1 < y and y < 14 then
- twlvVar = 1
- elseif 13 < y and y < 26 then
- twlvVar = 2
- else
- twlvVar = 3
- end
- if y == 1 then
- hlVar = "N/A"
- elseif y > 19 then
- hlVar = "High"
- else
- hlVar = "Low"
- end
- term.setCursorPos(17,3)
- if y == 1 then
- print(wheelDat[y] .. " Zero")
- else
- print(wheelDat[y] .. " " .. rbVar)
- end
- if y == 1 then
- term.setTextColor(colors.white)
- print(" \n Payouts:")
- print("Bet on 0: 36x")
- print("Bet on Even: 0.5x - La Partage")
- print("All else: No win")
- else
- term.setTextColor(colors.white)
- print(" \nPayout Rates:")
- print("Bet on " .. wheelDat[y] .. ": 36x")
- if eoVar == "Odd" then
- print("Bet on Odd: 2x")
- else
- print("Bet on Even: 2x")
- end
- if rbVar == "Black" then
- print("Bet on Black: 2x")
- else
- print("Bet on White: 2x")
- end
- if hlVar == "High" then
- print("Bet on High: 2x")
- else
- print("Bet on Low: 2x")
- end
- if twlvVar == 1 then
- print("Bet on 1st 12s: 3x")
- elseif twlvVar == 2 then
- print("Bet on 2nd 12s: 3x")
- else
- print("Bet on 3rd 12s: 3x")
- end
- print("All else: No Win")
- end
- -- Bet Payment Code
- --[[
- winBal = 0
- print("Your total winnings this round are: $"..winBal)
- ]]--
- read()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement