37 lines
1,017 B
Python
37 lines
1,017 B
Python
|
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
|
||
|
if not mem.read_uint(local_player + offset["m_iHealth"]):
|
||
|
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)
|