From 64cbbe9b5866763233b0e37e7242d0a1f0042048 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 30 Mar 2023 16:10:55 +0200 Subject: [PATCH] fixes and notice that its not working --- main.py | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/main.py b/main.py index 99e209a..de6979c 100644 --- a/main.py +++ b/main.py @@ -279,8 +279,16 @@ class Cheat(Hack): # Get local player local_player = self.find_uint(client, offset["dwLocalPlayer"]) - old_punch_x = 0. - old_punch_y = 0. + # Float size + float_offset = 4 + + # Control variable + self.nr__old_punch_x = 0. + self.nr__old_punch_y = 0. + + # TMP NOTICE + print("This one isn't working.") + exit(2) def cheat(): # TODO: Reduce read/write call @@ -289,31 +297,32 @@ class Cheat(Hack): if mem.read_int(local_player + offset["m_iShotsFired"]): client_state = mem.read_uint(engine + offset["dwClientState"]) - # 4 = offset of integer - - # view angle + # Where player is looking view_angles_x = mem.read_float( client_state + offset["dwClientState_ViewAngles"]) view_angles_y = mem.read_float( - client_state + offset["dwClientState_ViewAngles"] + 4) + client_state + offset["dwClientState_ViewAngles"] + float_offset) + # Server multiple punch by 2 server_mult = 2. - # recoil + # How much the view is modified aim_punch_x = mem.read_float( client_state + offset["m_aimPunchAngle"]) * server_mult - aim_punch_y = mem.read_float( - client_state + offset["m_aimPunchAngle"] + 4) * server_mult + aim_punch_y = mem.read_int( + client_state + offset["m_aimPunchAngle"] + float_offset) * server_mult # New angles - new_angle_x = view_angles_x + old_punch_x - aim_punch_x - new_angle_y = view_angles_y + old_punch_y - aim_punch_y + new_angle_x = view_angles_x + self.nr__old_punch_x - aim_punch_x + new_angle_y = view_angles_y + self.nr__old_punch_y - aim_punch_y - # Sanity check + # Limit of pitch in game is ]-89; 180[ if new_angle_x > 89.: new_angle_x = 89. if new_angle_x < -89.: new_angle_x = -89 + + # Limit of yaw in game is ]-180; 360[ while (new_angle_y > 180.): new_angle_y -= 360. while (new_angle_y < -180.): @@ -323,15 +332,16 @@ class Cheat(Hack): mem.write_float( client_state + offset["dwClientState_ViewAngles"], new_angle_x) mem.write_float( - client_state + offset["dwClientState_ViewAngles"] + 4, new_angle_y) + client_state + offset["dwClientState_ViewAngles"] + float_offset, new_angle_y) - old_punch_x = aim_punch_x - old_punch_y = aim_punch_y + self.nr__old_punch_x = aim_punch_x + self.nr__old_punch_y = aim_punch_y else: # Not spraying - old_punch_x = 0. - old_punch_y = 0. + self.nr__old_punch_x = 0. + self.nr__old_punch_y = 0. + pass self.hack_loop(cheat)