Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
jman13378 committed Oct 12, 2022
1 parent 1cdc713 commit 5249a15
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
Binary file modified __pycache__/generators.cpython-310.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_dir():
def getGeneratorInterval(genid):
ri = generators["{}".format(genid)]["interval"]
rit = generators["{}".format(genid)]["intervalType"]
print(rit + " " + ri)
print(str(rit) + " " + str(ri))
if "tf" in str(rit): # mi
return ri * 60
elif "hj" in str(rit): # se
Expand Down
62 changes: 39 additions & 23 deletions mlibs.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ def resource_path(relative_path):


win=Tk()
win.geometry("350x350")
win.geometry("750x350")
win.grid()
win.config(bg="#2C2F33")
win.title("Money Manager")

win.rowconfigure(5, weight=1)
win.rowconfigure(5, weight=10)
win.columnconfigure(5, weight=1)
win.columnconfigure(5, weight=10)
win.rowconfigure(4, weight=1)
win.rowconfigure(4, weight=10)
win.columnconfigure(4, weight=1)
win.columnconfigure(4, weight=10)

lel11= 0
bal = data["bal"]
Expand All @@ -100,8 +100,8 @@ def send_stat_msg():
+'Level: {}\n'.format(upgrades)
+'MPC: {}\n'.format(balper)
+'Balance: {}\n'.format(bal)
+'Next Upgrade Price: {}\n'.format((upgrades + 1) * 100 + 50 * getPrestige())
+'Current Upgrade Price: {}'.format(upgrades * 100 + 50 * getPrestige())
+'Next Upgrade Price: {}\n'.format((upgrades + 1) * 100 + 50 * getPrestige(0))
+'Current Upgrade Price: {}'.format(upgrades * 100 + 50 * getPrestige(0))
)
def addbal():
global bal
Expand Down Expand Up @@ -132,25 +132,28 @@ def ending():

pass

def getPrestige():
def getPrestige(l):
global prestige
if prestige == 0:
if prestige == 0 and l == 1:
return 1
elif l== 0 and prestige==0:
return 0
else:
return prestige

def upgrade():
global bal, balper, upgrades, prestige
if bal >= upgrades * 100 + 50 * getPrestige():
cost = upgrades * 100 + 50 * getPrestige()
bal -= upgrades * 100 + 50 * getPrestige()
if bal >= upgrades * 100 + 50 * getPrestige(1):
cost = upgrades * 100 + 50 * getPrestige(1)
bal -= upgrades * 100 + 50 * getPrestige(1)
upgrades += 1
balper += (1 + getPrestige())
balper += (1 + getPrestige(0))


if upgrades >= (20 + (10 * getPrestige())):
if upgrades >= (20 + (10 * getPrestige(0))):
prestigeup()
elif (upgrades == (20 + (10 * getPrestige()))):
return
elif (upgrades == (20 + (10 * getPrestige(0)))):
lel11 = 1
ending()
return
Expand All @@ -159,26 +162,27 @@ def upgrade():
reload_upgrades()
reload_upgrade_level()
playsound(completesound)
showinfo("Upgraded!", "You have upgraded your MPC(Money per click)\nUpgrade: {}\nCost: {}\nRemaining Bal: {}\nNext Cost: {}".format(upgrades, cost, bal, upgrades * 100 + 50 * getPrestige()) )
showinfo("Upgraded!", "You have upgraded your MPC(Money per click)\nUpgrade: {}\nCost: {}\nRemaining Bal: {}\nNext Cost: {}".format(upgrades, cost, bal, upgrades * 100 + 50 * getPrestige(0)) )

else:
s = playsound(errorsound)
showinfo('Not Enought Money!', "Sorry, you doen't have enough money for this!\nCurrent Bal: {}\nNeeded: {}".format(bal, upgrades * 100 + 50 * getPrestige()))
playsound(errorsound)
showinfo('Not Enought Money!', "Sorry, you doen't have enough money for this!\nCurrent Bal: {}\nNeeded: {}".format(bal, upgrades * 100 + 50 * getPrestige(0)))

def prestigeup():
global bal, balper, upgrades, prestige, lel11
prestige += 1
bal = 0
upgrades = 0
balper = prestige + 1
ending()
close()

def reload_bal():
global bal
balance = Label( win, text="Money: ${}".format(bal), bg="#0D1117", fg="green").grid(column=0,row=0)

def reload_upgrades():
upgr = Label( win, text="Upgrade Price: ${}".format(upgrades * 100 + 50 * getPrestige()), bg="#0D1117", fg="white").grid(column=0,row=2)
upgr = Label( win, text="Upgrade Price: ${}".format(upgrades * 100 + 50 * getPrestige(0)), bg="#0D1117", fg="white").grid(column=0,row=2)

def reload_upgrade_level():
global upgrades
Expand Down Expand Up @@ -224,14 +228,16 @@ def restart():
stats = Button(win,text=" Stats? ", command=send_stat_msg, bg="#0D1117", fg="yellow").grid(column=0, row=5)

addmoney = Button(win,text=" Add Money ", command=addbal, bg="#0D1117", fg="blue").grid(column=1, row=0)

reset = Button(win,text=" Reset ", command=restart, bg="#0D1117", fg="red").grid(column=5, row=0)
win.columnconfigure(3, minsize=1, weight=1)
reset = Button(win,text=" Reset ", command=restart, bg="#0D1117", fg="red").grid(column=3, row=0)



win.protocol('WM_DELETE_WINDOW', close)
def getGenerators():
i=1
i2=1
row=0
for x in generators.generators:

print(i)
Expand All @@ -240,15 +246,25 @@ def getGenerators():
baltoadd1= generators.generator.getGeneratorBalper(i)
if baltoadd1:
scheduler = BackgroundScheduler()
scheduler.add_job(id=genname, trigger=lambda: genAddBal(baltoadd1), next_run_time='interval', seconds=time)
scheduler.add_job(lambda: genAddBal(baltoadd1), 'interval', seconds=time, id=genname)
scheduler.start()
win.columnconfigure(5, minsize=1, weight=1)
if (i2 == 9):
i2=1
row+=2
lel = Label(win,text="+${}/{}".format(baltoadd1, time), bg="#0D1117", fg="green").grid(column=4+i2,row=row)
lol = Button(win,text="Upgrade", command=restart, bg="#0D1117", fg="red").grid(column=4+i2, row=1+row)

else:
print("generator error due to incorrect type formatting")
i+=1
i2+=1


def genAddBal(baltoadd):
global bal
bal += baltoadd
reload_bal()
return

getGenerators()
win.mainloop()

0 comments on commit 5249a15

Please sign in to comment.