Rewritten code, removed unnecessary code, fixes

bugfixes
+ Fixed a bug where you could spam the daily reward by closing and opening the window
/ Rebalanced slots
/ Rewritten code
This commit is contained in:
Xameren 2024-12-04 15:37:34 +01:00 committed by GitHub
parent a91a49af93
commit 8fe2e78103
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

311
Casino.py
View file

@ -18,7 +18,7 @@ RouletteWheelColors = ["🟩", "🟥", "⬛", "🟥", "⬛", "🟥", "⬛", "
RouletteRed = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36] RouletteRed = [1, 3, 5, 7, 9, 12, 14, 16, 18, 19, 21, 23, 25, 27, 30, 32, 34, 36]
RouletteBlack = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35] RouletteBlack = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35]
SlotSymbols = ["", "🍒", "🍒", "🔔", "🔔", "🍋", "🍋", "💎"] # Intended for Slot Mashines SlotSymbols = ["", "🍒", "🔔", "🍋", "", "🍒", "🔔", "🍋", "💎"] # Intended for Slot Mashines
# Keno. No list to implement # Keno. No list to implement
# Horse betting. No list to implement # Horse betting. No list to implement
@ -34,7 +34,6 @@ dailyrewardlistXP = [75, 100, 125, 150]
money = 1000 money = 1000
merry_christmas = True merry_christmas = True
username = "N/A" username = "N/A"
xp = 0 xp = 0
xptoreachbase = 100 xptoreachbase = 100
@ -86,6 +85,14 @@ def Stats():
def Roulette(): def Roulette():
global money, wins_roulette, xp global money, wins_roulette, xp
def WinRoulette(winmultiplier, winxp):
global money, wins_roulette, xp
money += bet_roulette*winmultiplier
print("You won ", bet_roulette*winmultiplier, " dollars ")
wins_roulette += 1
print(f"You gained {winxp} XP ")
xp += winxp
def is_odd(number): def is_odd(number):
return number % 2 != 0 return number % 2 != 0
@ -208,18 +215,12 @@ def Roulette():
result = 0 result = 0
result_color = str(RouletteWheelColors[start_index+2:start_index+3]).translate(translationtable) result_color = str(RouletteWheelColors[start_index+2:start_index+3]).translate(translationtable)
# Now, there might be a better way to implement this. # Holy Yandere Dev.
# Now, I dont want to search for a better way to do this.
# Now, enjoy this Yandere Dev teir code.
try: try:
if -1 < int(userinputroulette) < 37: if -1 < int(userinputroulette) < 37:
if int(userinputroulette) == result: if int(userinputroulette) == result:
print("You won ", bet_roulette*5, " dollars ") WinRoulette(5, 50)
money += bet_roulette*5
wins_roulette += 1
print("You gained 50 XP ")
xp += 50
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
except ValueError: except ValueError:
@ -227,82 +228,46 @@ def Roulette():
if result == 0: if result == 0:
try: try:
if int(userinputroulette) == result: if int(userinputroulette) == result:
print("You won ", bet_roulette*10, " dollars ") WinRoulette(10, 75)
money += bet_roulette*10
wins_roulette += 1
print("You gained 75 XP ")
xp += 75
except ValueError: except ValueError:
if userinputroulette == "odd": if userinputroulette == "odd":
print("You won ", bet_roulette*2, " dollars ") WinRoulette(2, 15)
money += bet_roulette*2
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "1st12": elif userinputroulette == "1st12":
if result < 13: if result < 13:
print("You won ", bet_roulette*2, " dollars ") WinRoulette(2, 15)
money += bet_roulette*2
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "2nd12": elif userinputroulette == "2nd12":
if 12 < result < 25: if 12 < result < 25:
print("You won ", bet_roulette*2, " dollars ") WinRoulette(2, 15)
money += bet_roulette*2
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "3rd12": elif userinputroulette == "3rd12":
if 24 < result: if 24 < result:
print("You won ", bet_roulette*2, " dollars ") WinRoulette(2, 15)
money += bet_roulette*2
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "odd": elif userinputroulette == "odd":
if is_odd(result): if is_odd(result):
print("You won ", bet_roulette*2, " dollars ") WinRoulette(2, 15)
money += bet_roulette*2
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "even": elif userinputroulette == "even":
if is_odd(result): if is_odd(result):
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
else: else:
money += bet_roulette*2 WinRoulette(2, 15)
print("You won ", bet_roulette*2, " dollars ")
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
elif userinputroulette == "black": elif userinputroulette == "black":
if result_color == "": if result_color == "":
money += bet_roulette*2 WinRoulette(2, 15)
print("You won ", bet_roulette*2, " dollars ")
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
elif userinputroulette == "red": elif userinputroulette == "red":
if result_color == "🟥": if result_color == "🟥":
money += bet_roulette*2 WinRoulette(2, 15)
print("You won ", bet_roulette*2, " dollars ")
wins_roulette += 1
print("You gained 15 XP ")
xp += 15
else: else:
print("You lost ", bet_roulette, " dollars ") print("You lost ", bet_roulette, " dollars ")
@ -359,72 +324,59 @@ def Slots():
random_time = random.randint(20,25) random_time = random.randint(20,25)
def menu(decor = "==", decor2 = "==", decor3 = "=="):
print(f"+={decor}==={decor2}==={decor3}=+\n| {slot_one} | {slot_two} | {slot_three} |\n+={decor}==={decor2}==={decor3}=+")
for _ in range(random_time): for _ in range(random_time):
print("\033[H", end="") print("\033[H", end="")
print("+==============+") menu()
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+==============+")
slot_one = random.choice(SlotSymbols) slot_one = random.choice(SlotSymbols)
slot_two = random.choice(SlotSymbols) slot_two = random.choice(SlotSymbols)
slot_three = random.choice(SlotSymbols) slot_three = random.choice(SlotSymbols)
time.sleep(0.25) time.sleep(0.25)
for _ in range(5): for _ in range(5):
print("\033[H", end="") print("\033[H", end="")
print("+=##===========+") menu("##")
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+=##===========+")
slot_two = random.choice(SlotSymbols) slot_two = random.choice(SlotSymbols)
slot_three = random.choice(SlotSymbols) slot_three = random.choice(SlotSymbols)
time.sleep(0.25) time.sleep(0.25)
for _ in range(5): for _ in range(5):
print("\033[H", end="") print("\033[H", end="")
print("+=##===##======+") menu("##", "##")
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+=##===##======+")
slot_three = random.choice(SlotSymbols) slot_three = random.choice(SlotSymbols)
time.sleep(0.25) time.sleep(0.25)
print("\033[H", end="") print("\033[H", end="")
print("+=##===##===##=+") menu("##", "##", "##")
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+=##===##===##=+")
time.sleep(0.25) time.sleep(0.25)
def win_slots(slot): def win_slots(slot):
global money,xp, wins_slots global money,xp, wins_slots, xpwin, youwon
decor_value = 1 decor_value = 1
xpwin = 0 xpwin = 0
def win_win_slots(winmultiplier, winxp):
global money,xp, wins_slots, xpwin, youwon
money += bet_slots*winmultiplier
youwon = bet_slots*winmultiplier
xpwin += winxp
if slot == "🍒": if slot == "🍒":
money += bet_slots*1.25 win_win_slots(1.25, 3)
youwon = bet_slots*1.25
xpwin += 3
elif slot == "🍋": elif slot == "🍋":
money += bet_slots*1.5 win_win_slots(1.5, 4)
youwon = bet_slots*1.5
xpwin += 4
elif slot == "🔔": elif slot == "🔔":
money += bet_slots*1.75 win_win_slots(1.75, 5)
youwon = bet_slots*1.75
xpwin += 5
elif slot == "💎": elif slot == "💎":
money += bet_slots*2 win_win_slots(2, 10)
youwon = bet_slots*2
xpwin += 10
elif slot == "🍒2": elif slot == "🍒2":
money += bet_slots*3 win_win_slots(3, 10)
youwon = bet_slots*3
xpwin += 10
elif slot == "🍋2": elif slot == "🍋2":
money += bet_slots*4 win_win_slots(4, 15)
youwon = bet_slots*4
xpwin += 15
elif slot == "🔔2": elif slot == "🔔2":
money += bet_slots*5 win_win_slots(5, 20)
youwon = bet_slots*5
xpwin += 20
elif slot == "💎2": elif slot == "💎2":
money += bet_slots*10 win_win_slots(10, 25)
youwon = bet_slots*10
xpwin = 25
else: else:
print("som mes up") print("som mes up")
for _ in range(12): for _ in range(12):
@ -434,19 +386,16 @@ def Slots():
decor_3 = "\\" decor_3 = "\\"
if decor_value == 1 or decor_value == 4 or decor_value == 7 or decor_value == 10: if decor_value == 1 or decor_value == 4 or decor_value == 7 or decor_value == 10:
decor_print = decor_1 decor_print = decor_1
decor_value += 1
elif decor_value == 2 or decor_value == 5 or decor_value == 8 or decor_value == 11: elif decor_value == 2 or decor_value == 5 or decor_value == 8 or decor_value == 11:
decor_print = decor_2 decor_print = decor_2
decor_value += 1
else: else:
decor_print = decor_3 decor_print = decor_3
decor_value += 1 decor_value += 1
print("\033[H", end="") print("\033[H", end="")
print("+=##===##===##=+") menu("##", "##", "##")
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+=##===##===##=+")
print(decor_print, " You won ", youwon, " dollars ", decor_print) print(decor_print, " You won ", youwon, " dollars ", decor_print)
print(decor_print, " You gained ", xpwin," XP ", decor_print) print(decor_print, " You gained ", xpwin," XP ", decor_print)
time.sleep(0.15)
xp += xpwin xp += xpwin
time.sleep(0.2) time.sleep(0.2)
@ -454,44 +403,30 @@ def Slots():
def lost_slots(): def lost_slots():
decor_value = 1 decor_value = 1
end_screen1 = f"x=##===##===##=x\n| {slot_one} | {slot_two} | {slot_three} |\nx=##===##===##=x\n\\ You lost , {bet_slots}, dollars /"
end_screen2 = f"+=##===##===##=+\n| {slot_one} | {slot_two} | {slot_three} |\n+=##===##===##=+\n You lost , {bet_slots}, dollars "
for _ in range(7): for _ in range(7):
if decor_value == 1: if decor_value == 1:
print("\033[H", end="") print("\033[H", end="")
print("x=##===##===##=x") print(end_screen1)
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("x=##===##===##=x")
print("\\ You lost ", bet_slots, " dollars /")
decor_value += 1 decor_value += 1
else: else:
print("\033[H", end="") print("\033[H", end="")
print("+=##===##===##=+") print(end_screen2)
print(f"| {slot_one} | {slot_two} | {slot_three} |")
print("+=##===##===##=+")
print(" You lost ", bet_slots, " dollars ")
decor_value -= 1 decor_value -= 1
time.sleep(0.5) time.sleep(0.5)
if slot_one == slot_two or slot_one == slot_three or slot_two == slot_three: if slot_one == slot_two or slot_one == slot_three or slot_two == slot_three:
if slot_one == slot_two == slot_three: if slot_one == slot_two == slot_three:
if slot_two == "🍒": if slot_two != "":
win_slots("🍒2") win_slots(f"{slot_two}2")
elif slot_two == "🍋":
win_slots("🍋2") elif slot_one == "" and slot_two == "" or slot_two == "" and slot_three == "" or slot_three == "" and slot_one == "":
elif slot_two == "🔔":
win_slots("🔔2")
elif slot_two == "💎":
win_slots("💎2")
elif slot_one == "" and slot_two == "" or slot_two == "" and slot_three == "":
lost_slots() lost_slots()
else: else:
if slot_one == "🍒": if slot_two != "":
win_slots("🍒") win_slots(f"{slot_two}")
elif slot_one == "🍋":
win_slots("🍋")
elif slot_one == "🔔":
win_slots("🔔")
elif slot_one == "💎":
win_slots("💎")
else: else:
lost_slots() lost_slots()
time.sleep(2) time.sleep(2)
@ -505,7 +440,6 @@ def Keno():
print(f"\nCurrent balance: {money}") print(f"\nCurrent balance: {money}")
print("Enter your bet or say \"Payout\" for the payout table") print("Enter your bet or say \"Payout\" for the payout table")
# Picks: {mistake count: multiplier, mistake count: multiplier, mistake count: multiplier, mistake count: multiplier, } # Picks: {mistake count: multiplier, mistake count: multiplier, mistake count: multiplier, mistake count: multiplier, }
payout_keno = { payout_keno = {
1: {0: 1.5}, 1: {0: 1.5},
@ -577,7 +511,6 @@ def Keno():
if a not in NumbersPicked: if a not in NumbersPicked:
NumbersPicked.append(a) NumbersPicked.append(a)
break break
test = str(NumbersPicked)
print("\033[H", end="") print("\033[H", end="")
print("Numbers which you have picked: [", user_input_keno, "]") print("Numbers which you have picked: [", user_input_keno, "]")
print("Numbers randomally chosen: ", NumbersPicked) print("Numbers randomally chosen: ", NumbersPicked)
@ -594,7 +527,6 @@ def Keno():
payout_for_num_picks = payout_keno.get(num_picks, {}) payout_for_num_picks = payout_keno.get(num_picks, {})
reward_multiplier = payout_for_num_picks.get(num_mistakes, 0) reward_multiplier = payout_for_num_picks.get(num_mistakes, 0)
money += bet_keno_int * reward_multiplier money += bet_keno_int * reward_multiplier
print("You won ", bet_keno_int*reward_multiplier, " dollars") print("You won ", bet_keno_int*reward_multiplier, " dollars")
@ -610,16 +542,27 @@ def Keno():
def HorseBettin(): def HorseBettin():
global money, wins_horsebetting, xp global money, wins_horsebetting, xp
def winhorsebetting(horseinput, randfloat, horsiewinner):
global money, wins_horsebetting, xp
money += round((horseinput*randfloat), 0)
wins_horsebetting += 1
xp += 15
print(f"# {horsiewinner} won the race! #")
print("You won ", horseinput*randfloat, " dollars")
print("You gained 15 XP ")
def losehorsebetting(horseinput, horsiewinner):
global money
money -= horseinput
print(f"\\ {horsiewinner} won the race! /")
print(f"You lost {horseinput} dollars")
round(money, 0)
print("\033[H\033[J", end="") print("\033[H\033[J", end="")
round(money, 0) round(money, 0)
Horse1progressleft = "" Horse1progressleft = Horse2progressleft = Horse3progressleft = Horse4progressleft = ""
Horse1progressright = "-------------------------------------------------" Horse1progressright= Horse2progressright= Horse3progressright= Horse4progressright = "-------------------------------------------------"
Horse2progressleft = ""
Horse2progressright = "-------------------------------------------------"
Horse3progressleft = ""
Horse3progressright = "-------------------------------------------------"
Horse4progressleft = ""
Horse4progressright = "-------------------------------------------------"
random_float_1 = round(random.uniform(1, 2), 2) random_float_1 = round(random.uniform(1, 2), 2)
random_float_2 = round(random.uniform(1, 2), 2) random_float_2 = round(random.uniform(1, 2), 2)
@ -695,70 +638,37 @@ def HorseBettin():
horsiewinner == "Horse 1" horsiewinner == "Horse 1"
print("# Horse 1 won the race! #") print("# Horse 1 won the race! #")
if horsiechooseinput == 1: if horsiechooseinput == 1:
money += round(horsiebetinput*random_float_1, 0) winhorsebetting(horsiebetinput, random_float_1, "Horse 1")
wins_horsebetting += 1
round(money, 0)
print("You won ", horsiebetinput*random_float_1, " dollars")
print("You gained 15 XP ")
xp += 15
break break
else: else:
money -= horsiebetinput losehorsebetting(horsiebetinput, "Horse 1")
print("You lost ", horsiebetinput, " dollars")
round(money, 0)
break break
if Horse2progressright == "": if Horse2progressright == "":
horsiewinner == "Horse 2" horsiewinner == "Horse 2"
print("# Horse 2 won the race! #")
if horsiechooseinput == 2: if horsiechooseinput == 2:
money += round(horsiebetinput*random_float_2+0.15) winhorsebetting(horsiebetinput, random_float_2+0.15, "Horse 2")
wins_horsebetting += 1
print("You won ", horsiebetinput*random_float_2+0.15, " dollars")
print("You gained 15 XP ")
xp += 15
round(money, 0)
break break
else: else:
money -= horsiebetinput losehorsebetting(horsiebetinput, "Horse 2")
print("You lost ", horsiebetinput, " dollars")
round(money, 0)
break break
if Horse3progressright == "": if Horse3progressright == "":
horsiewinner == "Horse 3" horsiewinner == "Horse 3"
print("# Horse 3 won the race! #")
if horsiechooseinput == 3: if horsiechooseinput == 3:
money += round(horsiebetinput*random_float_1+0.15) winhorsebetting(horsiebetinput, random_float_1+0.15, "Horse 3")
wins_horsebetting += 1
print("You won ", horsiebetinput*random_float_1+0.15, " dollars")
print("You gained 15 XP ")
xp += 15
round(money, 0)
break break
else: else:
money -= horsiebetinput losehorsebetting(horsiebetinput, "Horse 3")
print("You lost ", horsiebetinput, " dollars")
round(money, 0)
break break
if Horse4progressright == "": if Horse4progressright == "":
horsiewinner == "Horse 4" horsiewinner == "Horse 4"
print("# Horse 4 won the race! #")
if horsiechooseinput == 4: if horsiechooseinput == 4:
money += round(horsiebetinput*random_float_2) winhorsebetting(horsiebetinput, random_float_2, "Horse 4")
wins_horsebetting += 1
print("You won ", horsiebetinput*random_float_2, " dollars")
print("You gained 15 XP ")
xp += 15
round(money, 0)
break break
else: else:
money -= horsiebetinput losehorsebetting(horsiebetinput, "Horse 4")
print("You lost ", horsiebetinput, " dollars")
round(money, 0)
break break
round(money, 0) round(money, 0)
print("Your current balance:", money) print("Your current balance:", money)
@ -799,7 +709,6 @@ def CasinoWar():
print("Please choose 'Y' or 'N'.") print("Please choose 'Y' or 'N'.")
print("\033[H\033[J", end="") print("\033[H\033[J", end="")
picked_card_player = random.choice(list(cards.keys())) picked_card_player = random.choice(list(cards.keys()))
picked_card_dealer = random.choice(list(cards.keys())) picked_card_dealer = random.choice(list(cards.keys()))
@ -818,7 +727,6 @@ def CasinoWar():
time.sleep(1) time.sleep(1)
if card_value_player > card_value_dealer: if card_value_player > card_value_dealer:
print(f"= You won {bet} dollars =") print(f"= You won {bet} dollars =")
money += bet money += bet
@ -882,6 +790,17 @@ def CasinoWar():
def Coinflip(): def Coinflip():
global money, wins_coinflip, xp global money, wins_coinflip, xp
def coinflipwin(b):
global money, wins_coinflip, xp
money = money+(b*2)
wins_coinflip += 1
print("You won ", b, "dollars!")
print("You gained 10 XP ")
xp += 10
def coinfliplose(b):
global money
money = money-b
print("You lost", b, "dollars!")
print("\033[H\033[J", end="") print("\033[H\033[J", end="")
round(money, 0) round(money, 0)
print("🪙 Welcome to coinflip 🪙") print("🪙 Welcome to coinflip 🪙")
@ -909,11 +828,8 @@ def Coinflip():
if leave != True: if leave != True:
stringeffect = "" stringeffect = stringeffect2 = result = ""
stringeffect2 = "" count = speed = 0
count = 0
speed = 0
result = ""
while count < random.randint(9,10): while count < random.randint(9,10):
print("\033[H\033[J", end="") print("\033[H\033[J", end="")
print(stringeffect + "Tossing..." + stringeffect2) print(stringeffect + "Tossing..." + stringeffect2)
@ -932,31 +848,15 @@ def Coinflip():
time.sleep(speed) time.sleep(speed)
if result == "heads": if result == "heads":
if a == 1: if a == 1:
money = money+(b*2) coinflipwin(b)
print("You won ", b, "dollars!")
print("You gained 10 XP ")
xp += 10
wins_coinflip += 1
else: else:
money = money-b coinfliplose(b)
print("You lost", b, "dollars!")
else: else:
if a == 1: if a == 1:
money = money-b coinfliplose(b)
print("You lost", b, "dollars!")
else: else:
money = money+(b*2) coinflipwin(b)
wins_coinflip += 1
print("You won ", b, "dollars!")
print("You gained 10 XP ")
xp += 10
time.sleep(2) time.sleep(2)
#HorseBettin()
#keno()
#casinowar()
#Coinflip()
#input()
def stopper(): def stopper():
global cashout, dead, coolstoppingargument global cashout, dead, coolstoppingargument
while coolstoppingargument == False: while coolstoppingargument == False:
@ -1041,6 +941,7 @@ def dailyreward():
lastrewardtime = datetime.fromisoformat(loaded_datetime["current_time"]) lastrewardtime = datetime.fromisoformat(loaded_datetime["current_time"])
except (json.JSONDecodeError, KeyError, ValueError)as e: except (json.JSONDecodeError, KeyError, ValueError)as e:
lastrewardtime = datetime(year= 2020, month= 1, day= 1, hour= 1, minute= 1, second= 1, microsecond= 1) lastrewardtime = datetime(year= 2020, month= 1, day= 1, hour= 1, minute= 1, second= 1, microsecond= 1)
timediff = currenttime - lastrewardtime timediff = currenttime - lastrewardtime
if timediff.days >= 1: if timediff.days >= 1:
print("Spin a wheel which gives you a random amount of money or XP.\nThe more levels that you have, the bigger the payout\n\nPress enter to continue") print("Spin a wheel which gives you a random amount of money or XP.\nThe more levels that you have, the bigger the payout\n\nPress enter to continue")
@ -1082,7 +983,10 @@ def dailyreward():
print(f"> {randxp*level} XP <") print(f"> {randxp*level} XP <")
time.sleep(2) time.sleep(2)
lastrewardtime = datetime.now() lastrewardtime = datetime.now()
next_reward_time = lastrewardtime + timedelta(hours=24)
formatted_next_reward_time = next_reward_time.strftime("%Y-%m-%d %H:%M:%S")
now_str = lastrewardtime.isoformat()
json_datetime = json.dumps({"current_time": now_str})
save_game() save_game()
else: else:
next_reward_time = lastrewardtime + timedelta(hours=24) next_reward_time = lastrewardtime + timedelta(hours=24)
@ -1161,10 +1065,8 @@ def CasinoMenu():
except ValueError: except ValueError:
print("Please select a valid option") print("Please select a valid option")
# This is designed for saving and loading. Remove the next 3 definitions to remove this feature, and end the script with CasinoMenu() # This is designed for saving and loading. Remove the next 3 definitions to remove this feature, and end the script with CasinoMenu()
def save_game(): def save_game():
global xptoreach, value1, legit, json_datetime, m global xptoreach, value1, legit, json_datetime, m
m = hashlib.sha256(f"{money+xp+xptoreach+level+wins_roulette+wins_slots+wins_keno+wins_casinowar+wins_coinflip+wins_crash+wins_horsebetting}".encode()) m = hashlib.sha256(f"{money+xp+xptoreach+level+wins_roulette+wins_slots+wins_keno+wins_casinowar+wins_coinflip+wins_crash+wins_horsebetting}".encode())
@ -1229,7 +1131,6 @@ def load_game():
time.sleep(3) time.sleep(3)
sys.exit() sys.exit()
if legit == False: # ): if legit == False: # ):
print("I should have allowed you to change the odds \nof the games in the save file aswell, eh?") print("I should have allowed you to change the odds \nof the games in the save file aswell, eh?")
time.sleep(7) time.sleep(7)