From 5249a15984278e6bbf8560cd626c4345767aebbb Mon Sep 17 00:00:00 2001 From: jman13378 Date: Wed, 12 Oct 2022 01:57:08 -0400 Subject: [PATCH] 1 --- __pycache__/generators.cpython-310.pyc | Bin 2372 -> 2391 bytes generators.py | 2 +- mlibs.py | 62 ++++++++++++++++--------- 3 files changed, 40 insertions(+), 24 deletions(-) diff --git a/__pycache__/generators.cpython-310.pyc b/__pycache__/generators.cpython-310.pyc index 2b4cec66d710df1eece13b95a1689aaafd4b31e0..db95b1c97017fc6274731ee998fcb1fbfd47be46 100644 GIT binary patch delta 152 zcmX>ibX|xypO=@50SMTiyC(nK$or8|#Xi|8CbT%Us5mAoKQA#O#wEWzFDE}Sr8vef zwOk=BKPM%%XtOxeQ6|QU$#+>a-Ab5in3@?=Si~8CEXHO=afW6_MurqthPh@QrO{QIyHfmr0G(PRfB*mh diff --git a/generators.py b/generators.py index 5962d2e..1cee905 100644 --- a/generators.py +++ b/generators.py @@ -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 diff --git a/mlibs.py b/mlibs.py index 7b4558a..c8d02ce 100644 --- a/mlibs.py +++ b/mlibs.py @@ -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"] @@ -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 @@ -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 @@ -159,11 +162,11 @@ 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 @@ -171,6 +174,7 @@ def prestigeup(): bal = 0 upgrades = 0 balper = prestige + 1 + ending() close() def reload_bal(): @@ -178,7 +182,7 @@ def reload_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 @@ -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) @@ -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() \ No newline at end of file