65 lines
2.2 KiB
Python
65 lines
2.2 KiB
Python
from hack import Hack
|
|
|
|
|
|
class Glow(Hack):
|
|
def __init__(self) -> None:
|
|
super().__init__()
|
|
|
|
def glow(self) -> None:
|
|
# Aliases
|
|
mem = self.pm
|
|
offset = self.offsets
|
|
|
|
# Get module address
|
|
client = self.find_module("client")
|
|
|
|
# Get local player
|
|
local_player = self.find_uint(client, offset["dwLocalPlayer"])
|
|
|
|
# Get local team
|
|
local_team = self.find_uint(local_player, offset["m_iTeamNum"])
|
|
|
|
# Get glow object manager
|
|
glow_obj_manager = self.find_uint(
|
|
client, offset["dwGlowObjectManager"])
|
|
|
|
def cheat():
|
|
# Loop all entities
|
|
for i in range(1, 32): # 0 is world
|
|
entity = mem.read_uint(
|
|
client + offset["dwEntityList"] + i * offset["entity_size"])
|
|
|
|
# Ignore if entity doesn't exist
|
|
if not entity:
|
|
continue
|
|
|
|
# Ignore allies
|
|
if mem.read_uint(entity + offset["m_iTeamNum"]) == local_team:
|
|
continue
|
|
|
|
# Ignore dormant
|
|
if mem.read_bool(entity + offset["m_bDormant"]):
|
|
continue
|
|
|
|
# Check if ennemy is alive
|
|
if mem.read_int(entity + offset["m_lifeState"]):
|
|
continue
|
|
|
|
# Space between values
|
|
i = mem.read_int(
|
|
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"], 1.)
|
|
|
|
# Render when not visible
|
|
mem.write_bool(glow_obj_manager + i + offset["GOM_wall"], True)
|
|
|
|
# Render when visible
|
|
mem.write_bool(glow_obj_manager + i +
|
|
offset["GOM_visible"], True)
|
|
|
|
self.hack_loop(cheat)
|