move angle calculation to aimbot file

This commit is contained in:
Mylloon 2023-03-31 19:48:21 +02:00
parent 918e0e4774
commit 42f6a41600
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
from win32api import GetAsyncKeyState
from hack import Hack
from utils import Vec, angle_fixer, calculate_angle, hypot
from utils import Vec, angle_fixer, hypot
class Aimbot(Hack):
@ -133,3 +133,8 @@ class Aimbot(Hack):
client_state + offset["dwClientState_ViewAngles"] + offset["float"], final_angle.y)
self.hack_loop(cheat)
def calculate_angle(local_pos: Vec, ennemy_pos: Vec, angles: Vec) -> Vec:
"""Angle calculation for aimbot"""
return ((ennemy_pos.minus(local_pos).to_angle().minus(angles)))

View file

@ -96,11 +96,6 @@ class Vec:
return xy and float(self.z) == 0.
def calculate_angle(local_pos: Vec, ennemy_pos: Vec, angles: Vec) -> Vec:
"""Angle calculation for aimbot"""
return ((ennemy_pos.minus(local_pos).to_angle().minus(angles)))
def angle_fixer(angle: Vec) -> Vec:
"""Force the angle to respect game limitation"""
# Limit of pitch in game is ]-89; 180[