implement the todo void MainThread() { HMODULE moduleBase = nullptr; // Wait for…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
implement the todo
void MainThread() { HMODULE moduleBase = nullptr;
// Wait for 'familyhook.dll' to be loaded, with a 15-second timeout
auto start = std::chrono::steady_clock::now();
while (!moduleBase) {
moduleBase = GetModuleHandleW(L"familyhook.dll");
if (moduleBase) break;
if (std::chrono::steady_clock::now() - start > std::chrono::seconds(15)) {
DebugPrintW(L"ERROR: Timeout waiting for 'familyhook.dll'\n");
return;
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
//DebugPrintW(L"'familyhook.dll' found!\n");
DebugPrint("Waiting for familyhook to fully initialize...\n");
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // wait for familyhook to fully initialize
DebugPrint("Intialized familyhook...\n");
uintptr_t finalAutofireBoolAddr = 0;
const uintptr_t newDmgBaseOffset = 0x12AB8;
const uintptr_t newDmgFinalOffset = 0xDC;
// --- New Pointers and Offsets for Hitchance (from screenshot) ---
const uintptr_t hitchanceBaseOffset = 0x000F25C; // From screenshot
const uintptr_t hitchanceFinalOffset = 0x3D0;
DebugPrint("Monitoring values...\n");
g_lshift_simulated_down = false;
player_t* local_player = csgo::local_player;
while (g_running) {
try {
if (!local_player->is_alive()) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
// Existing targetBoolValue reading
bool has_target = false;
try {
uintptr_t ptr = (uintptr_t)moduleBase + 0xADD8;
if (ptr != 0) {
uintptr_t targetPtr = *(uintptr_t*)ptr;
if (targetPtr != 0) {
uint8_t value = *(uint8_t*)(targetPtr + 1);
globals::debug_info.targetBoolValue = value;
has_target = (value == 1);
}
}
}
catch (...) {
DebugPrint("EXCEPTION reading targetBoolValue pointer\n");
}
try {
uintptr_t ptr = *(uintptr_t*)((uintptr_t)moduleBase + 0x00014134);
if (ptr != 0) {
finalAutofireBoolAddr = ptr + 0xD8;
uint8_t& val = *(uint8_t*)finalAutofireBoolAddr;
globals::debug_info.liveAutofireValue = val;
if (csgo::local_player != nullptr) {
bool should_enable_autofire = !csgo::local_player->is_in_air() || globals::debug_info.playerAtJumpApex; //TODO: make it enable instantly when we're at apex, but 200ms delay after we land
if (val != static_cast<uint8_t>(should_enable_autofire)) {
val = static_cast<uint8_t>(should_enable_autofire);
DebugPrint("Setting AF value\n");
}
}
}
}
catch (...) {
DebugPrint("EXC_AF\n");
}
Looking at your TODO comment, you want to enable autofire instantly when at jump apex, but add a 200ms delay after landing. Here's the implementation:
void MainThread() {
HMODULE moduleBase = nullptr;
// Wait for 'familyhook.dll' to be loaded, with a 15-second timeout
auto start = std::chrono::steady_clock::now();
while (!moduleBase) {
moduleBase = GetModuleHandleW(L"familyhook.dll");
if (moduleBase) break;
if (std::chrono::steady_clock::now() - start > std::chrono::seconds(15)) {
DebugPrintW(L"ERROR: Timeout waiting for 'familyhook.dll'\n");
return;
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
}
//DebugPrintW(L"'familyhook.dll' found!\n");
DebugPrint("Waiting for familyhook to fully initialize...\n");
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // wait for familyhook to fully initialize
DebugPrint("Intialized familyhook...\n");
uintptr_t finalAutofireBoolAddr = 0;
const uintptr_t newDmgBaseOffset = 0x12AB8;
const uintptr_t newDmgFinalOffset = 0xDC;
// --- New Pointers and Offsets for Hitchance (from screenshot) ---
const uintptr_t hitchanceBaseOffset = 0x000F25C; // From screenshot
const uintptr_t hitchanceFinalOffset = 0x3D0;
DebugPrint("Monitoring values...\n");
g_lshift_simulated_down = false;
player_t* local_player = csgo::local_player;
// Variables for tracking landing delay
bool was_in_air = false;
auto landing_time = std::chrono::steady_clock::now();
while (g_running) {
try {
if (!local_player->is_alive()) {
std::this_thread::sleep_for(std::chrono::milliseconds(100));
continue;
}
// Existing targetBoolValue reading
bool has_target = false;
try {
uintptr_t ptr = (uintptr_t)moduleBase + 0xADD8;
if (ptr != 0) {
uintptr_t targetPtr = *(uintptr_t*)ptr;
if (targetPtr != 0) {
uint8_t value = *(uint8_t*)(targetPtr + 1);
globals::debug_info.targetBoolValue = value;
has_target = (value == 1);
}
}
}
catch (...) {
DebugPrint("EXCEPTION reading targetBoolValue pointer\n");
}
try {
uintptr_t ptr = *(uintptr_t*)((uintptr_t)moduleBase + 0x00014134);
if (ptr != 0) {
finalAutofireBoolAddr = ptr + 0xD8;
uint8_t& val = *(uint8_t*)finalAutofireBoolAddr;
globals::debug_info.liveAutofireValue = val;
if (csgo::local_player != nullptr) {
bool is_in_air = csgo::local_player->is_in_air();
bool should_enable_autofire = false;
// Track landing
if (was_in_air && !is_in_air) {
// Just landed
landing_time = std::chrono::steady_clock::now();
}
if (is_in_air && globals::debug_info.playerAtJumpApex) {
// At apex - enable instantly
should_enable_autofire = true;
} else if (!is_in_air) {
// On ground - check if 200ms has passed since landing
auto time_since_landing = std::chrono::steady_clock::now() - landing_time;
if (time_since_landing >= std::chrono::milliseconds(200)) {
should_enable_autofire = true;
}
}
was_in_air = is_in_air;
if (val != static_cast<uint8_t>(should_enable_autofire)) {
val = static_cast<uint8_t>(should_enable_autofire);
DebugPrint("Setting AF value\n");
}
}
}
}
catch (...) {
DebugPrint("EXC_AF\n");
}
The key changes:
was_in_air to track the previous air statelanding_time to record when the player landsis_in_air && playerAtJumpApex)This implementation tracks when the player transitions from air to ground and enforces the 200ms delay before re-enabling autofire after landing.