This commit is contained in:
Oscar
2025-07-22 22:06:34 +03:00
parent d3c189f949
commit f892794557
780 changed files with 436498 additions and 170 deletions

View File

@@ -32,67 +32,137 @@ void SimulateLMBUp() {
SendInput(1, &input, sizeof(INPUT));
}
// Управление удержанием ЛКМ
void SetLMBHeld(bool held) {
static bool lmbHeld = false;
if (held && !lmbHeld) {
SimulateLMBDown();
lmbHeld = true;
} else if (!held && lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
}
static DWORD lastShotTime = 0;
void Triggerbot() {
static DWORD lastShotTime = 0;
static bool lmbHeld = false;
static bool firstShot = true;
// --- Альтернативная кнопка: триггербот по наведению на врага с задержкой ---
if (Config::triggerbot_alt_key && (GetAsyncKeyState(Config::triggerbot_alt_key) & 0x8000)) {
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
if (!lp || lp->getHealth() <= 0) { SetLMBHeld(false); return; }
int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
if (crosshairIdx <= 0) { SetLMBHeld(false); return; }
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
if (!target) { SetLMBHeld(false); return; }
if (target->getHealth() <= 0) { SetLMBHeld(false); return; }
if (Config::team_check && target->getTeam() == lp->getTeam()) { SetLMBHeld(false); return; }
DWORD64 now = GetTickCount64();
static DWORD64 lastAltShotTime = 0;
if (now - lastAltShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
SetLMBHeld(false);
return;
}
SimulateLMBClick();
lastAltShotTime = now;
return;
}
if (!Config::triggerbot)
return;
if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000))
if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
SetLMBHeld(false);
firstShot = true;
return;
}
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
SetLMBHeld(false);
firstShot = true;
return;
}
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
if (!lp || lp->getHealth() <= 0) { firstShot = true; return; }
if (!lp || lp->getHealth() <= 0) { firstShot = true; SetLMBHeld(false); return; }
int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
//g_DebugString = "debug: " + std::to_string(crosshairIdx);
if (crosshairIdx <= 0) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
int shotsFired = lp ? lp->getShotsFired() : 0;
DWORD64 now = GetTickCount64();
if (Config::shooterAfterAim) {
if (shotsFired > 0) {
// После первого выстрела просто удерживаем ЛКМ, игнорируя все условия
SetLMBHeld(true);
return;
} else {
// До первого выстрела — обычная логика триггербота
if (crosshairIdx <= 0) {
SetLMBHeld(false);
firstShot = true;
return;
}
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
if (!target) {
SetLMBHeld(false);
firstShot = true;
return;
}
if (target->getHealth() <= 0) {
SetLMBHeld(false);
firstShot = true;
return;
}
if (Config::team_check && target->getTeam() == lp->getTeam()) {
SetLMBHeld(false);
firstShot = true;
return;
}
if (!Config::triggerbot_hold_lmb) {
if (now - lastShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
SetLMBHeld(false);
firstShot = true;
return;
}
}
if (Config::triggerbot_hold_lmb) {
if (firstShot) {
SimulateLMBClick();
firstShot = false;
lastShotTime = now;
return;
} else {
SetLMBHeld(true);
}
lastShotTime = now;
return;
}
SimulateLMBClick();
lastShotTime = now;
firstShot = true;
return;
}
}
// --- Обычная логика триггербота, если shooterAfterAim выключен ---
if (crosshairIdx <= 0) {
SetLMBHeld(false);
firstShot = true;
return;
}
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
if (!target) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
SetLMBHeld(false);
firstShot = true;
return;
}
if (target->getHealth() <= 0) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
SetLMBHeld(false);
firstShot = true;
return;
}
if (Config::team_check && target->getTeam() == lp->getTeam()) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
SetLMBHeld(false);
firstShot = true;
return;
}
DWORD64 now = GetTickCount64();
if (!Config::triggerbot_hold_lmb) {
if (now - lastShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
if (lmbHeld) {
SimulateLMBUp();
lmbHeld = false;
}
SetLMBHeld(false);
firstShot = true;
return;
}
@@ -103,9 +173,8 @@ void Triggerbot() {
firstShot = false;
lastShotTime = now;
return;
} else if (!lmbHeld) {
SimulateLMBDown();
lmbHeld = true;
} else {
SetLMBHeld(true);
}
lastShotTime = now;
return;