UI.AddLabel( "             helly.technology" );
UI.AddLabel( "             ___________________" );
UI.AddCheckbox("Adaptive anti-aims")
UI.AddCheckbox("Instant double-tap")
UI.AddCheckbox("Adaptive fake-lags")
UI.AddCheckbox("Better leg-spam")
UI.AddCheckbox("Better auto-strafe");

var old_tick_count = 0;
function dra1w()
{
    if (UI.GetValue("Script items", "Better leg-spam") && (Globals.Tickcount() - old_tick_count) > (0))
    {
        if (UI.GetValue("Misc", "GENERAL", "Movement", "Slide walk"))
            UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 0);
        else
            UI.SetValue("Misc", "GENERAL", "Movement", "Slide walk", 1);
        old_tick_count = Globals.Tickcount();
    }
}
Cheat.RegisterCallback("Draw", "dra1w");

function _FrameNetUpdateStart() {
  if (!UI.GetValue("Misc", "JAVASCRIPT","Instant double-tap")) {
    Exploit.OverrideTolerance(0);
    Exploit.OverrideShift(15); }}

Cheat.RegisterCallback("FRAME_NET_UPDATE_START", "_FrameNetUpdateStart");

function get_velocity() {
    velocity = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_vecVelocity[0]");
    speed = Math.sqrt(velocity[0] * velocity[0] + velocity[1] * velocity[1]);
    return speed;
}
function rand_int(min, max) {
    return Math.floor(Math.random() * (max - min + 1) + min);
}
var death_angles = [];
var wish = {
    real: 0,
    fake: 0,
    lby: 0,
    side: 0,
    limit: 0
};
var local = {
    real: 0,
    fake: 0,
    duck_amount: 0,
    shifting: false,
    in_air: false
};
var globals = {
    tick_count: 0,
    cur_time: 0,
    debug: true
}
function update() {
    globals.tick_count = Globals.Tickcount();
    globals.cur_time = Globals.Curtime();
    local.real = Math.floor(Local.GetRealYaw());
    local.fake = Math.floor(Local.GetFakeYaw());
    local.duck_amount = Entity.GetProp(Entity.GetLocalPlayer(), "CBasePlayer", "m_flDuckAmount");
}
function set_wish_angles() {
    AntiAim.SetOverride(1);
    AntiAim.SetRealOffset(wish.real);
    AntiAim.SetFakeOffset(wish.fake);
    AntiAim.SetLBYOffset(wish.lby);
}
function handle_hotkeys() {
    wish.side = UI.IsHotkeyActive("Misc", "JAVASCRIPT", "Anti-Aimbot Side Switch") ? 1 : 0;
    local.shifting = Input.IsKeyPressed(0x10) ? true : false;// ensure you use misc->accurate walk
    local.in_air = Input.IsKeyPressed(0x20) ? true : false; // ?\_(?)_/?
}
function adjust_antiaim() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Adaptive anti-aims"))
        return;

    if (local.shifting && get_velocity() > 1.11) {
        wish.lby = -140;
        wish.real = globals.tick_count % 2 ? rand_int(-55, -22) : rand_int(22, 55);
    }
    else {
        if (wish.side == 0) {
            wish.lby = 120;
            wish.real = globals.tick_count % 12 ? wish.real : wish.real - 11;
            if (wish.real <= -55)
                wish.real = 32;
            if (wish.real == 21)
                wish.real = -33;
        }
        else if (wish.side == 1) {
            wish.lby = -120;
            wish.real = globals.tick_count % 12 ? wish.real : wish.real + 11;
            if (wish.real >= 55)
                wish.real = -32;
            if (wish.real == -21)
                wish.real = 33;
        }
    }
    set_wish_angles();
}
function adjust_lag() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Adaptive fake-lags"))
        return;
    if (local.in_air) {
        distance_per_tick = get_velocity() * Globals.TickInterval();
        choked_ticks = Math.ceil(64.0 / distance_per_tick);
        wish.limit = Math.min(choked_ticks, 16);
    } else {
        wish.limit = rand_int(1, 9);
    }
    UI.SetValue("Anti-Aim", "Fake-Lag", "Limit", wish.limit);
}
function player_death() {
    death_angles.push(wish.real);
}
function create_move() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Adaptive anti-aims"))
        return;
    update();
    handle_hotkeys();
    adjust_antiaim();
    adjust_lag();
}
function draw() {
    if (!UI.GetValue("Misc", "JAVASCRIPT", "Adaptive anti-aims") || !globals.debug)
        return;
}
Cheat.RegisterCallback("CreateMove", "create_move");
Cheat.RegisterCallback("Draw", "draw");
Cheat.RegisterCallback("player_death", "player_death");

//region api
const global_print = Global.Print, global_print_chat = Global.PrintChat, global_print_color = Global.PrintColor, global_register_callback = Global.RegisterCallback, global_execute_command = Global.ExecuteCommand, global_frame_stage = Global.FrameStage, global_tickcount = Global.Tickcount, global_tickrate = Global.Tickrate, global_tick_interval = Global.TickInterval, global_curtime = Global.Curtime, global_realtime = Global.Realtime, global_frametime = Global.Frametime, global_latency = Global.Latency, global_get_view_angles = Global.GetViewAngles, global_set_view_angles = Global.SetViewAngles, global_get_map_name = Global.GetMapName, global_is_key_pressed = Global.IsKeyPressed, global_get_screen_size = Global.GetScreenSize, global_get_cursor_position = Global.GetCursorPosition, global_play_sound = Global.PlaySound, global_play_microphone = Global.PlayMicrophone, global_stop_microphone = Global.StopMicrophone, global_get_username = Global.GetUsername, global_set_clan_tag = Global.SetClanTag, globals_tickcount = Globals.Tickcount, globals_tickrate = Globals.Tickrate, globals_tick_interval = Globals.TickInterval, globals_curtime = Globals.Curtime, globals_realtime = Globals.Realtime, globals_frametime = Globals.Frametime, sound_play = Sound.Play, sound_play_microphone = Sound.PlayMicrophone, sound_stop_microphone = Sound.StopMicrophone, cheat_get_username = Cheat.GetUsername, cheat_register_callback = cheat_register_callback = new Proxy(Cheat.RegisterCallback, { apply: function(_, _, args) { switch(args[0]) { case 'paint': Cheat.RegisterCallback('Draw', args[1]); break; case 'create_move': Cheat.RegisterCallback('CreateMove', args[1]); break; case 'fsn': Cheat.RegisterCallback('FrameStageNotify', args[1]); break; default: Cheat.RegisterCallback(args[0], args[1]); break; } } }), cheat_execute_command = Cheat.ExecuteCommand, cheat_frame_stage = Cheat.FrameStage, cheat_print = Cheat.Print, cheat_print_chat = Cheat.PrintChat, cheat_print_color = Cheat.PrintColor, local_latency = Local.Latency, local_get_view_angles = Local.GetViewAngles, local_set_view_angles = Local.SetViewAngles, local_set_clan_tag = Local.SetClanTag, local_get_real_yaw = Local.GetRealYaw, local_get_fake_yaw = Local.GetFakeYaw, local_get_spread = Local.GetSpread, local_get_inaccuracy = Local.GetInaccuracy, world_get_map_name = World.GetMapName, world_get_server_string = World.GetServerString, input_get_cursor_position = Input.GetCursorPosition, input_is_key_pressed = Input.IsKeyPressed, render_string = Render.String, render_text_size = Render.TextSize, render_line = Render.Line, render_rect = Render.Rect, render_filled_rect = Render.FilledRect, render_gradient_rect = Render.GradientRect, render_circle = Render.Circle, render_filled_circle = Render.FilledCircle, render_polygon = Render.Polygon, render_world_to_screen = Render.WorldToScreen, render_add_font = Render.AddFont, render_find_font = Render.FindFont, render_string_custom = Render.StringCustom, render_textured_rect = Render.TexturedRect, render_add_texture = Render.AddTexture, render_text_size_custom = Render.TextSizeCustom, render_get_screen_size = Render.GetScreenSize, ui_get_value = UI.GetValue, ui_set_value = UI.SetValue, ui_add_checkbox = UI.AddCheckbox, ui_add_slider_int = UI.AddSliderInt, ui_add_slider_float = UI.AddSliderFloat, ui_add_hotkey = UI.AddHotkey, ui_add_label = UI.AddLabel, ui_add_dropdown = UI.AddDropdown, ui_add_multi_dropdown = UI.AddMultiDropdown, ui_add_color_picker = UI.AddColorPicker, ui_add_textbox = UI.AddTextbox, ui_set_enabled = UI.SetEnabled, ui_get_string = UI.GetString, ui_get_color = UI.GetColor, ui_set_color = UI.SetColor, ui_is_hotkey_active = UI.IsHotkeyActive, ui_toggle_hotkey = UI.ToggleHotkey, ui_is_menu_open = UI.IsMenuOpen, convar_get_int = Convar.GetInt, convar_set_int = Convar.SetInt, convar_get_float = Convar.GetFloat, convar_set_float = Convar.SetFloat, convar_get_string = Convar.GetString, convar_set_string = Convar.SetString, event_get_int = Event.GetInt, event_get_float = Event.GetFloat, event_get_string = Event.GetString, entity_get_entities = Entity.GetEntities, entity_get_entities_by_class_i_d = Entity.GetEntitiesByClassID, entity_get_players = Entity.GetPlayers, entity_get_enemies = Entity.GetEnemies, entity_get_teammates = Entity.GetTeammates, entity_get_local_player = Entity.GetLocalPlayer, entity_get_game_rules_proxy = Entity.GetGameRulesProxy, entity_get_entity_from_user_i_d = Entity.GetEntityFromUserID, entity_is_teammate = Entity.IsTeammate, entity_is_enemy = Entity.IsEnemy, entity_is_bot = Entity.IsBot, entity_is_local_player = Entity.IsLocalPlayer, entity_is_valid = Entity.IsValid, entity_is_alive = Entity.IsAlive, entity_is_dormant = Entity.IsDormant, entity_get_class_i_d = Entity.GetClassID, entity_get_class_name = Entity.GetClassName, entity_get_name = Entity.GetName, entity_get_weapon = Entity.GetWeapon, entity_get_weapons = Entity.GetWeapons, entity_get_render_origin = Entity.GetRenderOrigin, entity_get_prop = Entity.GetProp, entity_set_prop = Entity.SetProp, entity_get_hitbox_position = Entity.GetHitboxPosition, entity_get_eye_position = Entity.GetEyePosition, trace_line = Trace.Line, trace_bullet = Trace.Bullet, usercmd_set_movement = UserCMD.SetMovement, usercmd_get_movement = UserCMD.GetMovement, usercmd_set_angles = UserCMD.SetAngles, usercmd_force_jump = UserCMD.ForceJump, usercmd_force_crouch = UserCMD.ForceCrouch, antiaim_get_override = AntiAim.GetOverride, antiaim_set_override = AntiAim.SetOverride, antiaim_set_real_offset = AntiAim.SetRealOffset, antiaim_set_fake_offset = AntiAim.SetFakeOffset, antiaim_set_l_b_y_offset = AntiAim.SetLBYOffset, exploit_get_charge = Exploit.GetCharge, exploit_recharge = Exploit.Recharge, exploit_disable_recharge = Exploit.DisableRecharge, exploit_enable_recharge = Exploit.EnableRecharge, ragebot_override_minimum_damage = Ragebot.OverrideMinimumDamage, ragebot_override_hitchance = Ragebot.OverrideHitchance, ragebot_override_accuracy_boost = Ragebot.OverrideAccuracyBoost, ragebot_override_multipoint_scale = Ragebot.OverrideMultipointScale, ragebot_force_safety = Ragebot.ForceSafety;
//endregion

var screen_size = global_get_screen_size();
var bombsite, player_name, site = "";
var plating_time = 3.125;
var planting, planted, ignore_dropped, ignore_self = false;
var r = 108, g = 195, b = 18;
var rr = 108, gr = 195, br = 18;
var bomb_beginwhen = null;
const planting_height = 0;
const defuse_height = 0;

//Math functions
function lerp_pos(x1, y1, z1, x2, y2, z2, percentage)
{
    var x = (x2 - x1) + percentage + x1;
    var y = (y2 - y1) + percentage + y1;
    var z = (z2 - z1) + percentage + z1;
    return [x, y, z];
}
function distance3d(x1,y1,z1,x2,y2,z2)
{
    return Math.sqrt((x2-x1)^2+(y2-y1)^2+(z2-z1)^2);
}
function getDefuseTime(bomb_entity)
{
    var defuse_time = entity_get_prop(bomb_entity, "CPlantedC4", "m_flDefuseCountDown") - globals_curtime();
    return Math.max(0, defuse_time);
}
function getBombTime(bomb_entity)
{
    var bomb_time = entity_get_prop(bomb_entity, "CPlantedC4", "m_flC4Blow") - globals_curtime();
    return Math.max(0, bomb_time);
}
function getBombSite(bomb_entity)
{
    return bomb_site = entity_get_prop(bomb_entity, "CPlantedC4", "m_nBombSite") == 1 ? "B" : "A";
}
function getDistanceTo(a, b)
{
    var lx = a[0];
    var ly = a[1];
    var lz = a[2];
    var tx = b[0];
    var ty = b[1];
    var tz = b[2];
    var dx = lx - tx;
    var dy = ly - ty;
    var dz = lz - tz;

    return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
function getDamage(damage, armor_value)
{
    if (armor_value > 0)
    {
        var new_value = damage * .5;
        var armor = (damage - new_value) * .5;
        if (armor > armor_value)
        {
            armor = armor_value * (1 / .5);
            new_value = damage - armor;
        }
        damage = new_value;
    }
    return damage;
}
function getBombDamage(player_entity, bomb_entity)
{
    var player_pos = entity_get_render_origin(player_entity);
    var bomb_pos = entity_get_render_origin(bomb_entity);
    var distance = getDistanceTo(player_pos, bomb_pos);
    const a = 450.7;
    const b = 75.68;
    const c = 789.2;
    const d = ((distance - b) / c);
    var damage = a * Math.exp(-d * d);
    var armor_value = entity_get_prop(player_entity, "CCSPlayerResource", "m_iArmor");

    return Math.max(Math.ceil(getDamage(damage, armor_value)), 0)
}

function draw_defuse_bar()
{
    var y = screen_size[1];
    const c4 = Entity.GetEntitiesByClassID(128)[0];
    var defused_at = entity_get_prop(c4, "CPlantedC4", "m_flDefuseCountDown");
    var defuse_length = entity_get_prop(c4, "CPlantedC4", "m_flDefuseLength");
    const timer = (Entity.GetProp(c4, "CPlantedC4", "m_flC4Blow") - Globals.Curtime()).toFixed(3);
    if (defuse_length > timer)
    {
        return;
    }
    defuse_height = Math.min(y, y * (globals_curtime() - (defused_at - defuse_length)) / defuse_length);
    render_filled_rect(15, 0, 15, render_get_screen_size()[1], [32,32,32,150]);
    render_filled_rect(15, y - defuse_height, 15, y, [79, 163, 227, 255]);
}

function on_paint()
{
    var x = screen_size[0];
    var y = screen_size[1];
    const bomb_entity = entity_get_entities_by_class_i_d(128);
    var bomb = null;

    const c4 = Entity.GetEntitiesByClassID(128)[0];
    if (planting)
    {
        if (player_name != entity_get_name(entity_get_local_player()))
        {
            render_string(17, 2, 0, bombsite + " - " + player_name, [0, 0, 0, 255], 4)
            render_string(15, 0, 0, bombsite + " - " + player_name, [r, g, b, 255], 4)
        }
        planting_height =  Math.min(y, y * (globals_curtime() - bomb_beginwhen) / plating_time);
        render_filled_rect(0, 0, 15, render_get_screen_size()[1], [32,32,32,150]);
        render_filled_rect(0, y - planting_height, 15, y, [rr,gr,br,255]);
    }
    if (planted)
    {
        if (bomb_entity != null)
        {
            bomb = bomb_entity[1];
            var local_player = entity_get_local_player();
            var bomb_time_max = convar_get_float("mp_c4timer");
            const bomb_damage = getBombDamage(local_player, c4);
            var player = entity_get_prop(c4, "CPlantedC4", "m_hBombDefuser");
            if (player == 1)
            {
                draw_defuse_bar();
            }
        }
        const timer = (Entity.GetProp(c4, "CPlantedC4", "m_flC4Blow") - Globals.Curtime()).toFixed(1);
        const planted_text = getBombSite(c4) + " - " + timer.toString() + "s";
        const height = Math.min(y, y * timer/bomb_time_max);

        render_filled_rect(0, 0, 15, render_get_screen_size()[1], [32,32,32,150]);
        render_filled_rect(0, y - height, 15, y, [rr,gr,br,255]);


        render_string(17, 2, 0, planted_text, [0, 0, 0, 255], 4)
        render_string(15, 0, 0, planted_text, [r, g, b, 255], 4)
        if (timer <= 10)
        {
            r = 230,g = 235,b = 145;
        }
        if (timer <= 5)
        {
            r = 255, g = 1, b = 1;
            rr = 255, gr = 1, br = 1;
        }
        if (timer <= 0)
        {
            r = 108, g = 195, b = 18;
            rr = 108, gr = 195, br = 18;
            planted = false;
            planting = false;
            return;
        }
        if (bomb_damage >= 3)
        {
            const damage_text= entity_get_prop(local_player, "CBasePlayer", "m_iHealth") <= bomb_damage ? "FATAL" : "-" + bomb_damage.toString() + " HP";
            const damage_color = entity_get_prop(local_player, "CBasePlayer", "m_iHealth") <= bomb_damage ? [255,1,1,255] : [230,235,145, 255];
            render_string(17, 30, 0, damage_text, [0, 0, 0, 255], 4);
            render_string(15, 28, 0, damage_text, damage_color, 4);
        }
    }
}
const a_site_array = [425, 333, 79, 262, 154, 94, 281, 204, 92, 152];
const b_site_array = [426, 422, 504, 314, 405, 536, 282, 205, 97, 153];
function beginPlant()
{
    var userid = event_get_int("userid");
    site = event_get_int("site");
    if (!userid) return;
    cheat_print("[onetap] Planting on bombsite id: " + event_get_int("site")+"\n");
    if (a_site_array.indexOf(site) > -1)
    {
        site = "A";
    }
    else if (b_site_array.indexOf(site) > -1)
    {
        site = "B";
    }
    else
    {
        return;
    }

    var userid_name = entity_get_entity_from_user_i_d(userid);
    var userid_name_final = entity_get_name(userid_name);

    planting = true;
    bombsite = site;
    player_name = userid_name_final;
    bomb_beginwhen = globals_curtime();
}
function abortPlant()
{
    planting = false;
    planted = false;
    planting_height = 0;
    defuse_height = 0;
}
function bombPlanted()
{
    planting = false;
    planted = true;
}
function reset()
{
    planting = false;
    planted = false;
    planting_height = 0;
    defuse_height = 0;
    site = "";
}
cheat_register_callback("bomb_beginplant", "beginPlant");
cheat_register_callback("bomb_abortplant", "abortPlant");
cheat_register_callback("bomb_planted", "bombPlanted");
cheat_register_callback("bomb_defused", "reset");
cheat_register_callback("round_start", "reset");
cheat_register_callback("Draw", "on_paint");

UI.AddColorPicker("Color Accent");
var colorhotkeys = UI.GetColor("Misc", "JAVASCRIPT", "Color Accent");
if (colorhotkeys[3] == 0) {
}
var alpha = 0;
var maxwidth = 0;
var swalpha = 0;
var fdalpha = 0;
var apalpha = 0;
var aialpha = 0;
var spalpha = 0;
var fbalpha = 0;
var dtalpha = 0;
var hsalpha = 0;
var doalpha = 0;
var textalpha = 0;
var h = new Array();

function in_bounds(vec, x, y, x2, y2) {
    return (vec[0] > x) && (vec[1] > y) && (vec[0] < x2) && (vec[1] < y2)
}

function main_hotkeys() {
        if (!World.GetServerString()) return;
        const x = UI.GetValue("Misc", "JAVASCRIPT", "Hotkeys_x"),
            y = UI.GetValue("Misc", "JAVASCRIPT", "Hotkeys_y");
        colorhotkeys = UI.GetColor("Misc", "JAVASCRIPT", "Color Accent");
        var font = Render.AddFont("Verdana", 7, 400);
        var frames = 8 * Globals.Frametime();
        var width = 50;
        var maxwidth = 100;
        if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk")) {
            swalpha = Math.min(swalpha + frames, 1);
        } else {
            swalpha = swalpha - frames;
            if (swalpha < 0) swalpha = 0;
            if (swalpha == 0) {
                h.splice(h.indexOf("Slow walk"));
            }
        }

        if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Fake duck")) {
            fdalpha = Math.min(fdalpha + frames, 1);
        } else {
            fdalpha = fdalpha - frames;
            if (fdalpha < 0) fdalpha = 0;
            if (fdalpha == 0) {
                h.splice(h.indexOf("Duck peek assist"));
            }
        }

        if (UI.IsHotkeyActive("Misc", "GENERAL", "Movement", "Auto peek")) {
            apalpha = Math.min(apalpha + frames, 1);
        } else {
            apalpha = apalpha - frames;
            if (apalpha < 0) apalpha = 0;
            if (apalpha == 0) {
                h.splice(h.indexOf("Auto peek"));
            }
        }

        if (UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter")) {
            aialpha = Math.min(aialpha + frames, 1);
        } else {
            aialpha = aialpha - frames;
            if (aialpha < 0) aialpha = 0;
            if (aialpha == 0) {
                h.splice(h.indexOf("Anti-aim inverter"));
            }
        }

        if (UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter")) {
            aialpha = Math.min(aialpha + frames, 1);
        } else {
            aialpha = aialpha - frames;
            if (aialpha < 0) aialpha = 0;
            if (aialpha == 0) {
                h.splice(h.indexOf("Inverter"));
            }
        }

        if (UI.IsHotkeyActive("Rage", "GENERAL", "General", "Force safe point")) {
            spalpha = Math.min(spalpha + frames, 1);
        } else {
            spalpha = spalpha - frames;
            if (spalpha < 0) spalpha = 0;
            if (spalpha == 0) {
                h.splice(h.indexOf("Safe point override"));
            }
        }

        if (UI.IsHotkeyActive("Rage", "GENERAL", "General", "Force body aim")) {
            fbalpha = Math.min(fbalpha + frames, 1);
        } else {
            fbalpha = fbalpha - frames;
            if (fbalpha < 0) fbalpha = 0;
            if (fbalpha == 0) {
                h.splice(h.indexOf("Force body aim"));
            }
        }

        if (UI.IsHotkeyActive("Rage", "Exploits", "Doubletap")) {
            dtalpha = Math.min(dtalpha + frames, 1);
        } else {
            dtalpha = dtalpha - frames;
            if (dtalpha < 0) dtalpha = 0;
            if (dtalpha == 0) {
                h.splice(h.indexOf("Double tap"));
            }
        }

        if (UI.IsHotkeyActive("Rage", "Exploits", "Hide shots")) {
            hsalpha = Math.min(hsalpha + frames, 1);
        } else {
            hsalpha = hsalpha - frames;
            if (hsalpha < 0) hsalpha = 0;
            if (hsalpha == 0) {
                h.splice(h.indexOf("Hide shots"));
            }
        }

        if (UI.IsHotkeyActive("Damage override")) {
            doalpha = Math.min(doalpha + frames, 1);
        } else {
            doalpha = doalpha - frames;
            if (doalpha < 0) doalpha = 0;
            if (doalpha == 0) {
                h.splice(h.indexOf("Damage override"));
            }
        }

        if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Slow walk")) {
            if (h.indexOf("Slow walk") == -1)
                h.push("Slow walk")
        }
        if (UI.IsHotkeyActive("Anti-Aim", "Extra", "Fake duck")) {
            if (h.indexOf("Duck peek assist") == -1)
                h.push("Duck peek assist")
        }
        if (UI.IsHotkeyActive("Misc", "GENERAL", "Movement", "Auto peek")) {
            if (h.indexOf("Auto peek") == -1)
                h.push("Auto peek")
        }
        if (UI.IsHotkeyActive("Anti-Aim", "Fake angles", "Inverter")) {
            if (h.indexOf("Anti-aim inverter") == -1)
                h.push("Anti-aim inverter")
        }
        if (UI.IsHotkeyActive("Rage", "GENERAL", "General", "Force safe point")) {
            if (h.indexOf("Safe point override") == -1)
                h.push("Safe point override")
        }
        if (UI.IsHotkeyActive("Rage", "GENERAL", "General", "Force body aim")) {
            if (h.indexOf("Force body aim") == -1)
                h.push("Force body aim")
        }
        if (UI.IsHotkeyActive("Rage", "Exploits", "Doubletap")) {
            if (h.indexOf("Double tap") == -1)
                h.push("Double tap")
        }
        if (UI.IsHotkeyActive("Rage", "Exploits", "Hide shots")) {
            if (h.indexOf("Hide shots") == -1)
                h.push("Hide shots")
        }
        if (UI.IsHotkeyActive("Damage override")) {
            if (h.indexOf("Damage override") == -1)
                h.push("Damage override")
        }

        if (h.length > 0) {
            alpha = Math.min(alpha + frames, 1);
        } else {
            alpha = alpha - frames;
            if (alpha < 0) alpha = 0;
        }
        for (i = 0; i < h.length; i++) {
            if (Render.TextSizeCustom(h[i], font)[0] > maxwidth) {
                maxwidth = Render.TextSizeCustom(h[i], font)[0];
            }
        }
        if (maxwidth == 0) maxwidth = 100;
        width = width + maxwidth;
        if (alpha > 0) {
                Render.FilledRect(x, y + 3, width, 2, [colorhotkeys[0], colorhotkeys[1], colorhotkeys[2], alpha * 255]);
                Render.FilledRect(x, y + 5, width, 18, [17, 17, 17, alpha * colorhotkeys[3]]);
                Render.StringCustom(x + width / 2 - (Render.TextSizeCustom("hotkey list", font)[0] / 2) + 2, y + 9, 0, "hotkey list", [0, 0, 0, alpha * 255 / 1.3], font);
                Render.StringCustom(x + width / 2 - (Render.TextSizeCustom("hotkey list", font)[0] / 2) + 1, y + 8, 0, "hotkey list", [255, 255, 255, alpha * 255], font);
                //Render.FilledRect(x, y + 23, width, 18 * h.length, [17, 17, 17, Math.min(colorhotkeys[3], alpha * 255)]);
                for (i = 0; i < h.length; i++) {
                    switch (h[i]) {
                        case 'Slow walk':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(swalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, swalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, swalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [0, 0, 0, swalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [255, 255, 255, swalpha * 255], font);
                            break;
                        case 'Duck peek assist':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(fdalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, fdalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, fdalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [0, 0, 0, fdalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [255, 255, 255, fdalpha * 255], font);
                            break;
                        case 'Auto peek':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(apalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, apalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, apalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [0, 0, 0, apalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [255, 255, 255, apalpha * 255], font);
                            break;
                        case 'Anti-aim inverter':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(aialpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, aialpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, aialpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [0, 0, 0, aialpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [255, 255, 255, aialpha * 255], font);
                            break;
                        case 'Safe point override':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(spalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, spalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, spalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [0, 0, 0, spalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [255, 255, 255, spalpha * 255], font);
                            break;
                        case 'Force body aim':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(fbalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, fbalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, fbalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [0, 0, 0, fbalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [255, 255, 255, fbalpha * 255], font);
                            break;
                        case 'Double tap':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(dtalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, dtalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, dtalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [0, 0, 0, dtalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [255, 255, 255, dtalpha * 255], font);
                            break;
                        case 'Hide shots':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(hsalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, hsalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, hsalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [0, 0, 0, hsalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[toggled]", font)[0], y + 26 + 18 * i, 0, "[toggled]", [255, 255, 255, hsalpha * 255], font);
                            break;
                        case 'Damage override':
                            Render.FilledRect(x, y + 23 + 18 * i, width, 18, [17, 17, 17, Math.min(colorhotkeys[3], Math.min(doalpha * 0, colorhotkeys[3]))]);
                            Render.StringCustom(x + 3, y + 26 + 18 * i, 0, h[i], [0, 0, 0, doalpha * 255 / 1.3], font);
                            Render.StringCustom(x + 2, y + 26 + 18 * i, 0, h[i], [255, 255, 255, doalpha * 255], font);

                            Render.StringCustom(x - 3 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [0, 0, 0, doalpha * 255 / 1.3], font);
                            Render.StringCustom(x - 2 + width - Render.TextSizeCustom("[holding]", font)[0], y + 26 + 18 * i, 0, "[holding]", [255, 255, 255, doalpha * 255], font);
                            break;
                    }

                }
        }
        if (Global.IsKeyPressed(1) && UI.IsMenuOpen()) {
            const mouse_pos = Global.GetCursorPosition();
            if (in_bounds(mouse_pos, x, y, x + width, y + 30)) {
                UI.SetValue("Misc", "JAVASCRIPT", "Hotkeys_x", mouse_pos[0] - width / 2);
                UI.SetValue("Misc", "JAVASCRIPT", "Hotkeys_y", mouse_pos[1] - 20);
            }
        }
}
Global.RegisterCallback("Draw", "main_hotkeys")


function d() {
  if (!UI.GetValue("Misc", "JAVASCRIPT", "Better auto-strafe")) {
{
    UI.SetValue("Misc", "GENERAL", "Movement", "Turn speed", 300)
}
}
}
Cheat.RegisterCallback("Draw", "d")

var color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Color Accent");

if (color[3] == 0)
UI.SetColor("Misc", "JAVASCRIPT", "Script items", "Watermark", [89, 119, 239, 255]);

function draw() {
if(!World.GetServerString())
return;

var today = new Date();
var hours1 = today.getHours();
var minutes1 = today.getMinutes();
var seconds1 = today.getSeconds();

var hours = hours1 <= 9 ? "0"+hours1+":" : hours1+":";
var minutes = minutes1 <= 9 ? "0" + minutes1+":" : minutes1+":";
var seconds = seconds1 <= 9 ? "0" + seconds1 : seconds1;

var server_tickrate = Globals.Tickrate().toString()
var ebanaya_hueta = Math.round(Entity.GetProp(Entity.GetLocalPlayer(), "CPlayerResource", "m_iPing")).toString() // кто это сделал - контуженный на всю голову ебаный хуесос

color = UI.GetColor("Misc", "JAVASCRIPT", "Script items", "Watermark");

var font = Render.AddFont("Verdana", 7, 400);
var text = "helly.technology | version: debug | user: " + Cheat.GetUsername() + " | " + ebanaya_hueta + "ms / " + server_tickrate + "tick | " + hours + minutes + seconds;

var w = Render.TextSizeCustom(text, font)[0] + 8;
var x = Global.GetScreenSize()[0];

x = x - w - 10;

Render.FilledRect(x, 10, w, 2, [ color[0], color[1], color[2], 255 ]);
Render.FilledRect(x, 12, w, 18, [ 17, 17, 17, color[3] ]);
Render.StringCustom(x+4, 10 + 4, 0, text, [ 255, 255, 255, 255 ], font);
}

Cheat.RegisterCallback("Draw", "draw");

var bullets = [];

function IsPointInsideScreen(point) {
  const screen_size = Render.GetScreenSize();
  return point[0] >= 0 && point[1] >= 0 && point[1] <= screen_size[1] && point[0] <= screen_size[0];
}
function onDraw24() {
    var tracer =[255,255,255,55]
    var xhair = [colorhotkeys[0], colorhotkeys[1], colorhotkeys[2], 255]

  for (var i = 0; i < bullets.length; i++) {
    const data = bullets[i];

    if (data.anim_time === 1) {
      bullets.splice(i, 1);
      continue;
    }

    bullets[i].anim_time = Math.min(bullets[i].anim_time + Globals.Frametime() * 0.25, 1);

    const from_wts = Render.WorldToScreen(data.from), to_wts = Render.WorldToScreen(data.to);

    if (!from_wts || !to_wts)  continue;
    if (!IsPointInsideScreen(from_wts) || !IsPointInsideScreen(to_wts))  continue;

    Render.Line(from_wts[0], from_wts[1], to_wts[0], to_wts[1], [tracer[0], tracer[1], tracer[2], tracer[3] * (1 - data.anim_time)]);
    Render.Line(to_wts[0] - 5, to_wts[1], to_wts[0] + 5, to_wts[1], [xhair[0], xhair[1], xhair[2], xhair[3] * (1 - data.anim_time)]);
    Render.Line(to_wts[0], to_wts[1] - 5, to_wts[0], to_wts[1] + 5, [xhair[0], xhair[1], xhair[2], xhair[3] * (1 - data.anim_time)]);
}
  }

function onBulletImpact24() {
  const me = Entity.GetLocalPlayer();
  const userid = Entity.GetEntityFromUserID(Event.GetInt("userid"));

  if (me !== userid)
    return;

  const x = Event.GetFloat("x"), y = Event.GetFloat("y"), z = Event.GetFloat("z");
  const eye_pos = Entity.GetEyePosition(me);

  bullets.push({
    anim_time: 0,
    from: eye_pos,
    to: [x, y, z]
  });
}
Cheat.RegisterCallback("Draw", "onDraw24");
Cheat.RegisterCallback("bullet_impact", "onBulletImpact24");

UI.AddLabel( "             ___________________" );
const x1 = UI.AddSliderInt("Hotkeys_x", 0, Global.GetScreenSize()[0]);
const y1 = UI.AddSliderInt("Hotkeys_y", 0, Global.GetScreenSize()[1]);
