Question:
oh help me why are my functions crying so much OHHHH GODDDDD
Repl link:
oh its not needed: https://replit.com/@Idkwhttph/Mining-Simulator?v=1
#OOOOHHH HELP MEEEEEEEE
from termcolor import colored
from colorama import Fore as F
from colorama import Style as S
from getkey import getkey,keys
from replit import clear,db
import sys
from time import sleep
import shutil
from os import environ
import random
from random import randint as rand
from probabilities import *
import cursor
def reset():
db.clear()
try:
print(db['Text.keys']); clear()
except:
random_Chance = 0
db['Text.keys'] = 7777
db['Miners'] = 0
db['Mining_speed'] = 5
db['Sapphire'] = 0
db['Ruby'] = 0
db['emerald'] = 0
db['diamond'] = 0
db['topaz'] = 0
db['aquamarine'] = 0
db['amethyst'] = 0
db['Mining_yield'] = 2
db['multiplier'] = 1
db['rebirths'] = 0
db['Money'] = 0
db['sell_Sapphire'] = 2.4
db['sell_Ruby'] = 3.6
db['sell_emerald'] = 4.4
db['sell_diamond'] = 6.1
db['sell_topaz'] = 7
db['sell_aquamarine'] = 9.2
db['sell_amethyst'] = 12.4
db['Level'] = 0
db["OMEGA_ORE"] = 0
text_keys =7777
miners =0
mining_speed = 5
sapphire = 0
ruby =0
emerald =0
diamond =0
topaz = 0
aquamarine =0
amethyst = 0
mining_yield = 2
multiplier = 1
rebirths = 0
money = 0
level = 0
def printInMiddle(text, columns=shutil.get_terminal_size().columns):
# Get the current width of the console
console_width = columns
# Calculate the padding for the left side
padding = (console_width - len(text)) // 2 + 5
# Print the padded text
print(' ' * padding + text)
def unpack_data():
global text_keys,miners,mining_speed,sapphire,ruby,emerald,diamond,topaz,aquamarine,amethyst,mining_yield,multiplier,rebirths,money,sell_sapphire,sell_ruby,sell_emerald,sell_diamond,sell_topaz,sell_aquamarine,sell_amethyst,probability,level
text_keys = db['Text.keys']
miners = db['Miners']
mining_speed =db['Mining_speed']
sapphire = db['Sapphire']
ruby = db['Ruby']
emerald =db['emerald']
diamond =db['diamond']
topaz = db['topaz']
aquamarine = db['aquamarine']
amethyst = db['amethyst']
mining_yield = db['Mining_yield']
db['multiplier'] =(1*db['rebirths'])
multiplier = db['multiplier']
rebirths = db['rebirths']
money =db['Money']
level = db['Level']
def enter_to_continue():
print(f'{S.BRIGHT}|{F.BLUE}Enter{F.WHITE}|To Continue{S.RESET_ALL}')
input()
bright = S.BRIGHT
normal = S.NORMAL
reset = S.RESET_ALL
blue = F.BLUE
white = F.WHITE
purple = F.MAGENTA
green = F.GREEN
dim = S.DIM
red = F.RED
def reset(rebirths_selected):
global rebirthz,multiplier
rebirthz = db['rebirths']
multiplier = db['multiplier']
db.clear()
db['rebirths'] = rebirthz+rebirths_selected
db['multiplier']=(1*rebirths_selected+rebirthz)
def getinput(menu):
while True:
clear()
global opt,breaks,bright,normal,reset,blue,white,purple,green,dim,debug,text_keys,miners,mining_speed,sapphire,ruby,emerald,diamond,topaz,aquamarine,amethyst,mining_yield,multiplier,rebirths,money,sell_sapphire,sell_ruby,sell_emerald,sell_diamond,sell_topaz,sell_aquamarine,sell_amethyst,probability,money,money_2,random_Chance,buy_miner_text,buy_upgrade_text,level,Mining_1,dbug
money_2 = db['Money']
bright = S.BRIGHT
normal = S.NORMAL
reset = S.RESET_ALL
blue = F.BLUE
white = F.WHITE
purple = F.MAGENTA
green = F.GREEN
dim = S.DIM
Mining1 = 0
opt = ''
selected = 0
solution_get_input = 0
key = ""
breaks = False
if breaks == True:
break
solution_get_input = 0
selected = 0
key = ""
if money == 0:
money = 0
if rebirths == 0:
rebirths = 0
while True:
try:
cursor.hide()
printInMiddle(f'{bright}Mining_Simulator.exe')
printInMiddle(f'{bright}------------------------------------------------------------{normal}')
print('Please use the W and S keys to move UP or DOWN respectively')
printInMiddle(f'{bright}You have {purple}ƒ{money}{white} cash')
print(f'{bright}You have {purple}§{red}{rebirths}{normal}{white} Rebirths')
for i, item in enumerate(menu):
if i == selected:
print(colored(f"{bright}-> {bright}[{F.GREEN}{i if debug else i+1}{S.RESET_ALL}] {menu[i]}{normal}"))
else:
print(f" {bright}[{F.YELLOW}{i if debug else i+1}{S.RESET_ALL}] {menu[i]}{normal}")
key = getkey()
if key.isdigit():
clear()
solution_get_input = int(key)
break
elif key == keys.W:
clear()
selected = (selected - 1) % len(menu)
if selected == -1:
selected = (selected + len(menu)+1) % len(menu)
elif key == keys.S:
clear()
selected = (selected + 1) % len(menu)
if selected > len(menu):
selected = (selected - len(menu)-1) % len(menu)
elif key == "\n":
solution_get_input = selected
opt = menu[solution_get_input]
clear()
else:
clear()
clear()
cursor.show()
if opt == f'{bright}{purple}Rebirth options{white}{reset}':
while True:
rebirths = db['rebirths']
#Formula:444+(rebirths+selected_rebirths*675*1)
print('-----------------------------------------------------------------')
print(f'{bright}[{blue}1{white}] 1 Rebirth: {444+((db["rebirths"]+1)*675)} ')
print(f'{bright}[{blue}2{white}] 2 Rebirths: {444+((db["rebirths"]+2)*675)}')
print(f'{bright}Enter in the word "Back" to go back.')
selection_ = input().lower()
clear()
if selection_ == '1':
if money < 444+((db["rebirths"])+1*675*1):
rebirths_selected = 1
print('You have bought 1 rebirths, congrats!')
db['multiplier']=(1*rebirths_selected+db['rebirths'])
multiplier = db['multiplier']
break
else:
print('You do not have enough money!')
break
elif selection_ == '2':
if money < 444+((db["rebirths"])+2*675*1):
rebirths_selected = 2
print('You have bought 2 rebirths, congrats!')
db['multiplier']=(1*rebirths_selected+db['rebirths'])
multiplier = db['multiplier']
break
else:
print('You do not have enough money!')
break
elif selection_ == 'back':
print('Heading back!')
break
save()
enter_to_continue()
clear()
break
if opt == f'{bright}{purple}Mine{reset}':
clear()
cursor.hide()
print(f'{bright}{purple}Mining...{white}{normal}')
sleep(1.2*float(db['Mining_speed']))
clear()
print('Printing out results...')
if db['Miners'] >=25:
dbug = True
else:
dbug = False
sleep(3)
clear()
printInMiddle('PRINTED FROM PRINTER.EXE.FILES')
print('')
sleep(0.2)
print('Settings: Receipt mode, Fast Mode.')
sleep(0.2)
print('Printer made from France.')
sleep(0.75)
print('--------------------------------------------------')
print('FROM: MINING SIMULATOR MINING AGENCY')
sleep(0.1)
print('TO: MINING CO-OPERATION ')
sleep(2)
print('___________________________________________________')
sleep(0.2)
print('| MINING_CO-OPERATION')
sleep(0.2)
print('|')
sleep(0.2)
print('| ALL RIGHTS RESERVED')
sleep(0.2)
print('|')
sleep(0.2)
print('| MINING_RESULT_PRINTING')
sleep(0.2)
print('|')
sleep(0.2)
print('| RESULT: ')
print('|')
sleep(1)
for i in range(db['Miners']+2):
if i == db['Miners']+1:
pass
else:
if dbug:
pass
else:
sleep(0.1)
Mining_1 = rand(1,db['Mining_yield'])
ore = random.choice(probability)
random_Chance = rand(1,100)
if random_Chance<=10:
Mining_1 = rand(1,db['Mining_yield'])
ore = random.choice(probability)
if i == 0:
Mining_1 = db["Level"]+Mining_1
print(f'|{bright} You Mined An Extra {blue}{Mining_1+db["Level"]}{white} {purple}{ore}{white}')
if ore == 'Sapphire':
sapphire+=Mining_1
elif ore == 'Ruby':
ruby+=Mining_1
elif ore == 'emerald':
emerald+=Mining_1
elif ore == 'topaz':
topaz+=Mining_1
elif ore == 'diamond':
diamond+=Mining_1
elif ore == 'aquamarine':
aquamarine+=Mining_1
elif ore == 'amethyst':
amethyst+=Mining_1
else:
print(f'|{bright} Your Miners Mined An Extra {blue}{Mining_1}{white} {purple}{ore}{white}')
if ore == 'Sapphire':
sapphire+=Mining_1
elif ore == 'Ruby':
ruby+=Mining_1
elif ore == 'emerald':
emerald+=Mining_1
elif ore == 'topaz':
topaz+=Mining_1
elif ore == 'diamond':
diamond+=Mining_1
elif ore == 'aquamarine':
aquamarine+=Mining_1
elif ore == 'amethyst':
amethyst+=Mining_1
ore = random.choice(probability)
random_Chance = rand(1,100)
if i == 0:
print(f'|{bright} You Mined {blue}{Mining_1+db["Level"]}{white} {purple}{ore}{white}')
if ore == 'Sapphire':
sapphire+=Mining_1+db["Level"]
elif ore == 'Ruby':
ruby+=Mining_1+db["Level"]
elif ore == 'emerald':
emerald+=Mining_1+db["Level"]
elif ore == 'topaz':
topaz+=Mining_1+db["Level"]
elif ore == 'diamond':
diamond+=Mining_1+db["Level"]
elif ore == 'aquamarine':
aquamarine+=Mining_1+db["Level"]
elif ore == 'amethyst':
amethyst+=Mining_1+db["Level"]
if i == 0:
pass
else:
print(f'|{bright} Your Miners Mined {blue}{Mining_1}{white} {purple}{ore}{white}')
if ore == 'Sapphire':
sapphire+=Mining_1
elif ore == 'Ruby':
ruby+=Mining_1
elif ore == 'emerald':
emerald+=Mining_1
elif ore == 'topaz':
topaz+=Mining_1
elif ore == 'diamond':
diamond+=Mining_1
elif ore == 'aquamarine':
aquamarine+=Mining_1
elif ore == 'amethyst':
amethyst+=Mining_1
# db['sell_Sapphire'] = 2.4
#db['sell_Ruby'] = 3.6
#db['sell_emerald'] = 4.4
#db['sell_diamond'] = 6.1
#db['sell_topaz'] = 7
#db['sell_aquamarine'] = 9.2
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('|');sleep(0.2)
print('___________________________________________________')
print('REMARKS: Thank you for playing Mining Simulator! Enjoy the rewards!')
print('\n')
cursor.show()
save()
enter_to_continue()
clear()
break
elif opt == f'{bright}Upgrade Your Mining Tool{reset}':
buy_upgrade_text = 333+(db['Level']*555)
print(f'{bright}Do you want to upgrade your tool for {purple}ƒ{buy_upgrade_text}{white}?')
print(f'{bright}[1] Yes')
print(f'[2] No{normal}')
sssss = input()
if sssss == '1':
if money < buy_upgrade_text:
print('You do not have enough money!!!')
else:
money-=buy_upgrade_text
print(f'Your tool has upgraded from level {db["Level"]} to level {db["Level"]+1}!')
level+=1
enter_to_continue()
clear()
break
elif opt == f'{bright}Buy Miners{reset}':
clear()
sleep(0.5)
buy_miner_text = 275+(555*db['Miners'])
print('-----------------------------------------------------------------------------')
print('___MINER_SHOP.EXE___')
print(f'{bright}[1] 1 Miner : {buy_miner_text}')
print(f'[2] Back{normal}')
get_input_yes = input()
if get_input_yes == '1':
if money < buy_miner_text:
print('You do not have enough money!')
else:
money-=buy_miner_text
print(f'{bright}You bought a {blue}Miner{white}, congrats!{reset}')
db['Miners']+=1
elif get_input_yes == '2':
clear()
save()
enter_to_continue()
clear()
break
elif opt == f'{bright}{blue}Sell Ores{white}{reset}':
print(f'{bright}You sold')
sleep(0.5)
print(f"{db['Sapphire']} Sapphires");sleep(0.5)
print(f"{db['Ruby']} Ruby");sleep(0.5)
print(f"{db['emerald'] } Emerald");sleep(0.5)
print(f"{db['diamond'] } Diamond");sleep(0.5)
print(f"{db['topaz']} Topaz");sleep(0.5)
print(f"{db['aquamarine']} Aquamarine");sleep(0.5)
print(f"{db['amethyst']} Amethyst");sleep(0.5)
print(f'{db["OMEGA_ORE"]} Omega Ore')
money_2 = money
#db['sell_Sapphire'] = 2.4
#db['sell_Ruby'] = 3.6
#db['sell_emerald'] = 4.4
#db['sell_diamond'] = 6.1
#db['sell_topaz'] = 7
#db['sell_aquamarine'] = 9.2
#db['sell_amethyst'] = 12.4
money+=db['Ruby'] *db['sell_Ruby'] *multiplier
money+=db['Sapphire'] * db['sell_Sapphire']*multiplier
money+=db['emerald'] *db['sell_emerald']*multiplier
money+=db['diamond'] *db['sell_diamond']*multiplier
money+=db['topaz'] *db['sell_topaz']*multiplier
money+=db['aquamarine'] * db['sell_aquamarine']*multiplier
money+=db['amethyst'] *db['sell_amethyst']*multiplier
money+=db['OMEGA_ORE']* 1250*multiplier
print(f'For {purple}ƒ{money-money_2}{white}{normal}')
db['Ruby'] =0
db['Sapphire']=0
db['emerald'] =0
db['diamond'] =0
db['topaz'] =0
db['aquamarine'] = 0
db['amethyst'] = 0
db['OMEGA_ORE'] = 0
ruby = 0
sapphire = 0
emerald = 0
diamond = 0
topaz = 0
aquamarine = 0
amethyst = 0
cursor.show()
save()
enter_to_continue()
clear()
break
if opt == f'{bright}{red}Devtool Console{normal}{reset}':
exec(input('Eval >>'))
enter_to_continue()
clear()
#add more elif statements as you go!
except Exception as e:
print("An exception occurred. Please report this in the comments section and take a screenshot, thank you!")
# Save state here.
raise e
def write(string: str, speed: int=.05) -> None:
for char in string:
sys.stdout.write(char)
sys.stdout.flush()
sleep(speed)
debug = False
authors = [
"Idkwhttph",
]
##### ALL DEBUG FEATURES MUST CHECK debug == True #####
# this is to disable people from directly accessing dev tools.
debug = None # If you want to test
if environ['REPL_OWNER'] == 'Idkwhttph':
debug = True
else:
debug = False
def save():
global text_keys,miners,mining_speed,sapphire,ruby,emerald,diamond,topaz,aquamarine,amethyst,mining_yield,multiplier,rebirths,money,sell_sapphire,sell_ruby,sell_emerald,sell_diamond,sell_topaz,sell_aquamarine,sell_amethyst,probability,level
db['Level'] = level
db['Text.keys'] = text_keys
db['Miners'] = miners
db['Mining_speed'] = mining_speed
db['Sapphire'] = sapphire
db['Ruby'] = ruby
db['emerald'] = emerald
db['diamond'] = diamond
db['topaz'] = topaz
db['aquamarine'] = aquamarine
db['amethyst'] = amethyst
db['Mining_yield'] = mining_yield
db['multiplier'] = multiplier
db['rebirths'] = rebirths
db['Money'] = money
db['sell_Sapphire'] = 2
db['sell_Ruby'] = 8
db['sell_emerald'] = 10
db['sell_diamond'] = 12
db['sell_topaz'] = 14
db['sell_aquamarine'] = 18
db['sell_amethyst'] = 26
try:
print(db['37364824672838']);clear()
except:
db['37364824672838'] = 32236326
text_keys = 0.23232323
write(f'{bright}Welcome to to Mining Simulator, where you can {blue}mine{white} precious {green}gemstones{white} and sell them for {green}money{white}, then you can Buy {purple}miners{white} to mine for you When you buy a miner, It can exponentially ( my english is trash pls correct if im wrong lolz ) increase your Mining yield and your profits! Thank you for your time, hope you enjoy!')
print('\n')
enter_to_continue()
clear()
save()
sleep(2)
if debug:
menu = [
f'{bright}{purple}Mine{reset}',
f'{bright}{blue}Buy Upgrades{white}{reset}',
f'{bright}Buy Miners{reset}',
f'{bright}{green}Buy Rebirth Upgrades{white}{reset}',
f'{bright}{purple}Rebirth options{white}{reset}' ,
f'{bright}{blue}Sell Ores{white}{reset}',
f'{bright}Upgrade Your Mining Tool{reset}',
f'{bright}{red}Devtool Console{normal}{reset}'
]
else:
menu = [
f'{bright}{purple}Mine{reset}',
f'{bright}{blue}Buy Upgrades{white}{reset}',
f'{bright}Buy Miners{reset}',
f'{bright}{green}Buy Rebirth Upgrades{white}{reset}',
f'{bright}{purple}Rebirth options{white}{reset}' ,
f'{bright}{blue}Sell Ores{white}{reset}',
f'{bright}Upgrade Your Mining Tool{reset}'
]
unpack_data()
while True:
try:
while True:
unpack_data()
getinput(menu)
except Exception as e:
save()
raise e
OHH GOD PLEASE SAVE MY BABY
THIS IS THE OUTPUT OHHH GOD MY BABY IS CRYING AGAIN OH SAVE ME A
Mining_Simulator.exe
------------------------------------------------------------
Please use the W and S keys to move UP or DOWN respectively
You have ƒ0 cash
You have §0 Rebirths
-> [0] Mine<function reset at 0x7f1434aebeb0>
[1] Buy Upgrades<function reset at 0x7f1434aebeb0>
[2] Buy Miners<function reset at 0x7f1434aebeb0>
[3] Buy Rebirth Upgrades<function reset at 0x7f1434aebeb0>
[4] Rebirth options<function reset at 0x7f1434aebeb0>
[5] Sell Ores<function reset at 0x7f1434aebeb0>
[6] Upgrade Your Mining Tool<function reset at 0x7f1434aebeb0>
[7] Devtool Console<function reset at 0x7f1434aebeb0>
i’M GONA CRY PJS OMG I pls save me
O H NOOO NO NOT AGAIN PLS I OMG I AM GONNA CRY I FORK IT AND IT COME OUT THE SAME THING OH! @QwertyQwerty88 come to the repl pls