From c29e165cd2a4983c8d9efcd73db50d7d9bd9c177 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 30 Mar 2023 23:44:47 +0200 Subject: [PATCH] optimizations --- cheat.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cheat.py b/cheat.py index 7692f3d..92e8900 100644 --- a/cheat.py +++ b/cheat.py @@ -64,7 +64,7 @@ class Cheat(Hack): def cheat(): # Loop all entities - for i in range(1, 64): # 0 is world + for i in range(1, 32): # 0 is world entity = mem.read_uint( client + offset["dwEntityList"] + i * offset["entity_size"]) @@ -104,7 +104,7 @@ class Cheat(Hack): def cheat(): # Loop all entities - for i in range(1, 64): # 0 is world + for i in range(1, 32): # 0 is world entity = mem.read_uint( client + offset["dwEntityList"] + i * offset["entity_size"]) @@ -124,12 +124,10 @@ class Cheat(Hack): i = mem.read_int( entity + offset["m_iGlowIndex"]) * offset["glow_obj_size"] - # TODO: Reduce write call - # 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_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 @@ -211,8 +209,6 @@ class Cheat(Hack): self.nr__old_punch_y = 0. def cheat(): - # TODO: Reduce read/write call - # Check if player is shooting if mem.read_int(local_player + offset["m_iShotsFired"]): client_state = mem.read_uint(engine + offset["dwClientState"]) @@ -259,7 +255,6 @@ class Cheat(Hack): else: # Not spraying - # TODO: Reset to middle? self.nr__old_punch_x = 0. self.nr__old_punch_y = 0. @@ -284,7 +279,7 @@ class Cheat(Hack): mem = self.pm offset = self.offsets - # Get module addresses + # Get module address client = self.find_module("client") # Get local player