move angle calculation to aimbot file
This commit is contained in:
parent
918e0e4774
commit
42f6a41600
2 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
from win32api import GetAsyncKeyState
|
from win32api import GetAsyncKeyState
|
||||||
|
|
||||||
from hack import Hack
|
from hack import Hack
|
||||||
from utils import Vec, angle_fixer, calculate_angle, hypot
|
from utils import Vec, angle_fixer, hypot
|
||||||
|
|
||||||
|
|
||||||
class Aimbot(Hack):
|
class Aimbot(Hack):
|
||||||
|
@ -133,3 +133,8 @@ class Aimbot(Hack):
|
||||||
client_state + offset["dwClientState_ViewAngles"] + offset["float"], final_angle.y)
|
client_state + offset["dwClientState_ViewAngles"] + offset["float"], final_angle.y)
|
||||||
|
|
||||||
self.hack_loop(cheat)
|
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)))
|
||||||
|
|
5
utils.py
5
utils.py
|
@ -96,11 +96,6 @@ class Vec:
|
||||||
return xy and float(self.z) == 0.
|
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:
|
def angle_fixer(angle: Vec) -> Vec:
|
||||||
"""Force the angle to respect game limitation"""
|
"""Force the angle to respect game limitation"""
|
||||||
# Limit of pitch in game is ]-89; 180[
|
# Limit of pitch in game is ]-89; 180[
|
||||||
|
|
Reference in a new issue