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,015 B
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):
def __init__(self) -> None:
super().__init__()
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
if mem.read_uint(local_player + offset["m_fFlags"]) & (1 << 0):
mem.write_uint(client + offset["dwForceJump"], 5)
sleep(0.01)
mem.write_uint(client + offset["dwForceJump"], 4)
self.hack_loop(cheat)