-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
82 lines (69 loc) · 2.49 KB
/
main.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
from random import randint
import time
from pynput.keyboard import Key, Controller
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print("[SELECTOR] Please select one of the following options:\n"
"1. [RANDOM]\n"
"2. [RECURSIVE]\n"
"[Warning] Recursive mode will loop through the list of messages until the program is stopped.")
mode = input()
you_killed = []
you_died = []
you_killed_sentence_number = 0
you_died_sentence_number = 0
deaths = 0
kills = 0
in_game = True
f1 = open("kill_quote.txt", "r").read().splitlines()
for line in f1:
you_killed.append(line)
f2 = open("die_quote.txt", "r").read().splitlines()
for line in f2:
you_died.append(line)
def send_message(message):
keyboard.press(Key.enter)
keyboard.release(Key.enter)
time.sleep(0.02)
keyboard.type(message)
time.sleep(0.02)
keyboard.press(Key.enter)
keyboard.release(Key.enter)
time.sleep(0.02)
while 1:
keyboard = Controller()
try:
request_pseudo = requests.get('https://127.0.0.1:2999/liveclientdata/activeplayername', verify=False)
your_pseudo = request_pseudo.json()
response_API = requests.get(f'https://127.0.0.1:2999/liveclientdata/playerscores?summonerName={your_pseudo}',
verify=False)
statistics = response_API.json()
if request_pseudo and response_API and not in_game:
print("Executable found!")
in_game = True
new_kills = statistics['kills']
new_deaths = statistics['deaths']
if new_kills > kills:
kills = new_kills
if mode == 1:
send_message(you_killed[randint(0, len(you_killed) - 1)])
else:
if you_killed_sentence_number == len(you_killed) - 1:
you_killed_sentence_number = 0
send_message(you_killed[you_killed_sentence_number])
you_killed_sentence_number += 1
if new_deaths > deaths:
deaths = new_deaths
if mode == 1:
send_message(you_died[randint(0, len(you_died) - 1)])
else:
if you_died_sentence_number == len(you_died) - 1:
you_died_sentence_number = 0
send_message(you_died[you_died_sentence_number])
you_died_sentence_number += 1
time.sleep(1)
except:
if in_game:
print("Searching for game executable...")
in_game = False