This repository has been archived by the owner on Jul 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
boost.py
84 lines (61 loc) · 2.38 KB
/
boost.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- coding: utf-8 -*-
from lcu_driver import Connector
import tkinter as tk
from tkinter import messagebox
import threading, os
__author__: str = "R3nzTheCodeGOD"
__version__: str = "1.0.4"
window = tk.Tk()
client = Connector()
name = ""
buttonClick = False
window.title("ARAM Boost")
window.geometry("300x150")
window.minsize(300, 150)
window.maxsize(400, 200)
window.eval('tk::PlaceWindow . center')
window.configure(bg="#191970")
async def get_name(cmd) -> bool:
summoner = await cmd.request("GET", "/lol-summoner/v1/current-summoner")
if summoner.status == 200:
data: dict = await summoner.json()
global name
name = data['displayName']
status.configure(text=f"Status: Connecting [{name}]", fg="#ffff19")
return True
else: return False
async def boostBAS(cmd) -> None:
req = await cmd.request("POST", "/lol-champ-select/v1/team-boost/purchase")
if req.status == 204:
status.configure(text="Status: Activate Boost", fg="#19ff19")
elif req.status == 500:
status.configure(text="Status: Client hotfix is not applied", fg="#ff1919")
else:
status.configure(text="Status: You are not in champion pick", fg="#ff1919")
window.after(2500, lambda:status.configure(text=f"Status: Connecting [{name}]", fg="#ffff19"))
def click() -> None:
global buttonClick
buttonClick = True
def closeWindow() -> None:
window.destroy()
@client.ready
async def connectLOL(cmd) -> None:
global buttonClick
check = await get_name(cmd)
if check is False:
messagebox.showerror(title="Dick Error", message="There was a problem restart the program")
window.destroy()
while check:
if buttonClick:
await boostBAS(cmd)
buttonClick = False
header = tk.Label(window, text="R3nzTheCodeGOD", font=("Arial", 19), bg="#191970", fg="#ff961f")
header.pack(pady=5, padx=5)
button = tk.Button(window, text="Boost", font=("Arial", 12), bg="#ff961f", fg="#191970", bd=5, activebackground="#197019", activeforeground="#000000", width=10, height=2, command=click)
button.pack(pady=5, padx=5)
status = tk.Label(window, text="Status: waiting LOL...", font=("Arial", 10), bg="#191970", fg="#ffff19")
status.pack(pady=5, padx=5)
prcs = threading.Thread(target=client.start, daemon=True)
prcs.start()
window.protocol("WM_DELETE_WINDOW", closeWindow)
window.mainloop()