Advertisement
Guest User

Python RP-Clicker

a guest
Jun 21st, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.67 KB | None | 0 0
  1. Code:
  2. from tkinter import *
  3. import random
  4. from tkinter import messagebox
  5. import time
  6. from threading import Thread
  7.  
  8.  
  9. RP = 999999
  10. RP_PS = 0
  11. item = ''
  12. inventory = ''
  13. item_count = 0
  14. price = 2
  15. up = 5
  16. multiply_factor = 0
  17. multiply = 0
  18. score = 0
  19. restart = 100
  20. skins = 0
  21.  
  22. normal_skins = 0
  23. skin_add = ''
  24. skin_price = 975
  25. skin_name = 'Justicar Aatrox', 'Academy Ahri', 'Infernal Akali', 'Conquer Alistar', 'Emumu', 'Hextech Anivia', \
  26. 'Reverse Annie', 'Queen Ashe', 'Galactic Azir', 'Cryocore Brand', 'Bard Bard', 'Riot Blitzcrank', \
  27. 'Braum Lionheart', 'Officer Caitlyn', 'Mythic Cassiopeia', 'Jurassic Cho\'Gath', 'Hot Rod Corki', \
  28. 'Lunar Goddess Diana', 'Academy Darius', 'Mundo Mundo', 'Draven Draven', 'Sandstorm Ekko', \
  29. 'Blood Moon Elise', 'Tango Evelyn', 'Explorer Ezreal', 'Bandit Fiddlesticks', 'Nightraven Fiora', \
  30. 'Cotton Tail Fizz', 'Curling Veigar', 'Prototype Victor', 'Officer Vi', 'Definitely Not Vel\'Koz', \
  31. 'Captain Volibear', 'Grey Warwick', 'Volcanic Wukong', 'Battle Cast Xerath', 'Blood Moon Yasuo', \
  32. 'Champion Ship Zed', 'Penta Kill Yorick', 'Major Ziggs', 'Groovy Zilean', 'Wildfire Zyra', \
  33. 'Cutpurse Twisted Fate', 'Highland Tryndamere', 'Worldbreaker Trundle', 'Cottontail Teemo'
  34.  
  35. epic_skins = 0
  36. skin_price_epic = 1350
  37. skin_add_epic = ''
  38. skin_name_epic = 'Sugar Rush Zilean', 'Pool Party Zoe', 'Haunted Zyra', 'Mecha Kingdoms Sett', 'Dragonslayer Diana', \
  39. 'Dragonslayer Olaf', 'Dragonslayer Trundle', 'Freljord Sylas', 'Mecha Kingdoms Garen', \
  40. 'Heartseeker Jinx', 'Heartseeker Yuumi', ' Blood Moon Katarina', ' Blood Moon Master Yi', \
  41. 'Dark Star Xerath', 'Talon Blackwood', 'Worldbreaker Sion', 'Pengu Cosplay Tristana', \
  42. 'Taric Luminshield', 'Twitch Shadowfoot', 'Blackfrost Rek\'Sai', ' Little Devil Teemo', 'Tyrant Swain', \
  43. 'Lunar Wraith Sylas', 'Snow Day Syndra', 'Coin Emperor Kench', 'Omega Squad Tristana', 'Battlecast Urgot', \
  44. 'Heartseeker Varus', 'Elderwood Veigar', 'Arclight Vel\'Koz', 'Demon Vi', 'Creator Viktor', ' Soulstealer Vladimir', \
  45. 'Project Warwick', 'Lancer Stratus Wukong', 'Sweetheart Xayah', 'Cosmic Defender Xin Zhao', 'Project Yasuo', \
  46. 'Meowrick', 'Pool Party Zac', 'Project Zed', 'Battle Boss Ziggs', 'Pool Party Rek\'Sai', 'Blood Moon Pyke', \
  47. 'Dragonslayer Pantheon', 'Heartseeker Orianna', 'Cosmic Dawn Rakan', 'Pajama Guardian Miss Fortune', 'God Staff Jax'
  48.  
  49. legendary_skins = 0
  50. skin_price_legendary = 1820
  51. skin_add_legendary = ''
  52. skin_name_legendary = 'Mecha Kingdoms Jax', 'Galaxy Slayer Zed', 'Nightbringer Yasuo', 'Star Guardian Xayah', ' Blood Lord Vladimir', \
  53. 'Final Boss Veigar', 'Project Vayne', 'The Magnificent Twisted Fate', 'Firefighter Tristana', 'Dark Star Thresh', \
  54. 'Omega Squad Teemo', 'Nightbringer Soraka', 'Battlecast Alpha Skarner', 'Mecha Zero Sion', 'Super Galaxy Rumble', \
  55. 'Dawnbringer Riven', 'Star Guardian Rakan', 'Project Pyke', 'Brolaf', 'Eternum Nocturne', 'Nunu Bot', 'Infernal Nasus', \
  56. 'Project Master Yi', 'High Noon Lucian', 'Solar Eclipse Leona', 'God Fist Lee Sin', 'Odyssey Kayn', 'Aether Wing Kayle', \
  57. 'Star Guardian Jinx', 'Dark Cosmic Jhin', 'Forecast Janna', 'Dragon Trainer Heimerdinger', 'God King Garen', 'Gatekeeper Galio', \
  58. 'Battle Academia Ezreal', 'True Damage Ekko', 'Corporate Mundo', 'Dunkmaster Darius', 'God King Darius', 'Red Baron Corki', \
  59. 'Gentleman Cho\'Gath', 'Pulsefire Caitlyn', 'Zombie Brand', 'Project Ashe', 'Annie in Wonderland', 'Cosmic Lux', 'Blackfrost Anivia', \
  60. 'Star Guardian Ahri'
  61.  
  62. prestige_skins = 0
  63. skin_price_prestige = 2540
  64. skin_add_prestige = ''
  65. skin_name_prestige = 'Blood Moon Aatrox', 'KD/A Akali', 'KD/A Kai`sa', 'KD/A Ahri', 'KD/A Evelyn', 'Fuzz Fizz', \
  66. 'Project Irelia', 'Nightbringer Lee Sin', 'Dark Star Malphite', 'Mecha Kingdoms Garen', \
  67. 'True Damage Senna', 'Pulsefire Tresh', 'Star Guardian Neeko', 'Bewitching Miss Fortune', \
  68. 'Firecracker Vayne'
  69.  
  70. ultimate_skins = 0
  71. skin_price_ultimate = 3250
  72. skin_add_ultimate = ''
  73. skin_name_ultimate = 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  74. 'Spirit Guard Udyr', 'Pool Party Gragas', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  75. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  76. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  77. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  78. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  79. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  80. 'Spirit Guard Udyr', 'Pulsefire Ezreal', 'Elementalist Lux', 'Gun Goddess Miss Fortune', 'DJ Sona', \
  81. 'Spirit Guard Udyr',
  82.  
  83.  
  84. def update_all():
  85. while True:
  86. global multiply
  87. global RP
  88. global score
  89. global normal_skins
  90. global epic_skins
  91. global legendary_skins
  92. global prestige_skins
  93. global ultimate_skins
  94. global restart
  95. global item
  96. global inventory
  97. global item_count
  98. global price
  99. global up
  100. global skins
  101. global skin_price
  102. global skin_price_epic
  103. global skin_price_legendary
  104. global skin_price_prestige
  105. global skin_price_ultimate
  106. global RP_PS
  107. multiply_factor_lbl.config(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS))
  108. score_lbl.config(text='score : ' + str(score) + '/' + str(restart))
  109. RP_money.config(text=str(int(RP)) + ' RP')
  110. Rp_button.config(image=img1)
  111. buy_button.config(text='Upgrade Multiplier for: ' + str(price) + ' RP')
  112. skin_buy_btn.config(text='Buy a skin for: ' + str(skin_price) + ' RP')
  113. skin_buy_epic_btn.config(text='Buy an epic skin for: ' + str(skin_price_epic) + ' RP')
  114. skin_buy_prestige_btn.config(text='Buy a prestige skin for: ' + str(skin_price_prestige) + ' RP')
  115. skin_buy_legendary_btn.config(text='Buy a legendary skin for: ' + str(skin_price_legendary) + ' RP')
  116. skin_buy_ultimate_btn.config(text='Buy a ultimate skin for: ' + str(skin_price_ultimate) + ' RP')
  117. skins_all_lbl.config(text='Skins Normal: ' + str(normal_skins) + ' | Skins epic: ' + str(epic_skins) +
  118. ' | Skins Legendary: ' +
  119. str(legendary_skins) + ' | Skins Prestige: ' + str(
  120. prestige_skins) + ' | Skins Ultimate: ' +
  121. str(ultimate_skins) + ' | Overall Skin value: ' + str(skins))
  122.  
  123. if restart <= score <= restart + 50:
  124. msg_box = messagebox.askquestion('Restart', '''Do you want do reset the Game?
  125. - You will only keep your Multiplier''', icon='warning')
  126. if msg_box == 'yes':
  127. RP = 0
  128. item = ''
  129. inventory = ''
  130. item_count = 0
  131. price = 2
  132. up = 5
  133. score = 0
  134. restart += 100
  135. skins = 0
  136. normal_skins = 0
  137. skin_price = 975
  138. epic_skins = 0
  139. skin_price_epic = 1350
  140. legendary_skins = 0
  141. skin_price_legendary = 1820
  142. prestige_skins = 0
  143. skin_price_prestige = 2540
  144. ultimate_skins = 0
  145. skin_price_ultimate = 3250
  146. skin_price = 975
  147. skin_price_epic = 1350
  148. skin_price_legendary = 1820
  149. skin_price_prestige = 2540
  150. skin_price_ultimate = 3250
  151. RP_money.config(text='2 RP')
  152.  
  153.  
  154. else:
  155. restart += 50
  156. messagebox.showinfo('Return to Game', 'You will now return to the Game')
  157. time.sleep(0.1)
  158. update_all()
  159.  
  160.  
  161. def RP_per_second():
  162. global RP
  163. global RP_PS
  164. time.sleep(2)
  165. while True:
  166. RP = RP + RP_PS
  167. print('1')
  168. update_all()
  169. time.sleep(1)
  170.  
  171.  
  172. def press():
  173. global RP
  174. global multiply
  175. global skins
  176. RP += 1 + multiply_factor + skins
  177. update_all()
  178.  
  179.  
  180. def buy():
  181. global item_count
  182. global item
  183. global inventory
  184. global price
  185. global RP
  186.  
  187. if RP >= price:
  188. item_count += 1
  189. RP -= price
  190. get_price()
  191.  
  192.  
  193. elif RP < 50:
  194. messagebox.showerror('RP Clicker', 'You have not Enough RP')
  195. else:
  196. messagebox.showinfo('Bot Buy', 'Not enough RP')
  197. update_all()
  198.  
  199.  
  200. def get_price():
  201. global item_count
  202. global price
  203. global up
  204. global multiply_factor
  205. global multiply
  206. global score
  207.  
  208. multiply_factor += 0.1
  209. up += 10
  210. price += int(up / 5)
  211. multiply = multiply_factor.__round__(2)
  212. score += 1
  213. update_all()
  214.  
  215.  
  216. def skin_buy():
  217. global RP
  218. global skin_price
  219. global skins
  220. global skin_name
  221. global skin_add
  222. global score
  223. global normal_skins
  224. global RP_PS
  225. skin_add = skin_name[random.randint(1, len(skin_name))] + ' was Added to your Collection'
  226.  
  227. if RP >= skin_price:
  228. skins += 1
  229. score += 2
  230. normal_skins += 1
  231. RP -= skin_price
  232. messagebox.showinfo('Skin Buy', skin_add)
  233. skin_price += 50
  234. RP_PS += 1
  235.  
  236. elif RP < skin_price:
  237. messagebox.showerror('Skin Buy', 'You have not enough RP')
  238. else:
  239. messagebox.showerror('Skin Buy', 'ERROR in buy')
  240. update_all()
  241.  
  242.  
  243. def skin_buy_epic():
  244. global RP
  245. global skin_price_epic
  246. global skins
  247. global skin_name_epic
  248. global skin_add_epic
  249. global score
  250. global epic_skins
  251. global RP_PS
  252. skin_add_epic = skin_name_epic[random.randint(1, len(skin_name_epic))] + ' (EPIC) was Added to your Collection'
  253.  
  254. if RP >= skin_price_epic:
  255. RP_PS += 2
  256. skins += 2
  257. score += 4
  258. RP -= skin_price_epic
  259. messagebox.showinfo('Skin Buy', skin_add_epic)
  260. epic_skins += 1
  261. skin_price_epic += 100
  262.  
  263. elif RP < skin_price_epic:
  264. messagebox.showerror('Skin Buy', 'You have not enough RP')
  265. else:
  266. messagebox.showerror('Skin Buy', 'ERROR in buy')
  267. update_all()
  268.  
  269.  
  270. def skin_buy_legendary():
  271. global RP
  272. global skin_price_legendary
  273. global skins
  274. global skin_name_legendary
  275. global skin_add_legendary
  276. global score
  277. global legendary_skins
  278. global RP_PS
  279. skin_add_legendary = skin_name_legendary[
  280. random.randint(1, len(skin_name_legendary))] + ' (LEGENDARY) was Added to your Collection'
  281.  
  282. if RP >= skin_price_legendary:
  283. RP_PS += 3
  284. skins += 4
  285. score += 6
  286. legendary_skins += 1
  287. RP -= skin_price_legendary
  288. messagebox.showinfo('Skin Buy', skin_add_legendary)
  289. skin_price_legendary += 150
  290.  
  291. elif RP < skin_price_legendary:
  292. messagebox.showerror('Skin Buy', 'You have not enough RP')
  293. else:
  294. messagebox.showerror('Skin Buy', 'ERROR in buy')
  295. update_all()
  296.  
  297.  
  298. def skin_buy_prestige():
  299. global RP
  300. global skin_price_prestige
  301. global skins
  302. global skin_name_prestige
  303. global skin_add_prestige
  304. global score
  305. global prestige_skins
  306. global RP_PS
  307. skin_add_prestige = skin_name_prestige[
  308. random.randint(1, len(skin_name_prestige))] + ' (PRESTIGE) was Added to your Collection'
  309.  
  310. if RP >= skin_price_prestige:
  311. RP_PS += 4
  312. skins += 6
  313. score += 8
  314. prestige_skins += 1
  315. RP -= skin_price_prestige
  316. messagebox.showinfo('Skin Buy', skin_add_prestige)
  317. skin_price_prestige += 200
  318.  
  319. elif RP < skin_price_prestige:
  320. messagebox.showerror('Skin Buy', 'You have not enough RP')
  321. else:
  322. messagebox.showerror('Skin Buy', 'ERROR in buy')
  323. update_all()
  324.  
  325.  
  326. def skin_buy_ultimate():
  327. global RP
  328. global skin_price_ultimate
  329. global skins
  330. global skin_name_ultimate
  331. global skin_add_ultimate
  332. global score
  333. global ultimate_skins
  334. global RP_PS
  335. skin_add_ultimate = skin_name_ultimate[
  336. random.randint(1, len(skin_name_ultimate))] + ' (ULTIMATE) was Added to your Collection'
  337.  
  338. if RP >= skin_price_ultimate:
  339. RP_PS += 5
  340. skins += 8
  341. score += 10
  342. ultimate_skins += 1
  343. RP -= skin_price_ultimate
  344. messagebox.showinfo('Skin Buy', skin_add_ultimate)
  345. skin_price_ultimate += 200
  346.  
  347. elif RP < skin_price_ultimate:
  348. messagebox.showerror('Skin Buy', 'You have not enough RP')
  349. else:
  350. messagebox.showerror('Skin Buy', 'ERROR in buy')
  351. update_all()
  352.  
  353.  
  354. def quit_game():
  355. update_all()
  356. quit()
  357.  
  358.  
  359. RP_per_second_update = Thread(target=RP_per_second)
  360.  
  361.  
  362. while True:
  363. RP_per_second_update.start()
  364. root = Tk()
  365. root.title('')
  366. root.geometry("1920x900")
  367.  
  368. img1 = PhotoImage(file="RPdefault.png")
  369. Rp_button = Button(root, image=img1, command=press, activebackground='#3a3b3c', background='#2a2b2c', fg='#7a7b7c',
  370. width='2000', height='20')
  371. RP_money = Label(text=str(int(RP)) + ' RP', height='0', width='2000', font=("Times New Roman", 40, "bold"),
  372. background='#2a2b2c', fg='#7a7b7c')
  373. buy_button = Button(root, text='Upgrade Multiplier for: ' + str(price) + ' RP', command=buy, activebackground='#3a3b3c',
  374. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  375. multiply_factor_lbl = Label(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS), width='2000', background='#2a2b2c', fg='#7a7b7c',
  376. height='3')
  377. score_lbl = Label(text='score : ' + str(score) + '/' + str(restart), width='2000', background='#2a2b2c', fg='#7a7b7c', height='3')
  378. skins_all_lbl = Label(text='Skins Normal: ' + str(normal_skins) + ' | Skins epic: ' + str(epic_skins) +
  379. ' | Skins Legendary: ' +
  380. str(legendary_skins) + ' | Skins Prestige: ' + str(
  381. prestige_skins) + ' | Skins Ultimate: ' +
  382. str(ultimate_skins) + ' | Overall Skin value: ' + str(skins),
  383. width='2000', background='#2a2b2c', fg='#7a7b7c', height='3')
  384. skin_buy_btn = Button(text='Buy a skin for: ' + str(skin_price) + ' RP', command=skin_buy, activebackground='#3a3b3c',
  385. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  386. skin_buy_epic_btn = Button(text='Buy an epic skin for: ' + str(skin_price_epic) + ' RP', command=skin_buy_epic,
  387. activebackground='#3a3b3c',
  388. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  389. skin_buy_prestige_btn = Button(text='Buy a prestige skin for: ' + str(skin_price_prestige) + ' RP',
  390. command=skin_buy_prestige, activebackground='#3a3b3c',
  391. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  392. skin_buy_legendary_btn = Button(text='Buy a legendary skin for: ' + str(skin_price_legendary) + ' RP',
  393. command=skin_buy_legendary, activebackground='#3a3b3c',
  394. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  395. skin_buy_ultimate_btn = Button(text='Buy an ultimate skin for: ' + str(skin_price_ultimate) + ' RP',
  396. command=skin_buy_ultimate, activebackground='#3a3b3c',
  397. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  398. quit_btn = Button(text='Quit the Game', command=quit_game, activebackground='#3a3b3c',
  399. background='#2a2b2c', fg='#7a7b7c', width='2000', height='3')
  400.  
  401. Rp_button.pack(anchor='center')
  402. RP_money.pack(anchor='center')
  403. buy_button.pack(anchor='center')
  404. skin_buy_btn.pack(anchor='center')
  405. skin_buy_epic_btn.pack(anchor='center')
  406. skin_buy_legendary_btn.pack(anchor='center')
  407. skin_buy_prestige_btn.pack(anchor='center')
  408. skin_buy_ultimate_btn.pack(anchor='center')
  409. score_lbl.pack(anchor='center')
  410. multiply_factor_lbl.pack(anchor='center')
  411. skins_all_lbl.pack(anchor='center')
  412. quit_btn.pack(anchor='center')
  413.  
  414. root.call('wm', 'attributes', '.', '-topmost', '1')
  415.  
  416. root.mainloop()
  417.  
  418. ERROR:
  419. C:\Users\*****\PycharmProjects\venv\Scripts\python.exe "C:/Users/****/PycharmProjects/AllPythonProjects/Codes/Minispiele (Tk) 100 - 150/Rp-Clicker/RP-Clicker.py"
  420. Traceback (most recent call last):
  421. File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 367, in <module>
  422. img1 = PhotoImage(file="RPdefault.png")
  423. File "C:\Users\*******\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 4093, in __init__
  424. Image.__init__(self, 'photo', name, cnf, master, **kw)
  425. File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 4038, in __init__
  426. self.tk.call(('image', 'create', imgtype, name,) + options)
  427. _tkinter.TclError: couldn't open "RPdefault.png": no such file or directory
  428. Exception in thread Thread-1 (RP_per_second):
  429. Traceback (most recent call last):
  430. File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
  431. 1
  432. self.run()
  433. File "C:\Users\******\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
  434. self._target(*self._args, **self._kwargs)
  435. File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 167, in RP_per_second
  436. update_all()
  437. File "C:\Users\******\PycharmProjects\AllPythonProjects\Codes\Minispiele (Tk) 100 - 150\Rp-Clicker\RP-Clicker.py", line 106, in update_all
  438. multiply_factor_lbl.config(text='Multiplier :' + str(multiply) + ' | RP per second: ' + str(RP_PS))
  439. NameError: name 'multiply_factor_lbl' is not defined. Did you mean: 'multiply_factor'?
  440.  
  441. Process finished with exit code 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement