forked from NTUYWANG103/APEX_AIMBOT
-
Notifications
You must be signed in to change notification settings - Fork 1
/
csgo.py
30 lines (25 loc) · 1.17 KB
/
csgo.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
from AimBot import AimBot
import multiprocessing
import time
from mouse_driver.MouseMove import mouse_move
from pynput.mouse import Button, Listener, Controller
class CSGOAimBot(AimBot):
def __init__(self, config_path, onnx_path, engine_path):
super().__init__(config_path, onnx_path, engine_path)
self.controller = Controller()
def initialize_params(self):
super().initialize_params()
self.smooth = self.args.smooth * 2700 / self.args.resolution_x # default settings by game
def lock_target(self, target_sort_list):
if len(target_sort_list) > 0 and self.locking:
move_rel_x, move_rel_y, move_dis = self.get_move_dis(target_sort_list)
mouse_move(move_rel_x, move_rel_y) # //2 for solving the shaking problem when
print(move_dis)
if move_dis < self.args.max_shoot_dis:
self.controller.click(Button.left, 1)
self.pidx(0), self.pidy(0)
if __name__ == '__main__':
multiprocessing.freeze_support()
csgo = CSGOAimBot(config_path='configs/csgo.yaml', onnx_path='weights/best_csgo.onnx', engine_path='weights/best_csgo.trt')
while True:
data = csgo.forward()