refactorization
This commit is contained in:
parent
616f6ddd6c
commit
93e01d2637
6 changed files with 62 additions and 15 deletions
|
@ -8,6 +8,12 @@ class Aimbot(Hack):
|
|||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
# AimBot FOV, higher = more aggressive
|
||||
self.__fov_range = 5.
|
||||
|
||||
# Smoothing, more = less efficient
|
||||
self.__smoothing = 3.
|
||||
|
||||
def aimbot(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
|
@ -61,8 +67,7 @@ class Aimbot(Hack):
|
|||
local_player + offset["m_aimPunchAngle"] + offset["float"])
|
||||
).times(2.) # server multiple punch by 2
|
||||
|
||||
# AimBot FOV, higher = more aggressive
|
||||
best_fov = 5.
|
||||
best_fov = self.__fov_range
|
||||
best_angle = Vec()
|
||||
|
||||
# Loop all entities
|
||||
|
@ -119,8 +124,8 @@ class Aimbot(Hack):
|
|||
|
||||
# We found an ennemy to aim at
|
||||
if not best_angle.is_zero():
|
||||
# Smoothing, more = less efficient
|
||||
best_angle = best_angle.div(3.)
|
||||
if self.__smoothing > 0.:
|
||||
best_angle = best_angle.div(self.__smoothing)
|
||||
|
||||
final_angle = view_angles.plus(best_angle)
|
||||
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
from hack import Hack
|
||||
from struct import pack
|
||||
|
||||
from hack import Hack
|
||||
from utils import Color3i
|
||||
|
||||
|
||||
class Chams(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.__color = Color3i(255, 255, 0)
|
||||
|
||||
def chams(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
|
@ -45,10 +49,15 @@ class Chams(Hack):
|
|||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_R"], 255)
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_G"], 255)
|
||||
if self.__color.r > 0:
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_R"], self.__color.r)
|
||||
if self.__color.g > 0:
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_G"], self.__color.g)
|
||||
if self.__color.b > 0:
|
||||
mem.write_uint(
|
||||
entity + offset["m_clrRender"] + offset["render_B"], self.__color.b)
|
||||
|
||||
brightness = 5.
|
||||
mem.write_int(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from hack import Hack
|
||||
from win32api import GetAsyncKeyState
|
||||
|
||||
from hack import Hack
|
||||
|
||||
|
||||
class Fov(Hack):
|
||||
def __init__(self) -> None:
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
from hack import Hack
|
||||
from utils import Color4f
|
||||
|
||||
|
||||
class Glow(Hack):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.__color = Color4f(1., 0., 0., .8)
|
||||
|
||||
def glow(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
|
@ -47,10 +50,18 @@ class Glow(Hack):
|
|||
entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"]
|
||||
|
||||
# Change color glow
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_R"], 1.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_G"], 0.)
|
||||
# mem.write_float(glow_obj_manager + i + offset["glow_B"], 0.)
|
||||
mem.write_float(glow_obj_manager + i + offset["glow_A"], .8)
|
||||
if self.__color.r > 0.:
|
||||
mem.write_float(glow_obj_manager + i +
|
||||
offset["glow_R"], self.__color.r)
|
||||
if self.__color.g > 0.:
|
||||
mem.write_float(glow_obj_manager + i +
|
||||
offset["glow_G"], self.__color.g)
|
||||
if self.__color.b > 0.:
|
||||
mem.write_float(glow_obj_manager + i +
|
||||
offset["glow_B"], self.__color.b)
|
||||
if self.__color.a > 0.:
|
||||
mem.write_float(glow_obj_manager + i +
|
||||
offset["glow_A"], self.__color.a)
|
||||
|
||||
# Render when not visible
|
||||
mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True)
|
||||
|
|
|
@ -5,6 +5,8 @@ class Noflash(Hack):
|
|||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
self.__brightness = 30.
|
||||
|
||||
def noflash(self) -> None:
|
||||
# Aliases
|
||||
mem = self.pm
|
||||
|
@ -17,7 +19,7 @@ class Noflash(Hack):
|
|||
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
||||
|
||||
def cheat():
|
||||
mem.write_float(local_player + offset["m_flFlashMaxAlpha"], 30.)
|
||||
mem.write_float(local_player + offset["m_flFlashMaxAlpha"], self.__brightness)
|
||||
|
||||
# Value only overrided on first flash or when server fullupdate
|
||||
sleep(10)
|
||||
|
|
19
utils.py
19
utils.py
|
@ -111,3 +111,22 @@ def angle_fixer(angle: Vec) -> Vec:
|
|||
angle.y += 360.
|
||||
|
||||
return angle
|
||||
|
||||
|
||||
class Color3i:
|
||||
"""Color RGB as integer"""
|
||||
|
||||
def __init__(self, r: int, g: int, b: int) -> None:
|
||||
self.r = r
|
||||
self.g = g
|
||||
self.b = b
|
||||
|
||||
|
||||
class Color4f:
|
||||
"""Color RGBA as float"""
|
||||
|
||||
def __init__(self, r: float, g: float, b: float, a: float) -> None:
|
||||
self.r = r
|
||||
self.g = g
|
||||
self.b = b
|
||||
self.a = a
|
||||
|
|
Reference in a new issue