Crack Lua Icetools

Начинающий
Статус
Оффлайн
Регистрация
2 Мар 2022
Сообщения
10
Реакции[?]
5
Поинты[?]
0

Данный скрипт не проверялся модераторами, так как является кряком приватной LUA и в нём может присутствовать обфускация. Даже известные пользователи могут выложить вредоносный скрипт под видом крякнутого, поэтому любое использование исключительно на свой страх и риск.

Код:
--> ffi and just e boss smecheros
local ffi_handler = {}

ffi.cdef[[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct_t;
    typedef int(__thiscall* get_clipboard_text_count)(void*);
    typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
    typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);
    typedef int(__fastcall* clantag_t)(const char*, const char*);
]]

ffi_handler.cvar_interface = ffi.cast("uintptr_t**", Utils.CreateInterface("vstdlib.dll", "VEngineCvar007"))
ffi_handler.print = ffi.cast("void(__cdecl*)(void*,const color_struct_t&, const char*, ...)", ffi_handler.cvar_interface[0][25])

ffi_handler.color_print = function(color, text)
    if color == nil then
        return
    end

    local col = ffi.new("color_struct_t")
    col.r = color.r * 255
    col.g = color.g * 255
    col.b = color.b * 255
    col.a = color.a * 255
    ffi_handler.print(ffi_handler.cvar_interface, col, text)
end

local VGUI_System010 =  Utils.CreateInterface("vgui2.dll", "VGUI_System010")
local VGUI_System = ffi.cast(ffi.typeof('void***'), VGUI_System010 )

local get_clipboard_text_count = ffi.cast( "get_clipboard_text_count", VGUI_System[ 0 ][ 7 ] )
local set_clipboard_text = ffi.cast( "set_clipboard_text", VGUI_System[ 0 ][ 9 ] )
local get_clipboard_text = ffi.cast( "get_clipboard_text", VGUI_System[ 0 ][ 11 ] )

local function str_to_sub(input, sep)
    local t = {}
    for str in string.gmatch(input, "([^"..sep.."]+)") do
        t[#t + 1] = string.gsub(str, "\n", "")
    end
    return t
end

local function arr_to_string(arr)
    arr = arr:Get()
    local str = ""
    for i=1, #arr do
        str = str .. arr[i] .. (i == #arr and "" or ",")
    end

    if str == "" then
        str = "-"
    end

    return str
end

local function to_boolean(str)
    if str == "true" or str == "false" then
        return (str == "true")
    else
        return str
    end
end

local function clipboard_import()
    local clipboard_text_length = get_clipboard_text_count( VGUI_System )
    local clipboard_data = ""

    if clipboard_text_length > 0 then
        buffer = ffi.new("char[?]", clipboard_text_length)
        size = clipboard_text_length * ffi.sizeof("char[?]", clipboard_text_length)

        get_clipboard_text( VGUI_System, 0, buffer, size )

        clipboard_data = ffi.string( buffer, clipboard_text_length-1 )
    end
    return clipboard_data
end

local function clipboard_export(string)
    if string then
        set_clipboard_text(VGUI_System, string, string:len())
    end
end

local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -- You will need this for encoding/decoding

function enc(data)
    return ((data:gsub('.', function(x)
        local r,b='',x:byte()
        for i=8,1,-1 do r=r..(b%2^i-b%2^(i-1)>0 and '1' or '0') end
        return r;
    end)..'0000'):gsub('%d%d%d?%d?%d?%d?', function(x)
        if (#x < 6) then return '' end
        local c=0
        for i=1,6 do c=c+(x:sub(i,i)=='1' and 2^(6-i) or 0) end
        return b:sub(c+1,c+1)
    end)..({ '', '==', '=' })[#data%3+1])
end

function dec(data)
    data = string.gsub(data, '[^'..b..'=]', '')
    return (data:gsub('.', function(x)
        if (x == '=') then return '' end
        local r,f='',(b:find(x)-1)
        for i=6,1,-1 do r=r..(f%2^i-f%2^(i-1)>0 and '1' or '0') end
        return r;
    end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x)
        if (#x ~= 8) then return '' end
        local c=0
        for i=1,8 do c=c+(x:sub(i,i)=='1' and 2^(8-i) or 0) end
            return string.char(c)
    end))
end

--> User interface
--local menu_active_tab = Menu.Combo("Tabs", "Active tab", {"Ragebot", "Anti-Aim", "Anti-Bruteforce", "Visuals", "Miscellaneous", "Configs", "Informations"}, 0)
local menu_active_tab = Menu.Combo("Tabs", "Active tab", {"Global", "Ragebot", "Anti-Aim", "Anti-Bruteforce", "Visuals", "Miscellaneous"}, 0)
local js = Panorama.LoadString([[
    return {
        OpenExternalBrowserURL: function(url){
            void SteamOverlayAPI.OpenExternalBrowserURL(url)
        }
    }
]])()

local var = {
    conditions = {"Dormant", "Moving", "Standing", "T Crouching", "CT Crouching", "Slow Walk", "In Air"},
    conditions_to_int = {["Dormant"] = 1, ["Moving"] = 2, ["Standing"] = 3, ["T Crouching"] = 4, ["CT Crouching"] = 5, ["Slow Walk"] = 6, ["In Air"] = 7},
    active_i = 1,
    p_state = 0
}

local anti_aim = {}

for i = 1,7 do
    anti_aim[i] = {
        --yaw_base = Menu.Combo("In Air", "Yaw Base", {"Forward", "Backward", "Right", "Left", "At Target", "Freestanding"}, 0),
        yaw_add_type = Menu.Combo(tostring(var.conditions[i]), "Yaw Add Type", {"Static", "Jitter", "Random"}, 0),
        yaw_add_left = Menu.SliderInt(tostring(var.conditions[i]), "Yaw Add Left", 0, -180, 180),
        yaw_add_right = Menu.SliderInt(tostring(var.conditions[i]), "Yaw Add Right", 0, -180, 180),
        yaw_modifier = Menu.Combo(tostring(var.conditions[i]), "Yaw Modifier", {"Disabled", "Center", "Offset", "Random", "Spin"}, 0),
        yaw_modifier_value = Menu.SliderInt(tostring(var.conditions[i]), "Modifier Degree", 0, -180, 180),
        fake_limit_type = Menu.Combo(tostring(var.conditions[i]), "Fake Limit Type", {"Static", "Jitter", "Random"}, 0),
        fake_limit_left = Menu.SliderInt(tostring(var.conditions[i]), "Fake Limit Left", 60, 0, 60),
        fake_limit_right = Menu.SliderInt(tostring(var.conditions[i]), "Fake Limit Right", 60, 0, 60),
        fake_options = Menu.MultiCombo(tostring(var.conditions[i]), "Fake Options", {"Avoid overlap", "Jitter", "Randomize Jitter"}, 0),
        lby_mode = Menu.Combo(tostring(var.conditions[i]), "LBY Mode", {"Disabled", "Opposite", "Sway"}, 0),
        freestanding_desync = Menu.Combo(tostring(var.conditions[i]), "Freestanding Desync", {"Off", "Peek Fake", "Peek Real", "Smart"}, 0),
        desync_onshot = Menu.Combo(tostring(var.conditions[i]), "Desync On Shot", {"Disabled", "Opposite", "Freestanding", "Switch", "Smart"}, 0),
    }
end

local menu = {
    edgeyaw = Menu.Switch("Anti-Aim Settings", "Edge Yaw", false),
    anti_backstab = Menu.Switch("Anti-Aim Settings", "Anti Backstab", false),
    warmup_aa = Menu.Switch("Anti-Aim Settings", "Disable anti-aim on warm up", false),
    enable_conditions = Menu.Switch("Anti-Aim Settings", "Enable conditional anti-aim", false),
    antiaim_conditions = Menu.Combo("Anti-Aim Settings", "Active condition", var.conditions, 0),
    --> Ragebot
    rage_enable = Menu.Switch("Ragebot Settings", "Master switch", false),
    hitchance_override = Menu.Switch("Ragebot Settings", "In air/no scope hitchance override", false),
    override_options = Menu.MultiCombo("Ragebot Settings", "Override options", {"In air", "No scope"}, 0),
    inair_value = Menu.SliderInt("Ragebot Settings", "In air hitchance", 45, 0, 100),
    noscope_value = Menu.SliderInt("Ragebot Settings", "No scope hitchance", 45, 0, 100),
    dt_improvements = Menu.Switch("Ragebot Settings", "DT speed improvements", false),
    dormant_enable = Menu.Switch("Ragebot Settings", "Dormant Aimbot", false),
    dormant_damage = Menu.SliderInt("Ragebot Settings", "Minimum damage", 1, 1, 100),
    --> Visuals
    visuals_enable = Menu.Switch("Visuals Settings", "Master switch", false),
    cross_indicators = Menu.Switch("Visuals Settings", "Crosshair indicators", false),
    indicator_options = Menu.MultiCombo("Visuals Settings", "Indicator options", {"LUA name", "Arrows", "Exploits", "Desync value", "AA state"}, 0),
    name_color = Menu.ColorEdit("Visuals Settings", "LUA name color", Color.new(1,1,1,1)),
    arrows_color = Menu.ColorEdit("Visuals Settings", "Arrows color", Color.new(1,1,1,1)),
    arrows_alpha = Menu.SliderInt("Visuals Settings", "Max arrows alpha", 255, 0, 255),
    damage_indicator = Menu.Switch("Visuals Settings", "Minimum damage indicator", false),
    menu_blur = Menu.SwitchColor("Visuals Settings", "Blur on menu open", false, Color.new(0,0,0,1)),
    blur_combo = Menu.Combo("Visuals Settings", "Blur type", {"Static", "Pulse"}, 0),
    custom_scope = Menu.SwitchColor("Visuals Settings", "Custom scope", false, Color.new(1,1,1,1)),
    scope_origin = Menu.SliderInt("Visuals Settings", "Scope origin", 0, 0, 100),
    scope_width = Menu.SliderInt("Visuals Settings", "Scope width", 0, 0, 100),
    --> Miscellaneous
    misc_enable = Menu.Switch("Misc Settings", "Master switch", false),
    legmovement = Menu.Switch("Misc Settings", "Leg movement", false),
    legmovement_options = Menu.Combo("Misc Settings", "Leg movement mode", {"Jitter", "Static"}, 0),
    ragebot_logs = Menu.Switch("Misc Settings", "Log ragebot shots", false),
    ragebot_logs_options = Menu.MultiCombo("Misc Settings", "Logging options", {"Events", "Console"}, 0),
    console_color = Menu.SwitchColor("Misc Settings", "Custom console color", false, Color.new(1.0, 1.0, 1.0)),
    thirdperson_anim = Menu.Switch("Misc Settings", "Disable thirdperson animation", false),
    killsay = Menu.Switch("Misc Settings", "Gorgeous killsay", false),
    clantag_changer = Menu.Switch("Misc Settings", "Clantag changer", false),
    --> Anti-bruteforce
    antibrute = Menu.Switch("Anti-bruteforce Settings", "Master Switch", false),
    antibrute_options = Menu.MultiCombo("Anti-bruteforce Settings", "Anti-bruteforce on", {"Hit", "Miss"}, 0),
    antibrute_logs = Menu.Switch("Anti-bruteforce Settings", "Anti-bruteforce logs", false),
    reset_info = Menu.Switch("Anti-bruteforce Settings", "Reset anti-bruteforce info after x secs", false),
    reset_info_value = Menu.SliderInt("Anti-bruteforce Settings", "Value", 10, 5, 20),
    --> Informations
    info_text = Menu.Text("Informations", "Welcome "..Cheat.GetCheatUserName().."!\n\nVersion: LIVE (1.3.9) \n\nIf you have problems with lua/smth else, add me on discord: Dauntlessik#7989\n"),
    discord_button = Menu.Button("Informations", "Discord server", "You will get automatically redirected to our discord server", function() js.OpenExternalBrowserURL("https://discord.gg/QqfSP8bsFY") end),
    youtube_button = Menu.Button("Informations", "Youtube channel", "You will get automatically redirected to Dauntlessik's youtube channel", function() js.OpenExternalBrowserURL("https://youtube.com/Dauntlessik") end),
}

local function export_cfg()
    local str = ""

    for i=1, 7 do

        str = str .. tostring(anti_aim[i].yaw_add_type:Get()) .. "|"
        .. tostring(anti_aim[i].yaw_add_left:Get()) .. "|"
        .. tostring(anti_aim[i].yaw_add_right:Get()) .. "|"
        .. tostring(anti_aim[i].yaw_modifier:Get()) .. "|"
        .. tostring(anti_aim[i].yaw_modifier_value:Get()) .. "|"
        .. tostring(anti_aim[i].fake_limit_type:Get()) .. "|"
        .. tostring(anti_aim[i].fake_limit_left:Get()) .. "|"
        .. tostring(anti_aim[i].fake_limit_right:Get()) .. "|"
        .. tostring(anti_aim[i].fake_options:Get()) .. "|"
        .. tostring(anti_aim[i].lby_mode:Get()) .. "|"
        .. tostring(anti_aim[i].freestanding_desync:Get()) .. "|"
        .. tostring(anti_aim[i].desync_onshot:Get()) .. "|"
    end

    str = str .. tostring(menu.edgeyaw:Get()) .. "|"
    .. tostring(menu.anti_backstab:Get()) .. "|"
    .. tostring(menu.enable_conditions:Get()) .. "|"
    .. tostring(menu.rage_enable:Get()) .. "|"
    .. tostring(menu.hitchance_override:Get()) .. "|"
    .. tostring(menu.override_options:Get()) .. "|"
    .. tostring(menu.inair_value:Get()) .. "|"
    .. tostring(menu.noscope_value:Get()) .. "|"
    .. tostring(menu.dt_improvements:Get()) .. "|"
    .. tostring(menu.antibrute:Get()) .. "|"
    .. tostring(menu.antibrute_options:Get()) .. "|"
    .. tostring(menu.antibrute_logs:Get()) .. "|"
    .. tostring(menu.reset_info:Get()) .. "|"
    .. tostring(menu.reset_info_value:Get()) .. "|"
    .. tostring(menu.visuals_enable:Get()) .. "|"
    .. tostring(menu.cross_indicators:Get()) .. "|"
    .. tostring(menu.indicator_options:Get()) .. "|"
    .. tostring(menu.arrows_alpha:Get()) .. "|"
    .. tostring(menu.damage_indicator:Get()) .. "|"
    .. tostring(menu.misc_enable:Get()) .. "|"
    .. tostring(menu.legmovement:Get()) .. "|"
    .. tostring(menu.legmovement_options:Get()) .. "|"
    .. tostring(menu.ragebot_logs:Get()) .. "|"
    .. tostring(menu.ragebot_logs_options:Get()) .. "|"
    .. tostring(menu.console_color:Get()) .. "|"
    .. tostring(menu.thirdperson_anim:Get()) .. "|"
    .. tostring(menu.killsay:Get()) .. "|"
    .. tostring(menu.menu_blur:Get()) .. "|"
    .. tostring(menu.blur_combo:Get()) .. "|"
    .. tostring(menu.dormant_enable:Get()) .. "|"
    .. tostring(menu.dormant_damage:Get()) .. "|"
    .. tostring(menu.custom_scope:Get()) .. "|"
    .. tostring(menu.scope_origin:Get()) .. "|"
    .. tostring(menu.scope_width:Get()) .. "|"
    .. tostring(menu.clantag_changer:Get()) .. "|"
    clipboard_export(enc(str))
    ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
    ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Config has been exported successfully!\n")
end

local function load_cfg(input)
    local tbl = str_to_sub(input, "|")

    for i=1, 7 do
        anti_aim[i].yaw_add_type:Set(tonumber(tbl[1 + (12 * (i - 1))]))
        anti_aim[i].yaw_add_left:Set(tonumber(tbl[2 + (12 * (i - 1))]))
        anti_aim[i].yaw_add_right:Set(tonumber(tbl[3 + (12 * (i - 1))]))
        anti_aim[i].yaw_modifier:Set(tonumber(tbl[4 + (12 * (i - 1))]))
        anti_aim[i].yaw_modifier_value:Set(tonumber(tbl[5 + (12 * (i - 1))]))
        anti_aim[i].fake_limit_type:Set(tonumber(tbl[6 + (12 * (i - 1))]))
        anti_aim[i].fake_limit_left:Set(tonumber(tbl[7 + (12 * (i - 1))]))
        anti_aim[i].fake_limit_right:Set(tonumber(tbl[8 + (12 * (i - 1))]))
        anti_aim[i].fake_options:Set(tonumber(tbl[9 + (12 * (i - 1))]))
        anti_aim[i].lby_mode:Set(tonumber(tbl[10 + (12 * (i - 1))]))
        anti_aim[i].freestanding_desync:Set(tonumber(tbl[11 + (12 * (i - 1))]))
        anti_aim[i].desync_onshot:Set(tonumber(tbl[12 + (12 * (i - 1))]))
    end

    menu.edgeyaw:Set(to_boolean(tbl[85]))
    menu.anti_backstab:Set(to_boolean(tbl[86]))
    menu.enable_conditions:Set(to_boolean(tbl[87]))
    menu.rage_enable:Set(to_boolean(tbl[88]))
    menu.hitchance_override:Set(to_boolean(tbl[89]))
    menu.override_options:Set(tonumber(tbl[90]))
    menu.inair_value:Set(tonumber(tbl[91]))
    menu.noscope_value:Set(tonumber(tbl[92]))
    menu.dt_improvements:Set(to_boolean(tbl[93]))
    menu.antibrute:Set(to_boolean(tbl[94]))
    menu.antibrute_options:Set(tonumber(tbl[95]))
    menu.antibrute_logs:Set(to_boolean(tbl[96]))
    menu.reset_info:Set(to_boolean(tbl[97]))
    menu.reset_info_value:Set(tonumber(tbl[98]))
    menu.visuals_enable:Set(to_boolean(tbl[99]))
    menu.cross_indicators:Set(to_boolean(tbl[100]))
    menu.indicator_options:Set(tonumber(tbl[101]))
    menu.arrows_alpha:Set(tonumber(tbl[102]))
    menu.damage_indicator:Set(to_boolean(tbl[103]))
    menu.misc_enable:Set(to_boolean(tbl[104]))
    menu.legmovement:Set(to_boolean(tbl[105]))
    menu.legmovement_options:Set(tonumber(tbl[106]))
    menu.ragebot_logs:Set(to_boolean(tbl[107]))
    menu.ragebot_logs_options:Set(tonumber(tbl[108]))
    menu.console_color:Set(to_boolean(tbl[109]))
    menu.thirdperson_anim:Set(to_boolean(tbl[110]))
    menu.killsay:Set(to_boolean(tbl[111]))
    menu.menu_blur:Set(to_boolean(tbl[112]))
    menu.blur_combo:Set(tonumber(tbl[113]))
    menu.dormant_enable:Set(to_boolean(tbl[114]))
    menu.dormant_damage:Set(tonumber(tbl[115]))
    menu.custom_scope:Set(to_boolean(tbl[116]))
    menu.scope_origin:Set(tonumber(tbl[117]))
    menu.scope_width:Set(tonumber(tbl[118]))
    menu.clantag_changer:Set(to_boolean(tbl[119]))
    ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
    ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Config has been imported successfully!\n")
end

local function load_defcfg()
    load_cfg(dec(Http.Get("https://pastebin.com/raw/5KmEvkxh")))
    Cheat.AddNotify("- icetools -", "Successfully loaded default settings!")
end

local export_config = Menu.Button("Configs", "Export config to clipboard", "", function() export_cfg() end)
local import_config = Menu.Button("Configs", "Import config from clipboard", "", function() load_cfg(dec(clipboard_import())) end)
local default_config = Menu.Button("Configs", "Load default config", "", function() load_defcfg() end)

function MenuVisibility()
    --> Anti-Aim
    menu.enable_conditions:SetVisible(menu_active_tab:Get() == 2)
    menu.antiaim_conditions:SetVisible(menu_active_tab:Get() == 2 and menu.enable_conditions:Get())
    menu.anti_backstab:SetVisible(menu_active_tab:Get() == 2)
    menu.edgeyaw:SetVisible(menu_active_tab:Get() == 2)
    menu.warmup_aa:SetVisible(menu_active_tab:Get() == 2)
    --> Ragebot
    menu.rage_enable:SetVisible(menu_active_tab:Get() == 1)
    menu.hitchance_override:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get())
    menu.override_options:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get() and menu.hitchance_override:Get())
    menu.inair_value:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get() and menu.hitchance_override:Get() and menu.override_options:Get(1 or 3))
    menu.noscope_value:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get() and menu.hitchance_override:Get() and menu.override_options:Get(2 or 3))
    menu.dt_improvements:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get())
    menu.dormant_enable:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get())
    menu.dormant_damage:SetVisible(menu_active_tab:Get() == 1 and menu.rage_enable:Get() and menu.dormant_enable:Get())
    --> Visuals
    menu.visuals_enable:SetVisible(menu_active_tab:Get() == 4)
    menu.cross_indicators:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get())
    menu.indicator_options:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get() and menu.cross_indicators:Get())
    menu.name_color:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get() and menu.cross_indicators:Get() and menu.indicator_options:Get(1 or 3 or 5 or 7))
    menu.arrows_color:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get() and menu.cross_indicators:Get() and menu.indicator_options:Get(2 or 3 or 6 or 7))
    menu.arrows_alpha:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get() and menu.cross_indicators:Get() and menu.indicator_options:Get(2 or 3 or 6 or 7))
    menu.damage_indicator:SetVisible(menu_active_tab:Get() == 4 and menu.visuals_enable:Get())
    menu.menu_blur:SetVisible(menu_active_tab:Get() == 4 and menu.misc_enable:Get())
    menu.blur_combo:SetVisible(menu_active_tab:Get() == 4 and menu.misc_enable:Get() and menu.menu_blur:Get())
    menu.custom_scope:SetVisible(menu_active_tab:Get() == 4 and menu.misc_enable:Get())
    menu.scope_width:SetVisible(menu_active_tab:Get() == 4 and menu.misc_enable:Get() and menu.custom_scope:Get())
    menu.scope_origin:SetVisible(menu_active_tab:Get() == 4 and menu.misc_enable:Get() and menu.custom_scope:Get())
    --> Misc
    menu.misc_enable:SetVisible(menu_active_tab:Get() == 5)
    menu.legmovement:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    menu.legmovement_options:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get() and menu.legmovement:Get())
    menu.ragebot_logs:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    menu.ragebot_logs_options:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get() and menu.ragebot_logs:Get())
    menu.console_color:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    menu.thirdperson_anim:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    menu.killsay:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    menu.clantag_changer:SetVisible(menu_active_tab:Get() == 5 and menu.misc_enable:Get())
    --> Anti-bruteforce
    menu.antibrute:SetVisible(menu_active_tab:Get() == 3)
    menu.antibrute_options:SetVisible(menu_active_tab:Get() == 3 and menu.antibrute:Get())
    menu.antibrute_logs:SetVisible(menu_active_tab:Get() == 3 and menu.antibrute:Get())
    menu.reset_info:SetVisible(menu_active_tab:Get() == 3 and menu.antibrute:Get())
    menu.reset_info_value:SetVisible(menu_active_tab:Get() == 3 and menu.antibrute:Get() and menu.reset_info:Get())
    --> Informations
    menu.info_text:SetVisible(menu_active_tab:Get() == 0)
    menu.discord_button:SetVisible(menu_active_tab:Get() == 0)
    menu.youtube_button:SetVisible(menu_active_tab:Get() == 0)
    --> Configs
    export_config:SetVisible(menu_active_tab:Get() == 0)
    import_config:SetVisible(menu_active_tab:Get() == 0)
    default_config:SetVisible(menu_active_tab:Get() == 0)

    var.active_i = menu.antiaim_conditions:Get() + 1
    for i = 1,7 do
        anti_aim[i].yaw_add_type:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].yaw_add_left:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].yaw_add_right:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].yaw_modifier:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].yaw_modifier_value:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2 and anti_aim[i].yaw_modifier:Get() ~= 0)
        anti_aim[i].fake_limit_type:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].fake_limit_right:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].fake_limit_left:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].fake_options:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].lby_mode:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].freestanding_desync:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
        anti_aim[i].desync_onshot:SetVisible(var.active_i == i and menu.enable_conditions:Get() and menu_active_tab:Get() == 2)
    end
end

--> welcum message
function WelcomeMessage()
    EngineClient.ExecuteClientCmd("clear")
    print("     .... NO! ...                  ... MNO! ...\n   ..... MNO!! ...................... MNNOO! ...\n ..... MMNO! ......................... MNNOO!! .\n..... MNOONNOO!   MMMMMMMMMMPPPOII!   MNNO!!!! .\n ... !O! NNO! MMMMMMMMMMMMMPPPOOOII!! NO! ....\n    ...... ! MMMMMMMMMMMMMPPPPOOOOIII! ! ...\n   ........ MMMMMMMMMMMMPPPPPOOOOOOII!! .....\n   ........ MMMMMOOOOOOPPPPPPPPOOOOMII! ...\n    ....... MMMMM..    OPPMMP    .,OMI! ....\n     ...... MMMM::   o.,OPMP,.o   ::I!! ...\n         .... NNM:::.,,OOPM!P,.::::!! ....\n          .. MMNNNNNOOOOPMO!!IIPPO!!O! .....\n         ... MMMMMNNNNOO:!!:!!IPPPPOO! ....\n           .. MMMMMNNOOMMNNIIIPPPOO!! ......\n          ...... MMMONNMMNNNIIIOO!..........\n       ....... MN MOMMMNNNIIIIIO! OO ..........\n    ......... MNO! IiiiiiiiiiiiI OOOO ...........\n  ...... NNN.MNO! . O!!!!!!!!!O . OONO NO! ........\n   .... MNNNNNO! ...OOOOOOOOOOO .  MMNNON!........\n   ...... MNNNNO! .. PPPPPPPPP .. MMNON!........\n      ...... OO! ................. ON! .......\n         ................................\n")
    print("____________________________________________________________________\n")
    print("  > Welcome " .. Cheat.GetCheatUserName() .. "!")
    print("     • Thanks for loading icetools,")
    print("     • if you have any problems/suggestions, add me on discord: Dauntlessik#7989")
    print("     • for more informations use '-help' command.")
    print("  > Current build: LIVE (1.3.9)")
    print("     • Last update - 23.12.2021.\n\n")
end
WelcomeMessage()

function CustomCommands(text)
    if text == "-help" then
        print("\n[icetools] Avaliable commands:")
        print(" ")
        print("  > -discord - Redirects to icetools' discord server")
        print("  > -youtube - Redirects to Dauntlessik's youtube channel")
        print("  > -export - Exports active config to clipboard")
        print("  > -import - Imports config from clipboard")
        print("  > -loadsettings - Loads recommended lua settings")
        print(" ")
    end
    if text == "-discord" then
        js.OpenExternalBrowserURL("https://discord.gg/QqfSP8bsFY")
        print("  > Successfully redirected to icetools' discord server!")
    end
    if text == "-youtube" then
        js.OpenExternalBrowserURL("https://youtube.com/Dauntlessik")
        print("  > Successfully redirected to Dauntlessik's youtube channel!")
    end
    if text == "-loadsettings" then
        load_defcfg()
        print("  > Successfully loaded recommended settings!")
    end
    if text == "-export" then
        export_cfg()
    end
    if text == "-import" then
        load_cfg(dec(clipboard_import()))
    end
end

--> Local(s)
local ref_base = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Base")
local ref_yawadd = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Add")
local ref_leftlimit = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Left Limit")
local ref_damage = Menu.FindVar("Aimbot", "Ragebot", "Accuracy", "Minimum Damage")
local ref_rightlimit = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Right Limit")
local ref_yawmodifier = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Yaw Modifier")
local ref_yawmodifierdegree = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Modifier Degree")
local ref_slowwalk = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Slow Walk")
local ref_fakeoptions = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Fake Options")
local ref_desync_freestand = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Freestanding Desync")
local ref_lbymode = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "LBY Mode")
local ref_onshot = Menu.FindVar("Aimbot", "Anti Aim", "Fake Angle", "Desync On Shot")
local ref_fakeduck = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Fake Duck")
local ref_dt = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Double Tap")
local ref_hs = Menu.FindVar("Aimbot", "Ragebot", "Exploits", "Hide Shots")
local ref_legmovement = Menu.FindVar("Aimbot", "Anti Aim", "Misc", "Leg Movement")
local ref_antiaim = Menu.FindVar("Aimbot", "Anti Aim", "Main", "Enable Anti Aim")

local phrases = {
    "??? ? ??? ????? ? ??? ???? ???????? ???? ?",
    "???? ?????? ??????, ? ???? ???? ??",
    "如果你殺了我 shoppy.gg/@dauntless1337 我會給你一個哇吻",
    "我寧願讓你操蛋也不願殺了icetools哈哈",
    "記住我在使用 icetools.lua 時是最好的",
    "你不能殺 買我的配置 shoppy.gg/@dauntless1337 書呆子",
    "Ты не можешь убить? Купите мой конфиг shoppy.gg/@dauntless1337 болван"
}

local font = Render.InitFont("Smallest Pixel-7", 9)

local last_shooter
local can_reset

local hitgroups = {
    [0] = "generic",
    [1] = "head",
    [2] = "chest",
    [3] = "stomach",
    [4] = "left arm",
    [5] = "right arm",
    [6] = "left leg",
    [7] = "right leg",
    [10] = "gear"
}
local shotss = 0

local aim_tick = 0

local min = Vector.new()
local max = Vector.new()

local antiaim_state = " "

local toleng = 0
local y
local leng = toleng

local fn_change_clantag = Utils.PatternScan("engine.dll", "53 56 57 8B DA 8B F9 FF 15")
local set_clantag = ffi.cast("clantag_t", fn_change_clantag)
local animation = {"ic", "ice", "icet", "iceto", "icetoo", "icetool", "icetools", "icet00ls", "icetools", "icet00ls", "icetools", "icetool", "icetoo", "iceto", "icet", "ice", "ic", "i", " ",}
local animation2 = {" ",}
local old_time = 0

local brute = {
    fl_mode = "",
    tick_miss = 0,
    yaw_status = "",
    indexed_angle = 0,
    last_miss = 0,
    best_angle = 0,
    misses = 0,
    shootermisses = 0,
    right_misses = 0,
    left_misses = 0,
    playermode = 0
}

local engineClient = Utils.CreateInterface("engine.dll", "VEngineClient014")
local engineClientClass = ffi.cast(ffi.typeof("void***"), engineClient)
local isConsoleVisible = ffi.cast("bool(__thiscall*)(void*)", engineClientClass[0][11])

local consoleMaterials = {"vgui_white", "vgui/hud/800corner1", "vgui/hud/800corner2", "vgui/hud/800corner3", "vgui/hud/800corner4"}
local materialList = {}

local oldColor = Color.new(1.0, 1.0, 1.0, 1.0)
local oldConsoleIsVisible = false

--> Custom function(s)
function autostop(UserCmd)
    local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if localplayer == nil then return end
    local me = localplayer:GetPlayer()
    local vecvelocity1 = Vector.new(me:GetProp("m_vecVelocity[0]"), me:GetProp("m_vecVelocity[1]"), 0.0)
    local viewangles = me:GetEyePosition()
    local direction = Cheat.VectorToAngle(vecvelocity1)
    direction.yaw = UserCmd.viewangles.yaw - direction.yaw

    local forward = Cheat.AngleToForward(direction)
    local negative = Vector2.new(forward.x * -200, forward.y * -200)
    

    UserCmd.forwardmove = negative.x
    UserCmd.sidemove = negative.y
end

function calc_angle(src, dst)
    local vecdelta = Vector.new(dst.x - src.x, dst.y - src.y, dst.z - src.z)
    local angles = QAngle.new(math.atan2(-vecdelta.z, vecdelta:Length2D()) * 180.0 / math.pi, (math.atan2(vecdelta.y, vecdelta.x) * 180.0 / math.pi), 0.0)
    return angles
end

function get_dormant_enemy()
    local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if localplayer == nil then return end
    local me = localplayer:GetPlayer()
    local players = EntityList.GetEntitiesByName("CCSPlayer")
    for i = 1, #players do
        local enemies = players[i];
        local enemy = enemies:GetPlayer()
        if enemy ~= me and not enemy:IsTeamMate() and enemy:GetProp("DT_BasePlayer", "m_iHealth") > 0 and enemy:IsDormant() and enemy:GetNetworkState() == -1 then
            return i
        end
    end
end

local function is_inair(player) -- returns true if player is in air, false if not
    local flags = player:GetProp("DT_BasePlayer", "m_fFlags")
    if bit.band(flags, 1) == 0 then
        return true
    end
    return false
end

local function on_ground(player) -- returns true if player is in air, false if not
    local flags = player:GetProp("DT_BasePlayer", "m_fFlags")
    if bit.band(flags, 1) == 1 then
        return true
    end
    return false
end

local function is_crouching(player) -- returns true if player is in air, false if not
    local flags = player:GetProp("DT_BasePlayer", "m_fFlags")
    if bit.band(flags, 4) == 4 then
        return true
    end
    return false
end

local function get_phrase()
    return phrases[math.random(1, #phrases)]:gsub('\"', '')
end

local function world2scren(xdelta, ydelta)
    if xdelta == 0 and ydelta == 0 then
        return 0
    end
    return math.deg(math.atan2(ydelta, xdelta))
end

function normalize_yaw(yaw)
    while yaw > 180 do yaw = yaw - 360 end
    while yaw < -180 do yaw = yaw + 360 end
    return yaw
end

local function VectorLerp(vecSource, vecDestination, flPercentage)
    return vecSource + (vecDestination - vecSource) * flPercentage
end

function C_BaseEntity:m_iHealth()
    return self:GetProp("DT_BasePlayer", "m_iHealth")
end

local function CalcAngle(local_pos, enemy_pos)
    local ydelta = local_pos.y - enemy_pos.y
    local xdelta = local_pos.x - enemy_pos.x
    local relativeyaw = math.atan( ydelta / xdelta )
    relativeyaw = normalize_yaw( relativeyaw * 180 / math.pi )
    if xdelta >= 0 then
        relativeyaw = normalize_yaw(relativeyaw + 180)
    end
    return relativeyaw
end

function get_target()
    local me = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if me == nil then return nil end

    local lpos = me:GetRenderOrigin()
    local viewangles = EngineClient.GetViewAngles()

    local players = EntityList.GetPlayers()
    if players == nil or #players == 0 then
        return nil
    end

    local data = {}
    fov = 180
    for i = 1, #players do
        if players[i] == nil or players[i]:IsTeamMate() or players[i] == me or players[i]:IsDormant() or players[i]:m_iHealth() <= 0 then goto skip end
        local epos = players[i]:GetProp("m_vecOrigin")
        local cur_fov = math.abs(normalize_yaw(world2scren(lpos.x - epos.x, lpos.y - epos.y) - viewangles.yaw + 180))
        if cur_fov <= fov then
            data = {
                id = players[i],
                fov = cur_fov
            }
            fov = cur_fov
            
        end
        ::skip::
    end

    if data.id ~= nil then
        local epos = data.id:GetProp("m_vecOrigin")

        data.yaw = CalcAngle(lpos,epos)
    end

    return data
end

local function NormalizeYaw(flYaw)
    while flYaw > 180 do flYaw = flYaw - 360 end
    while flYaw < -180 do flYaw = flYaw + 360 end
    return flYaw
end

local function round(num, decimals)
    if num == nil then return 0 end
    local mult = 10^(decimals or 0)
    return math.floor(num * mult + 0.5) / mult
end

function can_enemy_hit_head(ent)
    if ent == nil then return end
    if is_inair(ent) then return false end
    local me = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
    
    local origin = ent:GetProp("m_vecOrigin")
    if origin_z == nil then return end
    origin_z = origin_z + 64

    local hitbox_center = me:GetHitboxCenter(0)
    local head_dmg = EngineTrace.TraceRay(Vector.new(origin.x, origin.y, origin.z), Vector.new(hitbox_center.x, hitbox_center.y, hitbox_center.z), ent, 0xFFFFFFFF)

    return head_dmg ~= nil and head_dmg > 25
end

local canSeePlayer = function(plyr, localplayer) -- checks if plyr is visible by localplayer
    local plyrOrigin = plyr:GetProp("DT_BaseEntity", "m_vecOrigin");
    local localOrigin = localplayer:GetProp("DT_BaseEntity", "m_vecOrigin");
    local origins = {Vector.new(plyrOrigin.x, plyrOrigin.y, plyrOrigin.z + 80.0)};
    local lOrigins = {Vector.new(localOrigin.x, localOrigin.y, localOrigin.z + 80.0)};
    for i = 1, table.getn(lOrigins), 1 do
        for u = 1, table.getn(origins), 1 do
            if ((Cheat.FireBullet(localplayer:GetPlayer(), lOrigins[i], origins[u]).damage > 0) or (Cheat.FireBullet(plyr, lOrigins[i], origins[u]).damage > 0)) then
                return true;
            end
        end
    end
    return false;
end

local function is_local_peeked() -- checks if localplayer is peeked
    local is_connected = EngineClient.IsConnected()
    if is_connected then
        peeking = false;
        local localPlayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer());
        local me = localPlayer:GetPlayer()
        local weapon = me:GetActiveWeapon()
        if weapon == nil then return end
        for i = 0, 32, 1 do
            local entity = EntityList.GetClientEntity(i)
            if (entity == nil or i == EngineClient.GetLocalPlayer() or not entity:IsPlayer()) then goto continue; end
            local player = entity:GetPlayer();
            if (player == nil or player:IsTeamMate()) then goto continue; end
            --local health = player:m_iHealth()
            local health = player:GetProp("DT_BasePlayer", "m_iHealth")

            local activeWeapon = player:GetActiveWeapon();
            if (activeWeapon == nil) then goto continue; end
            local next_primary_attack = activeWeapon:GetProp("DT_BaseCombatWeapon", "m_flNextPrimaryAttack")
            local canShoot = next_primary_attack < GlobalVars.curtime;
            if (canSeePlayer(player, localPlayer) and canShoot) then peeking = true; end
            ::continue::
        end
    end
    return peeking
end

function get_velocity(player) -- returns player velocity
    local x = player:GetProp("m_vecVelocity[0]")
    local y = player:GetProp("m_vecVelocity[1]")
    local z = player:GetProp("m_vecVelocity[2]")
    if x == nil then return end
    return math.sqrt(x*x + y*y + z*z)
end

local function isColorEquals(clr1, clr2)
    return (clr1.r == clr2.r and clr1.g == clr2.g and clr1.b == clr2.b and clr1.a == clr2.a)
end

local function copyColor(src, dest)
    dest.r, dest.g, dest.b, dest.a = src.r, src.g, src.b, src.a
end

local function findConsoleMaterials()
    if materialList[1] then return end

    local material = MatSystem.FirstMaterial()
    local foundCount = 0

    while(foundCount < 5)
    do
        local mat = MatSystem.GetMaterial(material)
        local name = mat:GetName()

        for i = 1, #consoleMaterials do
            if name == consoleMaterials[i] then
                materialList[i] = mat
                foundCount = foundCount + 1
                break
            end
        end

        material = MatSystem.NextMaterial(material)
    end
end

local function updateConsoleColor(r, g, b, a)
    for i = 1, #materialList do
        local mat = materialList[i]
        mat:ColorModulate(r, g, b)
        mat:AlphaModulate(a)
    end
end

local function cfgConsoleCallback()
    local color = menu.console_color:GetColor()

    if not menu.console_color:Get() then
        updateConsoleColor(1, 1, 1, 1)
    elseif isConsoleVisible(engineClientClass) then
        updateConsoleColor(color.r, color.g, color.b, color.a)
        copyColor(color, oldColor)
    end
end

--> Main function(s)
function drawConsole()
    if not menu.console_color:Get() or not menu.misc_enable:Get() then return end
    findConsoleMaterials()

    local color = menu.console_color:GetColor()
    local consoleVisible = isConsoleVisible(engineClientClass)

    if consoleVisible and not isColorEquals(oldColor, color) then
        updateConsoleColor(color.r, color.g, color.b, color.a)
        copyColor(color, oldColor)
    end

    if consoleVisible ~= oldConsoleIsVisible then
        if not consoleVisible then
            updateConsoleColor(1, 1, 1, 1)
        else
            updateConsoleColor(color.r, color.g, color.b, color.a)
        end

        oldConsoleIsVisible = consoleVisible
    end
end

Cheat.RegisterCallback("destroy", function()
    updateConsoleColor(1, 1, 1, 1)
    CVar.FindVar("r_drawvgui"):SetInt(1)
end)

menu.console_color:RegisterCallback(cfgConsoleCallback)
cfgConsoleCallback()

function RunShit()
    local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if me_ent == nil then return end
    local me = me_ent:GetPlayer()
    local flags = me:GetProp("DT_BasePlayer", "m_fFlags")
    local team = me:GetProp("DT_BaseEntity", "m_iTeamNum")
    local data = get_target()
    if is_inair(me) then -- in air
        var.p_state = 7
        antiaim_state = "air"
    end
    if on_ground(me) and get_velocity(me) > 2 and flags ~= 256 and flags ~= 263 then -- moving
        var.p_state = 2
        antiaim_state = "moving"
    end
    if on_ground(me) and get_velocity(me) < 2 and flags ~= 256 and flags ~= 263 then -- standing
        var.p_state = 3
        antiaim_state = "standing"
    end
    if is_crouching(me) and not is_inair(me) and team == 3 then -- ct crouch
        var.p_state = 5
        antiaim_state = "crouching"
    end
    if is_crouching(me) and not is_inair(me) and team == 2 then -- t crouch
        var.p_state = 4
        antiaim_state = "crouching"
    end
    if ref_slowwalk:Get() and get_velocity(me) > 2 then -- slow walk
        var.p_state = 6
        antiaim_state = "swalking"
    end
    if data.id == nil then -- dormant
        var.p_state = 1
        antiaim_state = "dormant"
    end
end

function BruteImpact(e)
    if menu.antibrute:Get() then
        if e:GetName() == "bullet_impact" then
            local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
            local local_player = me_ent:GetPlayer()
            local local_health = local_player:GetProp("DT_BasePlayer", "m_iHealth")
            if local_health > 0 then
                local ent = EntityList.GetPlayerForUserID(e:GetInt("userid"))
                if ent == local_player then return false end
                if not ent:IsTeamMate() then
                    local ent_shoot = ent:GetProp("DT_BaseEntity", "m_vecOrigin")
                    local view_offset = ent:GetProp( "DT_BasePlayer", "m_vecViewOffset[2]" )
                    ent_shoot.z = ent_shoot.z + ent:GetProp( "DT_BasePlayer", "m_vecViewOffset[2]" )
    
                    local lp_entity = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
                    local me = lp_entity:GetPlayer()
                    local hitbox_center = me:GetHitboxCenter(0)
                    local cx, cy, cz = e:GetFloat("x"), e:GetFloat("y"), e:GetFloat("z")
                    local a_to_p = { hitbox_center.x - ent_shoot.x, hitbox_center.y - ent_shoot.y }
                    local a_to_b = { cx - ent_shoot.x, cy - ent_shoot.y }
                    local ab = a_to_b[1]^2 + a_to_b[2]^2
                    local dots = a_to_p[1]*a_to_b[1] + a_to_p[2]*a_to_b[2]
                    local t = dots / ab
    
                    closest = { ent_shoot.x + a_to_b[1]*t, ent_shoot.y + a_to_b[2]*t }
    
                    local delta = { hitbox_center.x-closest[ 1 ], hitbox_center.y-closest[ 2 ] }
                    local delta_2d = math.sqrt( delta[ 1 ]^2+delta[ 2 ]^2 )
                    
                    if math.abs(delta_2d) < 32 then
                        brute.last_miss = GlobalVars.curtime
                        last_shooter = ent
                        can_swap = true
                        can_reset = true
                    end
                end
            end
        end
    end
end

function isLastEnemy()
    if last_shooter ~= nil then
        if last_shooter:GetProp("m_iHealth") == 0 then
            brute.shootermisses = 0
            brute.misses = 0
            last_shooter = nil
            if menu.antibrute_logs:Get() then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Anti-bruteforce info has been reset due to shooter death\n")
            end
            return
        end
    end
end

function ResetBruteInfo(e)
    if menu.antibrute:Get() then
        if e:GetName() == "player_death" then
            local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
            local me = EntityList.GetLocalPlayer()
            if victim == me then
                brute.shootermisses = 0
                brute.misses = 0
                CVar.FindVar("r_drawvgui"):SetInt(1)
                if menu.antibrute_logs:Get() then
                    ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                    ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Anti-bruteforce info has been reset due death\n")
                end
            end
        end
        if e:GetName() == "round_poststart" then
            brute.shootermisses = 0
            brute.misses = 0
            if menu.antibrute_logs:Get() then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Anti-bruteforce info has been reset due to new round\n")
            end
        end
    end
end

function AntiAim_sys()
    local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if me_ent == nil then return end
    local me = me_ent:GetPlayer()
    local inverter_state = AntiAim.GetInverterState()
    local data = get_target()
    if menu.enable_conditions:Get() then
        if anti_aim[var.p_state].yaw_add_type:Get() == 0 then
            if inverter_state then
                ref_yawadd:Set(anti_aim[var.p_state].yaw_add_right:Get())
            else
                ref_yawadd:Set(anti_aim[var.p_state].yaw_add_left:Get())
            end
        elseif anti_aim[var.p_state].yaw_add_type:Get() == 1 then
            if math.random(0,1) == 1 then
                ref_yawadd:Set(anti_aim[var.p_state].yaw_add_right:Get())
            else
                ref_yawadd:Set(anti_aim[var.p_state].yaw_add_left:Get())
            end
        else
            ref_yawadd:Set(math.random(anti_aim[var.p_state].yaw_add_right:Get(), anti_aim[var.p_state].yaw_add_left:Get()))
        end
        ref_yawmodifier:Set(anti_aim[var.p_state].yaw_modifier:Get())
        ref_yawmodifierdegree:Set(anti_aim[var.p_state].yaw_modifier_value:Get())
        if anti_aim[var.p_state].fake_limit_type:Get() == 0 then
            ref_leftlimit:Set(anti_aim[var.p_state].fake_limit_left:Get())
            ref_rightlimit:Set(anti_aim[var.p_state].fake_limit_right:Get())
        elseif anti_aim[var.p_state].fake_limit_type:Get() == 1 then
            if math.random(0,1) == 1 then
                ref_leftlimit:Set(anti_aim[var.p_state].fake_limit_left:Get())
                ref_rightlimit:Set(anti_aim[var.p_state].fake_limit_right:Get())
            else
                ref_rightlimit:Set(18)
                ref_leftlimit:Set(18)
            end
        elseif anti_aim[var.p_state].fake_limit_type:Get() == 2 then
            ref_rightlimit:Set(math.random(22, anti_aim[var.p_state].fake_limit_right:Get()))
            ref_leftlimit:Set(math.random(22, anti_aim[var.p_state].fake_limit_left:Get()))
        end
        ref_fakeoptions:Set(anti_aim[var.p_state].fake_options:Get())
        ref_lbymode:Set(anti_aim[var.p_state].lby_mode:Get())
        if anti_aim[var.p_state].desync_onshot:Get() == 0 or 1 or 2 or 3 then
            ref_onshot:Set(anti_aim[var.p_state].desync_onshot:Get())
        else
            if get_velocity(me) > 5 then
                if Cheat.IsKeyDown(0x41) and is_local_peeked() then
                    AntiAim.OverrideDesyncOnShot(2)
                elseif Cheat.IsKeyDown(0x44) and is_local_peeked() then
                    AntiAim.OverrideDesyncOnShot(1)
                end
            end
        end
        if anti_aim[var.p_state].freestanding_desync:Get() == 0 or 1 or 2 then
            ref_desync_freestand:Set(anti_aim[var.p_state].freestanding_desync:Get())
        else
            if is_local_peeked() then
                ref_desync_freestand:Set(2)
            else
                ref_desync_freestand:Set(1)
            end
        end
    end
    if can_swap == true then
        brute.shootermisses = brute.shootermisses + 1
        brute.misses = brute.misses + 1
        if menu.antibrute_logs:Get() then
            ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
            ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "Anti-aim switch due to anti-bruteforce\n")
        end
    end
    if brute.shootermisses == 1 then
        AntiAim.OverrideInverter(true)
    elseif brute.shootermisses == 2 then
        AntiAim.OverrideInverter(false)
    elseif brute.shootermisses == 3 then
        AntiAim.OverrideInverter(true)
    elseif brute.shootermisses == 4 then
        AntiAim.OverrideInverter(true)
    elseif brute.shootermisses == 6 then
        AntiAim.OverrideInverter(false)
    end

    if brute.shootermisses > 0 then
        antiaim_state = "antibruteforce:(" .. brute.shootermisses .. ")"
    end
end

function DisableAA()
    local game_rules = EntityList.GetGameRules()
    local get_prop = game_rules:GetProp("DT_CSGameRulesProxy", "m_bWarmupPeriod")
    if get_prop == true and menu.warmup_aa:Get() then
        ref_antiaim:Set(false)
        return
    else
        ref_antiaim:Set(true)
        return
    end
end

function TPAnimation()
    if menu.thirdperson_anim:Get() and menu.misc_enable:Get() then
        Cheat.SetThirdPersonAnim(false)
    else
        Cheat.SetThirdPersonAnim(true)
    end
end

function Killsay(e)
    if menu.misc_enable:Get() and menu.killsay:Get() then
        if e:GetName() ~= "player_death" then return end

        local me = EntityList.GetLocalPlayer()
        local victim = EntityList.GetPlayerForUserID(e:GetInt("userid"))
        local attacker = EntityList.GetPlayerForUserID(e:GetInt("attacker"))
    
        if victim == attacker or attacker ~= me then return end
    
        EngineClient.ExecuteClientCmd('say "' .. get_phrase() .. '"')
    end
end

function IndicatorsFunc()
    if not menu.cross_indicators:Get() or not menu.visuals_enable:Get() then return end
    local screensize = EngineClient.GetScreenSize()
    local x = screensize.x / 2
    local y = screensize.y / 2
    local ice_calc = Render.CalcTextSize("etools", 9, font)
    local yarrows = 0
    local ydt = 35
    local ydesync = 27
    local ice_calc2 = Render.CalcTextSize("dt", 9, font)
    local ice_calc3 = Render.CalcTextSize(">", 9, font)
    local inverter_state = AntiAim.GetInverterState();
    local is_charge = Exploits.GetCharge()
    local alpha = math.sin(math.abs(-math.pi + (GlobalVars.curtime * (1 / 0.7)) % (math.pi * 2))) * menu.arrows_alpha:Get()
    local real_rotation = AntiAim.GetCurrentRealRotation(); local desync_rotation = AntiAim.GetFakeRotation(); local max_desync_delta = AntiAim.GetMaxDesyncDelta(); local min_desync_delta = AntiAim.GetMinDesyncDelta(); local desync_delta = real_rotation - desync_rotation; if (desync_delta > max_desync_delta) then desync_delta = max_desync_delta elseif (desync_delta < min_desync_delta) then desync_delta = min_desync_delta end; local get_desync = math.floor(desync_delta)
    if menu.indicator_options:Get(1) then
        yarrows = 35
        ydt = 43
    end
    if menu.indicator_options:Get(5) then
        ydesync = 19
    end
    if menu.indicator_options:Get(2) then
        if inverter_state then
            Render.Text("<", Vector2.new(x - ice_calc.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,alpha/255), 9, font, true, true)
            Render.Text(">", Vector2.new(x + ice_calc.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,1), 9, font, true, true)
        else
            Render.Text("<", Vector2.new(x - ice_calc.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,1), 9, font, true, true)
            Render.Text(">", Vector2.new(x + ice_calc.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,alpha/255), 9, font, true, true)
        end
        if ref_base:Get() == 2 then
            Render.Text(">", Vector2.new(x + ice_calc.x + ice_calc3.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,1), 9, font, true, true)
        elseif ref_base:Get() == 3 then
            Render.Text("<", Vector2.new(x - ice_calc.x - ice_calc3.x, y + yarrows), Color.new(menu.arrows_color:GetColor().r, menu.arrows_color:GetColor().g, menu.arrows_color:GetColor().b,1), 9, font, true, true)
        end
    end
    if menu.indicator_options:Get(1) then
        Render.Text("icetools", Vector2.new(x, y + 35), Color.new(menu.name_color:GetColor().r, menu.name_color:GetColor().g, menu.name_color:GetColor().b, menu.name_color:GetColor().a), 9, font, true, true)
    end
    if menu.indicator_options:Get(3) then
        if ref_dt:Get() then
            if not ref_fakeduck:Get() then
                Render.Circle(Vector2.new(x + ice_calc2.x - 2, y + ydt + 1), 3.0, 200, Color.new(0/255, 0/255, 0/255, 0.3), 1.0, 0, is_charge*360)
                Render.Circle(Vector2.new(x + ice_calc2.x - 3, y + ydt), 3.0, 200, Color.new(152/255, 240/255, 16/255, 0.7), 1.0, 0, is_charge*360)
            else
                Render.Text("dt(fakeduck)", Vector2.new(x, y + ydt), Color.new(207/255,1/255,2/255,0.7), 9, font, true, true)
            end
            if is_charge > 0.8 and not ref_fakeduck:Get() then
                Render.Text("dt", Vector2.new(x + 1 - ice_calc2.x / 2, y + ydt), Color.new(150/255,200/255,60/255,0.7), 9, font, true, true)
            elseif is_charge < 0.8 and not ref_fakeduck:Get() then
                Render.Text("dt", Vector2.new(x + 1 - ice_calc2.x / 2, y + ydt), Color.new(207/255,1/255,2/255,0.7), 9, font, true, true)
            end
        elseif ref_hs:Get() then
            Render.Text("hide", Vector2.new(x, y + ydt), Color.new(191/255, 136/255, 58/255,0.7), 9, font, true, true)
        end
    end
    if menu.indicator_options:Get(4) then
        Render.Text(math.abs(get_desync) .. "%", Vector2.new(x, y + ydesync), Color.new(1,1,1,0.6), 9, font, true, true)
    end
    if menu.indicator_options:Get(5) then
        Render.Text(tostring(antiaim_state), Vector2.new(x, y + 27), Color.new(1,1,1,0.6), 9, font, true, true)
    end
end

function MinimumDamageInd()
    local screensize = EngineClient.GetScreenSize()
    local x = screensize.x / 2
    local y = screensize.y / 2
    if menu.damage_indicator:Get() and menu.visuals_enable:Get() then
        Render.Text(tostring(ref_damage:Get()), Vector2.new(x + 10, y - 10), Color.new(1,1,1,1), 9, font, true)
    end
end

function HcOverride()
    if not menu.rage_enable:Get() or not menu.hitchance_override:Get() then return end
    local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    local local_player = me_ent:GetPlayer()

    local active_weapon = local_player:GetActiveWeapon()
    if active_weapon == nil then return end
    local weapon_id = active_weapon:GetWeaponID()
    local players = EntityList.GetPlayers()
    local player = EntityList.GetLocalPlayer()
    local scoped = player:GetProp("mbIsScoped");

    for _, player in ipairs(players) do
        if not player:IsTeamMate() then
            local user_index = player:EntIndex()
            if menu.override_options:Get(1 or 3) then
                if weapon_id == 40 and is_inair(local_player) then
                    RageBot.OverrideHitchance(user_index, menu.inair_value:Get())
                end
            end
            if menu.override_options:Get(2 or 3) then
                if weapon_id == 11 or weapon_id == 38 and not scoped then
                    RageBot.OverrideHitchance(user_index, menu.noscope_value:Get())
                end
            end
        end
    end
end

function DTImprovement()
    if not menu.rage_enable:Get() or not menu.dt_improvements:Get() then return end
    local GetNetChannelInfo = EngineClient.GetNetChannelInfo()
    local ping = GetNetChannelInfo:GetAvgLatency(0) * 1000

    if ping <= 50 then
        CVar.FindVar("sv_maxusrcmdprocessticks"):SetInt(18)
        Exploits.OverrideDoubleTapSpeed(18)
        CVar.FindVar("cl_clock_correction"):SetInt(0)
        CVar.FindVar("cl_clock_correction_adjustment_max_amount"):SetInt(450)
    end
    if ping >= 60 and ping < 60  then
        CVar.FindVar("sv_maxusrcmdprocessticks"):SetInt(16)
        Exploits.OverrideDoubleTapSpeed(16)
        CVar.FindVar("cl_clock_correction"):SetInt(0)
        CVar.FindVar("cl_clock_correction_adjustment_max_amount"):SetInt(300)
    end
    if ping >= 60 then
        CVar.FindVar("sv_maxusrcmdprocessticks"):SetInt(14)
        Exploits.OverrideDoubleTapSpeed(14)
        CVar.FindVar("cl_clock_correction"):SetInt(1)
        CVar.FindVar("cl_clock_correction_adjustment_max_amount"):SetInt(200)
    end
end

function DoEdgeYaw(UserCmd)
    local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if me_ent == nil then return end
    local me = me_ent:GetPlayer()
    if menu.edgeyaw:Get() and ref_base:Get() ~= 5 and not can_enemy_hit_head() then

        if bit.band(UserCmd.buttons, bit.lshift(1,5)) ~= 0 or is_local_peeked() then
            return
        end
        local iLocalPlayerEntIndex = EngineClient:GetLocalPlayer()
        local pLocalPlayerEntity = EntityList.GetClientEntity(iLocalPlayerEntIndex)
        local pLocalPlayer = pLocalPlayerEntity:GetPlayer()
        local flVelocityZ = pLocalPlayer:GetProp('m_vecVelocity[2]') -- gets the player velocity
        local bInJump = bit.band(UserCmd.buttons, 2) == 2
        if flVelocityZ ~= 0 or bInJump then
            return
        end
        if ClientState.m_choked_commands == 0 then vecTraceStart = pLocalPlayer:GetEyePosition() end
        local aTraceEnd = {}
        local angViewAngles = EngineClient.GetViewAngles()
        for flYaw = 18, 360, 18 do
            flYaw = NormalizeYaw(flYaw)
            local angEdge = QAngle.new(0, flYaw, 0)
            local vecTraceEnd = vecTraceStart + Cheat.AngleToForward(angEdge) * 0x60
            local traceInfo = EngineTrace.TraceRay(vecTraceStart, vecTraceEnd, pLocalPlayerEntity, 0x200400B)
            local flFraction = traceInfo.fraction
            local pEntity = traceInfo.hit_entity
            if pEntity and pEntity:GetClassName() == 'CWorld' and flFraction < 0.3 then
                aTraceEnd[#aTraceEnd+1] = {
                    vecTraceEnd = traceInfo.endpos,
                    flYaw = flYaw
                }
            end
        end

        table.sort(aTraceEnd, function(a, b)
            return a.flYaw < b.flYaw
        end)

        local angEdge

        if #aTraceEnd >= 2 then
            local vecTraceCenter = VectorLerp(aTraceEnd[1].vecTraceEnd, aTraceEnd[#aTraceEnd].vecTraceEnd, 0.5)

            angEdge = Cheat.VectorToAngle(vecTraceStart - vecTraceCenter)
        end
        if angEdge then
            local flYaw = angViewAngles.yaw
            local flEdgeYaw = angEdge.yaw

            local flDiff = NormalizeYaw(flEdgeYaw - flYaw)

            if math.abs(flDiff) < 90 then
                flDiff = 0
                flYaw = NormalizeYaw(flEdgeYaw + 180)
            end

            -- Static yaw
            local flNewYaw = -flYaw

            -- Apply edge yaw
            flNewYaw = NormalizeYaw(flNewYaw + flEdgeYaw + 180)

            flNewYaw = NormalizeYaw(flNewYaw + flDiff)

            AntiAim.OverrideYawOffset(flNewYaw)
        end
    end
end

function AntiBackstab()
    local me_ent = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if me_ent == nil then return end
    local me = me_ent:GetPlayer()
    local data = get_target()
    if menu.anti_backstab:Get() then
        local origin = me_ent:GetProp("DT_BaseEntity", "m_vecOrigin")
        for i = 1, 64 do
            local entity = EntityList.GetClientEntity(i)
            if entity and entity:GetPlayer():GetProp("m_iHealth") > 0 and not entity:GetPlayer():IsTeamMate() then
                local active_weapon = entity:GetPlayer():GetActiveWeapon()
                if active_weapon == nil then return end
                local weapon_id = active_weapon:GetWeaponID()
                local distance = origin:DistTo(entity:GetProp("DT_BaseEntity", "m_vecOrigin"))
                if(distance <= 150 and weapon_id == 42) then
                    ref_yawadd:Set(round(data.yaw, 0))
                end
            end
        end
    end
end

function AimFire()
    aim_tick = GlobalVars.tickcount%1000
end

function RagebotLogs(bullet)
    if menu.ragebot_logs:Get() and menu.misc_enable:Get() then
        local entity = EntityList.GetClientEntity(bullet.target_index)
        local player = entity:GetPlayer()
        local is_safepoint
        local screensize = EngineClient.GetScreenSize()
        local x = screensize.x / 2
        local y = screensize.y / 2

        if Menu.FindVar("Aimbot", "Ragebot", "Misc", "Safe Points"):Get(2) then
            is_safepoint = "true"
        else
            is_safepoint = "false"
        end

        hitbox = hitgroups[bullet.hitgroup]

        if((bullet.hitgroup > -1 and bullet.hitgroup < 8) or bullet.hitgroup ~= 10) then
            hitbox = hitgroups[bullet.hitgroup]
        else
            hitbox = "unknown"
        end

        if hitbox == nil or not ((bullet.hitgroup > -1 and bullet.hitgroup < 8) or bullet.hitgroup ~= 10) then
            local reason = "unregistered shot"

            ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
            ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " ..
                            string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%%) due to " .. reason ..
                            ":inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            shotss = shotss + 1
            return
        end

        if(bullet.reason == 1) then
            
            local reason = "unknown"
            if menu.ragebot_logs_options:Get(2 or 3) then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " ..
                                string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%%) due to " .. reason ..
                                ":inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            end
            if menu.ragebot_logs_options:Get(1 or 3) then
                Cheat.AddEvent("[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " ..
                string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%) due to " .. reason ..
                ":inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14))
            end
            shotss = shotss + 1
        end
        if(bullet.reason == 2) then
            if menu.ragebot_logs_options:Get(2 or 3) then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%%) due to spread:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            end
            if menu.ragebot_logs_options:Get(1 or 3) then
                Cheat.AddEvent("[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%) due to spread:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14))     
            end
            shotss = shotss + 1
        end
        if(bullet.reason == 3) then
            if menu.ragebot_logs_options:Get(2 or 3) then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%%) due to spread:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            end
            if menu.ragebot_logs_options:Get(1 or 3) then
                Cheat.AddEvent("[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%) due to spread:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14))
            end
            shotss = shotss + 1
        end
        if(bullet.reason == 4) then
            if menu.ragebot_logs_options:Get(2 or 3) then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%%) due to prediction error:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            end
            if menu.ragebot_logs_options:Get(1 or 3) then
                Cheat.AddEvent("[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Missed " .. string.lower(player:GetName()) .. "'s " .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.wanted_damage .. ")" .. "(".. tostring(bullet.hitchance) .. "%) due to prediction error:inaccuracy " .. round(bullet.spread_degree, 2) .. "°, sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14))
            end
            shotss = shotss + 1
        end
        if bullet.reason == 0 then
            local enemy = EntityList.GetClientEntity(bullet.target_index):GetPlayer()
            local enemy_hp = enemy:GetProp("m_iHealth")
            local remaining_hp = enemy_hp - bullet.damage
            if remaining_hp < 0 then
                remaining_hp = 0
            else
                remaining_hp = enemy_hp - bullet.damage
            end
            if menu.ragebot_logs_options:Get(2 or 3) then
                ffi_handler.color_print(Color.new(180 / 255, 228 / 255, 20 / 255, 255 / 255), "[icetools] ")
                ffi_handler.color_print(Color.new(217/255,217/255,217/255,255/255), "[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Hit " .. string.lower(player:GetName()) .. "'s " .. hitbox .. " for " .. bullet.damage .. "(" .. bullet.wanted_damage .. ")" .. " (" .. remaining_hp .. " remaining) aimed=" .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.hitchance .. "%%)" .. " sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14) .. "\n")
            end
            if menu.ragebot_logs_options:Get(1 or 3) then
                Cheat.AddEvent("[" .. shotss .. "] [" .. aim_tick .. "/" .. GlobalVars.tickcount%1000 .. "] Hit " .. string.lower(player:GetName()) .. "'s " .. hitbox .. " for " .. bullet.damage .. "(" .. bullet.wanted_damage .. ")" .. " (" .. remaining_hp .. " remaining) aimed=" .. hitgroups[bullet.wanted_hitgroup] .. "(" .. bullet.hitchance .. "%)" .. " sp=" .. is_safepoint .. " (B) LC=" .. Utils.RandomInt(0,14) .. " TC=" .. Utils.RandomInt(0,14))
            end
            shotss = shotss + 1
        end
    end
end

function LegMovementFC()
    if menu.misc_enable:Get() and menu.legmovement:Get() then
        if menu.legmovement_options:Get() == 0 then
            local legs_int = Utils.RandomInt(1, 3)
            if legs_int == 1 then
                ref_legmovement:Set(0)
            elseif legs_int == 2 then
                ref_legmovement:Set(1)
            elseif legs_int == 3 then
                ref_legmovement:Set(0)
            end
        elseif menu.legmovement_options:Get() == 1 then
            ref_legmovement:Set(1)
        end
    end
end

function NetUpdateEnd(stage)
    if menu.misc_enable:Get() and menu.legmovement:Get() then
        local me = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
        if stage == 4 then
            me:SetProp("m_flPoseParameter", 1, 0)
        end
    end
end

function MenuBlur()
    local screensize = EngineClient.GetScreenSize()
    local color = menu.menu_blur:GetColor()
    if menu.misc_enable:Get() and menu.menu_blur:Get() then
        if Cheat.IsMenuVisible() then
            if menu.blur_combo:Get() == 1 then
                Render.Blur(Vector2.new(0,0), Vector2.new(screensize.x, screensize.y), Color.new(color.r, color.g, color.b, math.sin(math.abs(-3.14 + (GlobalVars.curtime * (1 / .75)) % (3.14 * 2))) * 1))
            else
                Render.Blur(Vector2.new(0,0), Vector2.new(screensize.x, screensize.y), menu.menu_blur:GetColor())
            end
        end
    end
end

function DormantFunction(UserCmd)
    local players = EntityList.GetEntitiesByName("CCSPlayer")
    local localPlayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer());
    local me = localPlayer:GetPlayer()
    local weap = me:GetActiveWeapon()
    if weap ~= nil then
        local weapon_id = weap:GetWeaponID()
    end

    if menu.dormant_enable:Get() and menu.rage_enable:Get() and get_dormant_enemy() then
        local dormant_target = players[get_dormant_enemy()]:GetPlayer()
        local weap_delay = (weapon_id == 9 or weapon_id == 40) and 0.15 or 0.0
        if dormant_target and weap_delay and weap:GetProp("m_flNextPrimaryAttack") and GlobalVars.curtime and weap:GetProp("m_flNextPrimaryAttack") + weap_delay <= GlobalVars.curtime and me:GetProp("m_bIsScoped") and not is_inair(me) then
            local bounds = dormant_target:GetRenderBounds(min, max)
            local pos = dormant_target:GetProp("m_vecOrigin") + Vector.new((min.x + max.x)/4, (min.y + max.y)/16, (min.z + max.z/2))
            if Cheat.FireBullet(me, me:GetEyePosition(), pos).damage >= menu.dormant_damage:Get() then
                autostop(UserCmd)

                if 1 / weap:GetInaccuracy(weap) >= 100 then
                    local getaimpunch = me:GetProp("DT_BasePlayer", "m_aimPunchAngle")
                    local aimpunch = QAngle.new(getaimpunch.x, getaimpunch.y, 0.0)
                    local aim_angle = calc_angle(me:GetEyePosition(), pos)
                    UserCmd.viewangles.pitch = aim_angle.pitch - aimpunch.pitch * 2
                    UserCmd.viewangles.yaw = aim_angle.yaw - aimpunch.yaw * 2
                    UserCmd.buttons = bit.bor(UserCmd.buttons, 1)
                end
            end
        end
    end
end

function CustomScope()
    sc = EngineClient.GetScreenSize()
    player = EntityList.GetLocalPlayer()
    scoped = player:GetProp("m_bIsScoped")
    gui = CVar.FindVar("r_drawvgui")
    if menu.custom_scope:Get() and menu.visuals_enable:Get() then
        if scoped then
            offset = menu.scope_origin:Get()
            leng = toleng;
            sc = EngineClient.GetScreenSize()
            -- x = sc.x / 2;
            player = EntityList.GetLocalPlayer()
            y = sc.y/2+15+offset+leng
            if toleng < (menu.scope_origin:Get() / 2 + menu.scope_width:Get()) then toleng = toleng + 2 else toleng = (menu.scope_origin:Get() / 2 + menu.scope_width:Get()) end
            gui:SetInt(0);
            Render.GradientBoxFilled(Vector2.new(sc.x / 2 - 0.1, sc.y / 2 - math.min(menu.scope_origin:Get(), toleng)), Vector2.new(sc.x / 2 + 1, sc.y / 2 - math.min(menu.scope_origin:Get(), toleng) - math.min(menu.scope_width:Get(), toleng)), menu.custom_scope:GetColor(), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0))
            Render.GradientBoxFilled(Vector2.new(sc.x / 2 - math.min(menu.scope_origin:Get(), toleng), sc.y / 2 - 0.1), Vector2.new(sc.x / 2 - math.min(menu.scope_origin:Get(), toleng) - math.min(menu.scope_width:Get(), toleng), sc.y / 2  + 1), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0))
            Render.GradientBoxFilled(Vector2.new(sc.x / 2 - 0.1, sc.y / 2 + math.min(menu.scope_origin:Get(), toleng)), Vector2.new(sc.x / 2 + 1, sc.y / 2  + math.min(menu.scope_origin:Get(), toleng) + math.min(menu.scope_width:Get(), toleng)), menu.custom_scope:GetColor(), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0))
            Render.GradientBoxFilled(Vector2.new(sc.x / 2 + math.min(menu.scope_origin:Get(), toleng), sc.y / 2 - 0.1), Vector2.new(sc.x / 2  + math.min(menu.scope_origin:Get(), toleng) + math.min(menu.scope_width:Get(), toleng), sc.y / 2  + 1), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0), menu.custom_scope:GetColor(), Color.new(menu.custom_scope:GetColor().r, menu.custom_scope:GetColor().g, menu.custom_scope:GetColor().b,  0))
        else
            if toleng > 0 then toleng = toleng - 2 else toleng = 0 end
            gui:SetInt(1)
            y = sc.y/2+15+leng
        end
    else
        y = sc.y/2+15
    end
end

function ClantagChanger()
    if menu.clantag_changer:Get() and menu.misc_enable:Get() then
        local curtime = math.floor(GlobalVars.curtime * 3)
        if old_time ~= curtime then
            set_clantag(animation[curtime % #animation+1], animation[curtime % #animation+1])
        end
        old_time = curtime
    end
    local set_clantag = ffi.cast("clantag_t", fn_change_clantag)
    if not menu.clantag_changer:Get() or not menu.misc_enable:Get() then
        local curtime = math.floor(GlobalVars.curtime * 3)
        if old_time ~= curtime then
            set_clantag(animation2[curtime % #animation2+1], animation2[curtime % #animation2+1])
        end
        old_time = curtime
    end
end

--> Callback(s)
function onPrediction(UserCmd)
    AntiAim_sys()
    AntiBackstab()
    DoEdgeYaw(UserCmd)
    DormantFunction(UserCmd)
end

function onPrePrediction()
    RunShit()
end

function onDraw()
    MenuVisibility()
    drawConsole()
    TPAnimation()
    MenuBlur()
    ClantagChanger()
    if GlobalVars.curtime - brute.last_miss > menu.reset_info_value:Get() and can_reset == true then
        brute.shootermisses = 0
        brute.misses = 0
        can_reset = false
    end
    local me = EntityList.GetLocalPlayer()
    if me == nil then return end
    local health = me:GetProp("m_iHealth")
    if health > 0 then
        HcOverride()
        DTImprovement()
        MinimumDamageInd()
        IndicatorsFunc()
        isLastEnemy()
        DisableAA()
        LegMovementFC()
        CustomScope()
    end
end

function onEvents(e)
    BruteImpact(e)
    ResetBruteInfo(e)
    Killsay(e)
end

function onCMove()
    can_swap = false
    local me = EntityList.GetLocalPlayer()
    if me == nil then return end
    local health = me:GetProp("m_iHealth")
    if health > 0 then
        --
    end
end

Cheat.RegisterCallback("ragebot_shot", AimFire)
Cheat.RegisterCallback("createmove", onCMove)
Cheat.RegisterCallback("events", onEvents)
Cheat.RegisterCallback("frame_stage", NetUpdateEnd)
Cheat.RegisterCallback("registered_shot", RagebotLogs)
Cheat.RegisterCallback("draw", onDraw)
Cheat.RegisterCallback("pre_prediction", onPrePrediction)
Cheat.RegisterCallback("prediction", onPrediction)
Cheat.RegisterCallback("console", CustomCommands)
 
Сверху Снизу