-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmain.py
49 lines (42 loc) · 1.65 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
import pyautogui
import os
from colorbot import Colorbot
from settings import Settings
class Main:
"""
The Main class initializes the application, sets up the necessary parameters,
and runs the Colorbot.
"""
def __init__(self):
"""
Initializes the Main class by setting up screen parameters and the Colorbot instance.
Attributes:
settings (Settings): The settings instance for reading configuration files.
monitor (tuple): The screen resolution.
center_x (int): The center X-coordinate of the screen.
center_y (int): The center Y-coordinate of the screen.
x_fov (int): The width of the capture area.
y_fov (int): The height of the capture area.
colorbot (Colorbot): The Colorbot instance for screen capturing and color detection.
"""
self.settings = Settings()
self.monitor = pyautogui.size()
self.center_x, self.center_y = self.monitor.width // 2, self.monitor.height // 2
self.x_fov = self.settings.get_int('Aimbot', 'xFov')
self.y_fov = self.settings.get_int('Aimbot', 'yFov')
self.colorbot = Colorbot(
self.center_x - self.x_fov // 2,
self.center_y - self.y_fov // 2,
self.x_fov,
self.y_fov
)
def run(self):
"""
Prints the application title and color settings, then starts the Colorbot.
"""
os.system('cls')
os.system('title github.com/iamennui/ValorantArduinoColorbot')
print('Enemy Outline Color: Purple')
self.colorbot.listen()
if __name__ == '__main__':
Main().run()