Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Code:
- from tkinter import *
- import random
- from tkinter import messagebox
- import time
- from threading import Thread
- RP = 999999
- RP_PS = 0
- item = ''
- inventory = ''
- item_count = 0
- price = 2
- up = 5
- multiply_factor = 0
- multiply = 0
- score = 0
- restart = 100
- skins = 0
- normal_skins = 0
- skin_add = ''
- skin_price = 975
- skin_name = 'Justicar Aatrox', 'Academy Ahri', 'Infernal Akali', 'Conquer Alistar', 'Emumu', 'Hextech Anivia', \
- 'Reverse Annie', 'Queen Ashe', 'Galactic Azir', 'Cryocore Brand', 'Bard Bard', 'Riot Blitzcrank', \
- 'Braum Lionheart', 'Officer Caitlyn', 'Mythic Cassiopeia', 'Jurassic Cho\'Gath', 'Hot Rod Corki', \
- 'Lunar Goddess Diana', 'Academy Darius', 'Mundo Mundo', 'Draven Draven', 'Sandstorm Ekko', \
- 'Blood Moon Elise', 'Tango Evelyn', 'Explorer Ezreal', 'Bandit Fiddlesticks', 'Nightraven Fiora', \
- 'Cotton Tail Fizz', 'Curling Veigar', 'Prototype Victor', 'Officer Vi', 'Definitely Not Vel\'Koz', \
- 'Captain Volibear', 'Grey Warwick', 'Volcanic Wukong', 'Battle Cast Xerath', 'Blood Moon Yasuo', \
- 'Champion Ship Zed', 'Penta Kill Yorick', 'Major Ziggs', 'Groovy Zilean', 'Wildfire Zyra', \
- 'Cutpurse Twisted Fate', 'Highland Tryndamere', 'Worldbreaker Trundle', 'Cottontail Teemo'
- epic_skins = 0
- skin_price_epic = 1350
- skin_add_epic = ''
- skin_name_epic = 'Sugar Rush Zilean', 'Pool Party Zoe', 'Haunted Zyra', 'Mecha Kingdoms Sett', 'Dragonslayer Diana', \
- 'Dragonslayer Olaf', 'Dragonslayer Trundle', 'Freljord Sylas', 'Mecha Kingdoms Garen', \
- 'Heartseeker Jinx', 'Heartseeker Yuumi', ' Blood Moon Katarina', ' Blood Moon Master Yi', \
- 'Dark Star Xerath', 'Talon Blackwood', 'Worldbreaker Sion', 'Pengu Cosplay Tristana', \
- 'Taric Luminshield', 'Twitch Shadowfoot', 'Blackfrost Rek\'Sai', ' Little Devil Teemo', 'Tyrant Swain', \
- 'Lunar Wraith Sylas', 'Snow Day Syndra', 'Coin Emperor Kench', 'Omega Squad Tristana', 'Battlecast Urgot', \
- 'Heartseeker Varus', 'Elderwood Veigar', 'Arclight Vel\'Koz', 'Demon Vi', 'Creator Viktor', ' Soulstealer Vladimir', \
- 'Project Warwick', 'Lancer Stratus Wukong', 'Sweetheart Xayah', 'Cosmic Defender Xin Zhao', 'Project Yasuo', \
- 'Meowrick', 'Pool Party Zac', 'Project Zed', 'Battle Boss Ziggs', 'Pool Party Rek\'Sai', 'Blood Moon Pyke', \
- 'Dragonslayer Pantheon', 'Heartseeker Orianna', 'Cosmic Dawn Rakan', 'Pajama Guardian Miss Fortune', 'God Staff Jax'
- legendary_skins = 0
- skin_price_legendary = 1820
- skin_add_legendary = ''
- skin_name_legendary = 'Mecha Kingdoms Jax', 'Galaxy Slayer Zed', 'Nightbringer Yasuo', 'Star Guardian Xayah', ' Blood Lord Vladimir', \
- 'Final Boss Veigar', 'Project Vayne', 'The Magnificent Twisted Fate', 'Firefighter Tristana', 'Dark Star Thresh', \
- 'Omega Squad Teemo', 'Nightbringer Soraka', 'Battlecast Alpha Skarner', 'Mecha Zero Sion', 'Super Galaxy Rumble', \
- 'Dawnbringer Riven', 'Star Guardian Rakan', 'Project Pyke', 'Brolaf', 'Eternum Nocturne', 'Nunu Bot', 'Infernal Nasus', \
- 'Project Master Yi', 'High Noon Lucian', 'Solar Eclipse Leona', 'God Fist Lee Sin', 'Odyssey Kayn', 'Aether Wing Kayle', \
- 'Star Guardian Jinx', 'Dark Cosmic Jhin', 'Forecast Janna', 'Dragon Trainer Heimerdinger', 'God King Garen', 'Gatekeeper Galio', \
- 'Battle Academia Ezreal', 'True Damage Ekko', 'Corporate Mundo', 'Dunkmaster Darius', 'God King Darius', 'Red Baron Corki', \
- 'Gentleman Cho\'Gath', 'Pulsefire Caitlyn', 'Zombie Brand', 'Project Ashe', 'Annie in Wonderland', 'Cosmic Lux', 'Blackfrost Anivia', \
- 'Star Guardian Ahri'
- prestige_skins = 0
- skin_price_prestige = 2540
- skin_add_prestige = ''
- skin_name_prestige = 'Blood Moon Aatrox', 'KD/A Akali', 'KD/A Kai`sa', 'KD/A Ahri', 'KD/A Evelyn', 'Fuzz Fizz', \
- 'Project Irelia', 'Nightbringer Lee Sin', 'Dark Star Malphite', 'Mecha Kingdoms Garen', \
- 'True Damage Senna', 'Pulsefire Tresh', 'Star Guardian Neeko', 'Bewitching Miss Fortune', \
- 'Firecracker Vayne'
- ultimate_skins = 0
- skin_price_ultimate = 3250
- skin_add_ultimate = ''
- skin_name_ultimate = 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pool Party Gragas', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
- 'Spirit Guard Udyr',
- def update_all():
- while True:
- global multiply
- global RP
- global score
- global normal_skins
- global epic_skins
- global legendary_skins
- global prestige_skins
- global ultimate_skins
- global restart
- global item
- global inventory
- global item_count
- global price
- global up
- global skins
- global skin_price
- global skin_price_epic
- global skin_price_legendary
- global skin_price_prestige
- global skin_price_ultimate
- global RP_PS
- multiply_factor_lbl.config(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS))
- score_lbl.config(text='score : ' + str(score) + '/' + str(restart))
- RP_money.config(text=str(int(RP)) + ' RP')
- Rp_button.config(image=img1)
- buy_button.config(text='Upgrade Multiplier for: ' + str(price) + ' RP')
- skin_buy_btn.config(text='Buy a skin for: ' + str(skin_price) + ' RP')
- skin_buy_epic_btn.config(text='Buy an epic skin for: ' + str(skin_price_epic) + ' RP')
- skin_buy_prestige_btn.config(text='Buy a prestige skin for: ' + str(skin_price_prestige) + ' RP')
- skin_buy_legendary_btn.config(text='Buy a legendary skin for: ' + str(skin_price_legendary) + ' RP')
- skin_buy_ultimate_btn.config(text='Buy a ultimate skin for: ' + str(skin_price_ultimate) + ' RP')
- skins_all_lbl.config(text='Skins Normal: ' + str(normal_skins) + ' | Skins epic: ' + str(epic_skins) +
- ' | Skins Legendary: ' +
- str(legendary_skins) + ' | Skins Prestige: ' + str(
- prestige_skins) + ' | Skins Ultimate: ' +
- str(ultimate_skins) + ' | Overall Skin value: ' + str(skins))
- if restart <= score <= restart + 50:
- msg_box = messagebox.askquestion('Restart', '''Do you want do reset the Game?
- - You will only keep your Multiplier''', icon='warning')
- if msg_box == 'yes':
- RP = 0
- item = ''
- inventory = ''
- item_count = 0
- price = 2
- up = 5
- score = 0
- restart += 100
- skins = 0
- normal_skins = 0
- skin_price = 975
- epic_skins = 0
- skin_price_epic = 1350
- legendary_skins = 0
- skin_price_legendary = 1820
- prestige_skins = 0
- skin_price_prestige = 2540
- ultimate_skins = 0
- skin_price_ultimate = 3250
- skin_price = 975
- skin_price_epic = 1350
- skin_price_legendary = 1820
- skin_price_prestige = 2540
- skin_price_ultimate = 3250
- RP_money.config(text='2 RP')
- else:
- restart += 50
- messagebox.showinfo('Return to Game', 'You will now return to the Game')
- time.sleep(0.1)
- update_all()
- def RP_per_second():
- global RP
- global RP_PS
- time.sleep(2)
- while True:
- RP = RP + RP_PS
- print('1')
- update_all()
- time.sleep(1)
- def press():
- global RP
- global multiply
- global skins
- RP += 1 + multiply_factor + skins
- update_all()
- def buy():
- global item_count
- global item
- global inventory
- global price
- global RP
- if RP >= price:
- item_count += 1
- RP -= price
- get_price()
- elif RP < 50:
- messagebox.showerror('RP Clicker', 'You have not Enough RP')
- else:
- messagebox.showinfo('Bot Buy', 'Not enough RP')
- update_all()
- def get_price():
- global item_count
- global price
- global up
- global multiply_factor
- global multiply
- global score
- multiply_factor += 0.1
- up += 10
- price += int(up / 5)
- multiply = multiply_factor.__round__(2)
- score += 1
- update_all()
- def skin_buy():
- global RP
- global skin_price
- global skins
- global skin_name
- global skin_add
- global score
- global normal_skins
- global RP_PS
- skin_add = skin_name[random.randint(1, len(skin_name))] + ' was Added to your Collection'
- if RP >= skin_price:
- skins += 1
- score += 2
- normal_skins += 1
- RP -= skin_price
- messagebox.showinfo('Skin Buy', skin_add)
- skin_price += 50
- RP_PS += 1
- elif RP < skin_price:
- messagebox.showerror('Skin Buy', 'You have not enough RP')
- else:
- messagebox.showerror('Skin Buy', 'ERROR in buy')
- update_all()
- def skin_buy_epic():
- global RP
- global skin_price_epic
- global skins
- global skin_name_epic
- global skin_add_epic
- global score
- global epic_skins
- global RP_PS
- skin_add_epic = skin_name_epic[random.randint(1, len(skin_name_epic))] + ' (EPIC) was Added to your Collection'
- if RP >= skin_price_epic:
- RP_PS += 2
- skins += 2
- score += 4
- RP -= skin_price_epic
- messagebox.showinfo('Skin Buy', skin_add_epic)
- epic_skins += 1
- skin_price_epic += 100
- elif RP < skin_price_epic:
- messagebox.showerror('Skin Buy', 'You have not enough RP')
- else:
- messagebox.showerror('Skin Buy', 'ERROR in buy')
- update_all()
- def skin_buy_legendary():
- global RP
- global skin_price_legendary
- global skins
- global skin_name_legendary
- global skin_add_legendary
- global score
- global legendary_skins
- global RP_PS
- skin_add_legendary = skin_name_legendary[
- random.randint(1, len(skin_name_legendary))] + ' (LEGENDARY) was Added to your Collection'
- if RP >= skin_price_legendary:
- RP_PS += 3
- skins += 4
- score += 6
- legendary_skins += 1
- RP -= skin_price_legendary
- messagebox.showinfo('Skin Buy', skin_add_legendary)
- skin_price_legendary += 150
- elif RP < skin_price_legendary:
- messagebox.showerror('Skin Buy', 'You have not enough RP')
- else:
- messagebox.showerror('Skin Buy', 'ERROR in buy')
- update_all()
- def skin_buy_prestige():
- global RP
- global skin_price_prestige
- global skins
- global skin_name_prestige
- global skin_add_prestige
- global score
- global prestige_skins
- global RP_PS
- skin_add_prestige = skin_name_prestige[
- random.randint(1, len(skin_name_prestige))] + ' (PRESTIGE) was Added to your Collection'
- if RP >= skin_price_prestige:
- RP_PS += 4
- skins += 6
- score += 8
- prestige_skins += 1
- RP -= skin_price_prestige
- messagebox.showinfo('Skin Buy', skin_add_prestige)
- skin_price_prestige += 200
- elif RP < skin_price_prestige:
- messagebox.showerror('Skin Buy', 'You have not enough RP')
- else:
- messagebox.showerror('Skin Buy', 'ERROR in buy')
- update_all()
- def skin_buy_ultimate():
- global RP
- global skin_price_ultimate
- global skins
- global skin_name_ultimate
- global skin_add_ultimate
- global score
- global ultimate_skins
- global RP_PS
- skin_add_ultimate = skin_name_ultimate[
- random.randint(1, len(skin_name_ultimate))] + ' (ULTIMATE) was Added to your Collection'
- if RP >= skin_price_ultimate:
- RP_PS += 5
- skins += 8
- score += 10
- ultimate_skins += 1
- RP -= skin_price_ultimate
- messagebox.showinfo('Skin Buy', skin_add_ultimate)
- skin_price_ultimate += 200
- elif RP < skin_price_ultimate:
- messagebox.showerror('Skin Buy', 'You have not enough RP')
- else:
- messagebox.showerror('Skin Buy', 'ERROR in buy')
- update_all()
- def quit_game():
- update_all()
- quit()
- RP_per_second_update = Thread(target=RP_per_second)
- while True:
- RP_per_second_update.start()
- root = Tk()
- root.title('')
- root.geometry("1920x900")
- img1 = PhotoImage(file="RPdefault.png")
- Rp_button = Button(root, image=img1, command=press, activebackground='#3a3b3c', background='#2a2b2c', fg='#7a7b7c',
- width='2000', height='20')
- RP_money = Label(text=str(int(RP)) + ' RP', height='0', width='2000', font=("Times New Roman", 40, "bold"),
- background='#2a2b2c', fg='#7a7b7c')
- buy_button = Button(root, text='Upgrade Multiplier for: ' + str(price) + ' RP', command=buy, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- multiply_factor_lbl = Label(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS), width='2000', background='#2a2b2c', fg='#7a7b7c',
- height='3')
- score_lbl = Label(text='score : ' + str(score) + '/' + str(restart), width='2000', background='#2a2b2c', fg='#7a7b7c', height='3')
- skins_all_lbl = Label(text='Skins Normal: ' + str(normal_skins) + ' | Skins epic: ' + str(epic_skins) +
- ' | Skins Legendary: ' +
- str(legendary_skins) + ' | Skins Prestige: ' + str(
- prestige_skins) + ' | Skins Ultimate: ' +
- str(ultimate_skins) + ' | Overall Skin value: ' + str(skins),
- width='2000', background='#2a2b2c', fg='#7a7b7c', height='3')
- skin_buy_btn = Button(text='Buy a skin for: ' + str(skin_price) + ' RP', command=skin_buy, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- skin_buy_epic_btn = Button(text='Buy an epic skin for: ' + str(skin_price_epic) + ' RP', command=skin_buy_epic,
- activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- skin_buy_prestige_btn = Button(text='Buy a prestige skin for: ' + str(skin_price_prestige) + ' RP',
- command=skin_buy_prestige, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- skin_buy_legendary_btn = Button(text='Buy a legendary skin for: ' + str(skin_price_legendary) + ' RP',
- command=skin_buy_legendary, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- skin_buy_ultimate_btn = Button(text='Buy an ultimate skin for: ' + str(skin_price_ultimate) + ' RP',
- command=skin_buy_ultimate, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- quit_btn = Button(text='Quit the Game', command=quit_game, activebackground='#3a3b3c',
- background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
- Rp_button.pack(anchor='center')
- RP_money.pack(anchor='center')
- buy_button.pack(anchor='center')
- skin_buy_btn.pack(anchor='center')
- skin_buy_epic_btn.pack(anchor='center')
- skin_buy_legendary_btn.pack(anchor='center')
- skin_buy_prestige_btn.pack(anchor='center')
- skin_buy_ultimate_btn.pack(anchor='center')
- score_lbl.pack(anchor='center')
- multiply_factor_lbl.pack(anchor='center')
- skins_all_lbl.pack(anchor='center')
- quit_btn.pack(anchor='center')
- root.call('wm', 'attributes', '.', '-topmost', '1')
- root.mainloop()
- ERROR:
- C:\Users\*****\PycharmProjects\venv\Scripts\python.exe "C:/Users/****/PycharmProjects/AllPythonProjects/Codes/Minispiele (Tk) 100 - 150/Rp-Clicker/RP-Clicker.py"
- Traceback (most recent call last):
- File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 367, in <module>
- img1 = PhotoImage(file="RPdefault.png")
- File "C:\Users\*******\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 4093, in __init__
- Image.__init__(self, 'photo', name, cnf, master, **kw)
- File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 4038, in __init__
- self.tk.call(('image', 'create', imgtype, name,) + options)
- _tkinter.TclError: couldn't open "RPdefault.png": no such file or directory
- Exception in thread Thread-1 (RP_per_second):
- Traceback (most recent call last):
- File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
- 1
- self.run()
- File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
- self._target(*self._args, **self._kwargs)
- File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 167, in RP_per_second
- update_all()
- File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 106, in update_all
- multiply_factor_lbl.config(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS))
- NameError: name 'multiply_factor_lbl' is not defined. Did you mean: 'multiply_factor'?
- Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement