From e9944657c7ddefb3b8d2c8373c97fa47629ea1b8 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 17:22:25 +0100 Subject: Triggerbot: crosshair entity trace, hostile-only - top-level Triggerbot feature (Active + Bind, default Mouse4, rebindable) - trace the crosshair ray from the eye with MASK_SHOT and TRACE_EVERYTHING; the filter ignores the local player - if the first entity hit is a live hostile NPC, press IN_ATTACK and fix the usercmd CRC; walls/props/friendly/neutral/corpses do not trigger - independent of Aimbot; config [triggerbot] active/bind --- src/esp.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/esp.cpp') diff --git a/src/esp.cpp b/src/esp.cpp index 2c033ea..e6981f7 100644 --- a/src/esp.cpp +++ b/src/esp.cpp @@ -516,6 +516,59 @@ bool aimbot_apply(CUserCmd *cmd) { return true; } +bool triggerbot_apply(CUserCmd *cmd) { + if (!g_iface.enginetrace || !g_iface.entitylist) + return false; + int local = engine_get_local_player(); + if (local <= 0) + return false; + void *local_ent = entitylist_get(local); + if (!local_ent) + return false; + if (g_net.health >= 0 && + *(int *)((uintptr_t)local_ent + g_net.health) <= 0) + return false; + + QAngle view{cmd->viewangles[0], cmd->viewangles[1], 0.0f}; + Vector fwd = angle_forward_vector(view); + Vector start = g_cam_eye; + Vector end{start.x + fwd.x * 8192.0f, start.y + fwd.y * 8192.0f, + start.z + fwd.z * 8192.0f}; + void *hit = trace_entity(start, end, local_ent); + if (!hit) + return false; + + using Fn = int (*)(void *); + int hi = vfunc(g_iface.entitylist, 6)(g_iface.entitylist); + if (hi < 0 || hi > 4096) + hi = 4096; + for (int idx = 1; idx <= hi; idx++) { + if (entitylist_get(idx) != hit) + continue; + void *net = entity_networkable(idx); + const char *cls = net ? entity_class_name(net, nullptr) : nullptr; + if (!cls || !is_npc_class(cls)) + return false; + uintptr_t e = (uintptr_t)hit; + int life = g_net.lifestate >= 0 + ? (int)*(unsigned char *)(e + g_net.lifestate) + : -1; + if (life != LIFE_ALIVE) + return false; + const char *model = entity_model_name(hit); + if (model_is_friendly(model) || model_is_neutral(model)) + return false; + cmd->buttons |= IN_ATTACK; + static int logs = 0; + if (logs < 5) { + logs++; + logf("triggerbot: fire idx=%d model=%s", idx, model ? model : "?"); + } + return true; + } + return false; +} + void esp_draw() { if (!g_surface || !g_iface.entitylist || !g_net.esp_ok()) return; if (!g_scr_w) { -- cgit v1.2.3