From 5adb4303c8ac4969312fa1afd4f254cba65f6ecc Mon Sep 17 00:00:00 2001 From: salmonik Date: Tue, 27 Oct 2026 12:43:59 +0100 Subject: Aimbot/silent aim: settable FOV, FOV circle, target locking - Aimbot -> FOV and Silent aim -> FOV values (1..180 deg from the crosshair) - Aimbot -> Show FOV circle: projects the FOV cone through the engine's world->screen transform (hidden for >=89 deg since the boundary is behind the eye) - target lock: while a feature has a bind and the key is held, the acquired target is kept while it is alive and has a visible selected hitbox point; it only re-acquires when the target dies/leaves visibility or the key is released. With bind = None both features keep selecting the nearest target. --- src/menu.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 59 insertions(+), 13 deletions(-) (limited to 'src/menu.cpp') diff --git a/src/menu.cpp b/src/menu.cpp index 41d3321..49dd886 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -81,6 +81,9 @@ static bool g_aim_bones[AIM_BONE_COUNT] = {true, false, false, false, false, false}; static int g_aim_smooth = 5; // degrees per tick static bool g_aim_vischeck = true; +static int g_aim_fov = 60; // angular distance from the crosshair +static bool g_aim_fov_circle = true; +static int g_silent_fov = 60; // ESP sub-options (menu "ESP" children). Defaults match the pre-option // behaviour: everything on. @@ -118,14 +121,19 @@ 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_aimbot_fov_node{NODE_VALUE, "FOV", false, 0, {}, nullptr, + nullptr, nullptr, &g_aim_fov, 1, 180, 1}; +static MenuNode g_aimbot_fov_circle_node{NODE_TOGGLE, "Show FOV circle", false, 0, {}, &g_aim_fov_circle, nullptr, nullptr}; 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_silentaim_feat{NODE_FEATURE, "Silent aim", false, 1, {}, nullptr, nullptr, nullptr}; static MenuNode g_silentaim_active{NODE_TOGGLE, "Active", false, 0, {}, &g_silentaim.active, nullptr, nullptr}; static MenuNode g_silentaim_bind{NODE_BIND, "Bind", false, 0, {}, nullptr, &g_silentaim.bind, nullptr}; +static MenuNode g_silentaim_fov_node{NODE_VALUE, "FOV", false, 0, {}, nullptr, + nullptr, nullptr, &g_silent_fov, 1, 180, 1}; -static MenuNode *g_visible[32]; // flattened visible nodes for arrow navigation +static MenuNode *g_visible[48]; // flattened visible nodes for arrow navigation static int g_visible_count = 0; static int g_selected = 0; bool g_menu_open = false; @@ -142,7 +150,9 @@ static void build_tree() { g_aimbot_feat.children[2] = &g_aimbot_vischeck_node; g_aimbot_feat.children[3] = &g_aimbot_bones_feat; g_aimbot_feat.children[4] = &g_aimbot_smooth_node; - g_aimbot_feat.child_count = 5; + g_aimbot_feat.children[5] = &g_aimbot_fov_node; + g_aimbot_feat.children[6] = &g_aimbot_fov_circle_node; + g_aimbot_feat.child_count = 7; 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; @@ -151,7 +161,8 @@ static void build_tree() { g_triggerbot_feat.child_count = 2; g_silentaim_feat.children[0] = &g_silentaim_active; g_silentaim_feat.children[1] = &g_silentaim_bind; - g_silentaim_feat.child_count = 2; + g_silentaim_feat.children[2] = &g_silentaim_fov_node; + g_silentaim_feat.child_count = 3; 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; @@ -164,10 +175,10 @@ static void build_tree() { g_root.child_count = 6; } -static int g_depth[32]; // depth of each visible row (for indentation) +static int g_depth[48]; // depth of each visible row (for indentation) static void flatten(MenuNode *node, int depth) { - if (g_visible_count >= 32) + if (g_visible_count >= 48) return; node->type = (depth == 0) ? NODE_ROOT : (node->child_count > 0) ? NODE_FEATURE @@ -284,17 +295,18 @@ static void config_save() { g_bhop.bind, g_bhop_autostrafe); fprintf(f, "[abh]\nactive=%d\nbind=%d\n", g_abh.active, g_abh.bind); fprintf(f, "[aimbot]\nactive=%d\nbind=%d\nsmooth=%d\nvischeck=%d\n" + "fov=%d\nfov_circle=%d\n" "bone_head=%d\nbone_torso=%d\nbone_larm=%d\nbone_rarm=%d\n" "bone_lleg=%d\nbone_rleg=%d\n", g_aimbot.active, g_aimbot.bind, g_aim_smooth, - (int)g_aim_vischeck, + (int)g_aim_vischeck, g_aim_fov, (int)g_aim_fov_circle, 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, "[silentaim]\nactive=%d\nbind=%d\n", g_silentaim.active, - g_silentaim.bind); + fprintf(f, "[silentaim]\nactive=%d\nbind=%d\nfov=%d\n", g_silentaim.active, + g_silentaim.bind, g_silent_fov); 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], @@ -310,7 +322,7 @@ static void config_load() { return; char line[256]; FeatureState *cur = nullptr; - bool in_esp = false, in_bhop = false, in_aim = false; + bool in_esp = false, in_bhop = false, in_aim = false, in_silent = false; while (fgets(line, sizeof(line), f)) { line[strcspn(line, "\r\n")] = 0; if (line[0] == '[') { @@ -331,6 +343,7 @@ static void config_load() { in_esp = (cur == &g_esp); in_bhop = (cur == &g_bhop); in_aim = (cur == &g_aimbot); + in_silent = (cur == &g_silentaim); } else if (cur) { char *eq = strchr(line, '='); if (!eq) @@ -360,8 +373,21 @@ static void config_load() { g_aim_bones[AIM_BONE_RLEG] = atoi(val) != 0; } else if (strcmp(key, "vischeck") == 0) { g_aim_vischeck = atoi(val) != 0; + } else if (strcmp(key, "fov") == 0) { + int v = atoi(val); + if (v < 1) v = 1; + if (v > 180) v = 180; + g_aim_fov = v; + } else if (strcmp(key, "fov_circle") == 0) { + g_aim_fov_circle = atoi(val) != 0; } } + if (in_silent && strcmp(key, "fov") == 0) { + int v = atoi(val); + if (v < 1) v = 1; + if (v > 180) v = 180; + g_silent_fov = v; + } if (in_esp) { if (strcmp(key, "neutral") == 0) g_esp_opt[ESP_OPT_SHOW_NEUTRAL] = atoi(val) != 0; @@ -485,18 +511,32 @@ 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 *feature_state(int feature) { static FeatureState *feats[6] = {&g_bhop, &g_abh, &g_esp, &g_aimbot, &g_triggerbot, &g_silentaim}; if (feature < 0 || feature > 5) - return false; - FeatureState *f = feats[feature]; - if (!f->active) + return nullptr; + return feats[feature]; +} + +bool feature_active(int feature) { + FeatureState *f = feature_state(feature); + if (!f || !f->active) return false; return f->bind == 0 || key_held(f->bind); } +bool feature_has_bind(int feature) { + FeatureState *f = feature_state(feature); + return f && f->bind != 0; +} + +bool feature_bind_held(int feature) { + FeatureState *f = feature_state(feature); + return f && f->bind != 0 && key_held(f->bind); +} + bool esp_option(int opt) { return opt >= 0 && opt < ESP_OPT_COUNT && g_esp_opt[opt]; } @@ -524,6 +564,12 @@ int aimbot_smooth_step() { return g_aim_smooth; } bool aimbot_vischeck_enabled() { return g_aim_vischeck; } +int aimbot_fov() { return g_aim_fov; } + +int silentaim_fov() { return g_silent_fov; } + +bool aimbot_fov_circle() { return g_aim_fov_circle; } + static void menu_handle_input() { poll_keyboard(); -- cgit v1.2.3