This repository has been archived on 2023-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
csh/cheats/bhop.py

37 lines
1 KiB
Python
Raw Normal View History

2023-03-31 18:52:22 +02:00
from win32api import GetAsyncKeyState
from hack import Hack, sleep
class Bhop(Hack):
2023-04-01 16:11:56 +02:00
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
2023-03-31 18:52:22 +02:00
def bhop(self) -> None:
# Aliases
mem = self.pm
offset = self.offsets
# Get client
client = self.find_module("client")
# Get player
local_player = self.find_uint(client, offset["dwLocalPlayer"])
def cheat():
# Pressing space bar
if not GetAsyncKeyState(self.vmap["SPACE"]):
return
# Check if player is alive
2023-03-31 19:22:19 +02:00
if mem.read_uint(local_player + offset["m_lifeState"]):
2023-03-31 18:52:22 +02:00
return
# Check if player on ground
2023-05-05 16:04:06 +02:00
if int(mem.read_uint(local_player + offset["m_fFlags"])) & (1 << 0):
2023-03-31 18:52:22 +02:00
mem.write_uint(client + offset["dwForceJump"], 5)
sleep(0.01)
mem.write_uint(client + offset["dwForceJump"], 4)
self.hack_loop(cheat)