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/menu.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index d26b62e..585695c 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -61,6 +61,7 @@ static bool g_bhop_autostrafe = true; static FeatureState g_abh{true, 0}; static FeatureState g_esp{true, 0}; static FeatureState g_aimbot{true, 604}; // default Mouse5, rebindable in menu +static FeatureState g_triggerbot{true, 603}; // default Mouse4 // Aimbot bone checklist. Head defaults on (v1 behaviour). enum { @@ -113,6 +114,9 @@ static MenuNode g_aimbot_bone_nodes[AIM_BONE_COUNT] = { }; static MenuNode g_aimbot_smooth_node{NODE_VALUE, "Smoothness", false, 0, {}, nullptr, nullptr, nullptr, &g_aim_smooth, 1, 45, 1}; +static MenuNode g_triggerbot_feat{NODE_FEATURE, "Triggerbot", false, 1, {}, nullptr, nullptr, nullptr}; +static MenuNode g_triggerbot_active{NODE_TOGGLE, "Active", false, 0, {}, &g_triggerbot.active, nullptr, nullptr}; +static MenuNode g_triggerbot_bind{NODE_BIND, "Bind", false, 0, {}, nullptr, &g_triggerbot.bind, nullptr}; static MenuNode *g_visible[32]; // flattened visible nodes for arrow navigation static int g_visible_count = 0; @@ -135,6 +139,9 @@ static void build_tree() { for (int i = 0; i < AIM_BONE_COUNT; i++) g_aimbot_bones_feat.children[i] = &g_aimbot_bone_nodes[i]; g_aimbot_bones_feat.child_count = AIM_BONE_COUNT; + g_triggerbot_feat.children[0] = &g_triggerbot_active; + g_triggerbot_feat.children[1] = &g_triggerbot_bind; + g_triggerbot_feat.child_count = 2; for (int i = 0; i < ESP_OPT_COUNT; i++) g_esp_feat.children[i + 1] = &g_esp_opt_nodes[i]; g_esp_feat.child_count = ESP_OPT_COUNT + 1; @@ -142,7 +149,8 @@ static void build_tree() { g_root.children[1] = &g_abh_feat; g_root.children[2] = &g_esp_feat; g_root.children[3] = &g_aimbot_feat; - g_root.child_count = 4; + g_root.children[4] = &g_triggerbot_feat; + g_root.child_count = 5; } static int g_depth[32]; // depth of each visible row (for indentation) @@ -214,6 +222,8 @@ static void config_save() { g_aim_bones[AIM_BONE_HEAD], g_aim_bones[AIM_BONE_TORSO], g_aim_bones[AIM_BONE_LARM], g_aim_bones[AIM_BONE_RARM], g_aim_bones[AIM_BONE_LLEG], g_aim_bones[AIM_BONE_RLEG]); + fprintf(f, "[triggerbot]\nactive=%d\nbind=%d\n", g_triggerbot.active, + g_triggerbot.bind); fprintf(f, "[esp]\nactive=%d\nbind=%d\nneutral=%d\nhealthbar=%d\n" "healthnum=%d\nname=%d\nskeleton=%d\nbox=%d\n", g_esp.active, g_esp.bind, g_esp_opt[ESP_OPT_SHOW_NEUTRAL], @@ -241,6 +251,8 @@ static void config_load() { cur = &g_esp; else if (strstr(line, "[aimbot]")) cur = &g_aimbot; + else if (strstr(line, "[triggerbot]")) + cur = &g_triggerbot; else cur = nullptr; in_esp = (cur == &g_esp); @@ -401,8 +413,9 @@ static bool key_pressed(int sc) { // feature gate queried from hl2h.cpp do_move(): feature must be Active AND // its bind key held (always-on when unbound). bool feature_active(int feature) { - static FeatureState *feats[4] = {&g_bhop, &g_abh, &g_esp, &g_aimbot}; - if (feature < 0 || feature > 3) + static FeatureState *feats[5] = {&g_bhop, &g_abh, &g_esp, &g_aimbot, + &g_triggerbot}; + if (feature < 0 || feature > 4) return false; FeatureState *f = feats[feature]; if (!f->active) @@ -479,7 +492,7 @@ static void menu_handle_input() { MenuNode *n = g_visible[g_selected]; if (n->bind_ptr) { // clear same bind from other features - FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot}; + FeatureState *features[] = {&g_bhop, &g_abh, &g_aimbot, &g_triggerbot}; for (auto *f : features) if (&f->bind != n->bind_ptr && f->bind == i) f->bind = 0; @@ -694,10 +707,11 @@ void outer_draw() { draw_text(270, 10 + i * 20, "[press key]"); else { /* stable name for current bind */ - static char bn[3][32]; - static FeatureState *feats[] = {&g_bhop, &g_abh, &g_aimbot}; + static char bn[4][32]; + static FeatureState *feats[] = {&g_bhop, &g_abh, &g_aimbot, + &g_triggerbot}; int fi = 0; - for (int k = 0; k < 3; k++) + for (int k = 0; k < 4; k++) if (n->bind_ptr == &feats[k]->bind) fi = k; snprintf(bn[fi], 32, "[%s]", scancode_name(*n->bind_ptr)); -- cgit v1.2.3