-
Notifications
You must be signed in to change notification settings - Fork 41
/
AIMr.py
184 lines (155 loc) · 5.54 KB
/
AIMr.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
import os
import json
import time
import shutil
import zipfile
import subprocess
import urllib.request
try:
newest_version = "https://raw.githubusercontent.com/ai-aimbot/AIMr/main/current_version.txt"
req = urllib.request.Request(newest_version, headers={'Cache-Control': 'no-cache'})
response = urllib.request.urlopen(req)
remote_version = response.read().decode().strip()
file_paths = [
"./library.py",
"./yolo.cfg",
"./yolo.weights",
"./req.txt",
"./LICENSE",
"./README.md",
"./current_version.txt",
"./lang.json",
"./AIMr.ico",
"./AIMr.py",
"./theme.json",
"./config.py",
]
localv_path = "localv.json"
config_path = "config.json"
if not os.path.exists(localv_path) or not os.path.exists(config_path) or not os.path.exists(file_paths[1]):
local_version = "0.0.0"
data = {
"version": remote_version,
"pip": False,
"python": True,
"language": "english",
"first_launch": True,
"activated": False
}
with open(localv_path, "w") as file:
json.dump(data, file)
config = {
"aimbot": True,
"detection": True,
"pinned": True,
"shoot": True,
"aimkey": "e",
"trigkey": "e",
"trigdelay": "50",
"side": 2.0,
"smoothness": 5.0,
"fov": 3,
"rpc": True,
}
with open(config_path, "w") as configfile:
json.dump(config, configfile)
else:
with open(localv_path, "r") as file:
data = json.load(file)
local_version = data["version"]
with open(localv_path, "r") as file:
data = json.load(file)
activated = data["activated"]
if activated is not True:
def check_string(string):
numbers_count = sum(c.isdigit() for c in string)
symbols_count = sum(not c.isalnum() for c in string)
charcount = len(string)
if numbers_count == 5 and symbols_count == 2 and charcount == 16:
return True
else:
return False
print("AIMr is not activated. Please go to https://is.gd/a8yJ7f to get your one time activation key!")
key = input("Enter your key: ")
if check_string(key):
print("Thank you for activating, AIMr will now install!")
else:
print("Please enter a valid key.")
exit()
with open("localv.json", "w") as file:
data["activated"] = True
json.dump(data, file)
with open("localv.json", "r") as file:
data2 = json.load(file)
first_launch = data["first_launch"]
if first_launch is not True:
with open("localv.json", "r") as file:
data2 = json.load(file)
pip = data["pip"]
if pip is not True:
print("Installing required modules...")
os.system("pip install -r req.txt")
os.system("pip3 install -r req.txt")
with open("localv.json", "w") as file:
data2["pip"] = True
json.dump(data2, file)
os.remove(file_paths[3])
if remote_version != local_version:
with open("localv.json", "w") as file:
data2["pip"] = False
json.dump(data2, file)
print("Deleting old files...")
for file_path in file_paths:
if os.path.exists(file_path):
try:
os.remove(file_path)
except Exception as e:
print(f"Error occurred while removing {file_path}: {e}")
print("Downloading AIMr...")
# Download the zip file
url = "https://codeload.github.com/ai-aimbot/AIMr/zip/refs/heads/main"
response = urllib.request.urlopen(url)
zip_content = response.read()
# Save the zip file
with open("ai-aimbot-main.zip", "wb") as file:
file.write(zip_content)
print("Unzipping...")
# Unzip the file
with zipfile.ZipFile("ai-aimbot-main.zip", "r") as zip_ref:
zip_ref.extractall("ai-aimbot-main")
os.remove("ai-aimbot-main.zip")
print("Moving files...")
# Move files from ai-aimbot/ to current directory
for root, dirs, files in os.walk("ai-aimbot-main"):
for file in files:
shutil.move(os.path.join(root, file), os.path.join(".", file))
# Remove ai-aimbot-testing/ directory
shutil.rmtree("ai-aimbot-main")
os.remove(file_paths[4])
os.remove(file_paths[5])
with open("localv.json", "w") as file:
data["version"] = remote_version
json.dump(data, file)
with open("localv.json", "w") as file:
data["first_launch"] = False
json.dump(data, file)
print("Please relaunch AIMr...")
time.sleep(5)
exit()
def clear_terminal():
if os.name == "nt":
os.system("cls")
else:
os.system("clear")
clear_terminal()
option = True if input("Do you want to launch AIMr or change your config? (1/2): ").lower() == "1" else False
if option:
subprocess.run(["python", "library.py"])
else:
subprocess.run(["python", "config.py"])
except KeyboardInterrupt:
exit()
except Exception as e:
print(f"An error occurred: {e}")
# Wait for 15 seconds before closing
time.sleep(15)