Crack Lua [NL] melancholia.ws [ultimate] | leak | open source

Новичок
Новичок
Статус
Оффлайн
Регистрация
27 Июл 2022
Сообщения
1
Реакции
2
credits: @tiriyaki
Код:
Expand Collapse Copy
---@diagnostic disable: undefined-global
local ffi = require 'ffi'

ffi.cdef[[
    typedef struct {
        uint8_t r;
        uint8_t g;
        uint8_t b;
        uint8_t a;
    } color_struct_t;

    typedef void (__cdecl* console_color_print)(void*,const color_struct_t&, const char*, ...);

    int VirtualProtect(void* lpAddress, unsigned long dwSize, unsigned long flNewProtect, unsigned long* lpflOldProtect);
    void* VirtualAlloc(void* lpAddress, unsigned long dwSize, unsigned long  flAllocationType, unsigned long flProtect);
    int VirtualFree(void* lpAddress, unsigned long dwSize, unsigned long dwFreeType);

    bool CreateDirectoryA(const char* lpPathName, void* lpSecurityAttributes);
    bool DeleteUrlCacheEntryA(const char* lpszUrlName);
    void* __stdcall URLDownloadToFileA(void* LPUNKNOWN, const char* LPCSTR, const char* LPCSTR2, int a, int LPBINDSTATUSCALLBACK);

    typedef int(__thiscall* get_clipboard_text_length)(void*);
    typedef void(__thiscall* set_clipboard_text)(void*, const char*, int);
    typedef void(__thiscall* get_clipboard_text)(void*, int, const char*, int);

    int CreateDirectoryA(const char*, void*);
    void* CreateFileA(const char*, uintptr_t, uintptr_t, void*, uintptr_t, uintptr_t, void*);
    uintptr_t GetFileSize(void*, uintptr_t*);
    int ReadFile(void*, void*, uintptr_t, uintptr_t*, void*);
    int CloseHandle(void*);
]]

local ui = {}
local helpers = {}
local ragebot = {}
local antiaim = {}
local anti_bruteforce = {}
local anitaim_condition = {}
local visuals = {indicators = {}}
local animations = {anim_list = {}}
local ffi_handler = {}
local miscellaneous = {stuff = {}}
local touch_callback = {}
local file_downloader = {}
local cfg_system = {}

ffi_handler.interface_type = ffi.typeof('uintptr_t**')
ffi_handler.cvar_interface = ffi.cast(ffi_handler.interface_type, Utils.CreateInterface('vstdlib.dll', 'VEngineCvar007'))
ffi_handler.print = ffi.cast('console_color_print', ffi_handler.cvar_interface[0][25])

ffi_handler.find_element = ffi.cast("unsigned long(__thiscall*)(void*, const char*)", Utils.PatternScan("client.dll", "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28"))
ffi_handler.c_hud_chat = ffi_handler.find_element(ffi.cast("unsigned long**", ffi.cast("uintptr_t", Utils.PatternScan("client.dll", "B9 ? ? ? ? E8 ? ? ? ? 8B 5D 08")) + 1)[0], "CHudChat")
ffi_handler.chat_print = ffi.cast("void(__cdecl*)(int, int, int, const char*, ...)", ffi.cast("void***", ffi_handler.c_hud_chat)[0][27])

ffi_handler.VGUI_System = ffi.cast(ffi.typeof('void***'), Utils.CreateInterface('vgui2.dll', 'VGUI_System010'))
ffi_handler.get_clipboard_text_length = ffi.cast('get_clipboard_text_length', ffi_handler.VGUI_System[0][7])
ffi_handler.get_clipboard_text = ffi.cast('get_clipboard_text', ffi_handler.VGUI_System[0][11])
ffi_handler.set_clipboard_text = ffi.cast('set_clipboard_text', ffi_handler.VGUI_System[0][9])

ffi_handler.print_chat = function(text)
    ffi_handler.chat_print(ffi_handler.c_hud_chat, 0, 0, string.format("%s ", text))
end

ffi_handler.color_print = function(color, text)
    if color == nil then return end
    if text == nil then return end
    local col = ffi.new('color_struct_t')
    if col == nil then return end
    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

cfg_system.get_clipboard = function()
    local clipboard_text_length = ffi_handler.get_clipboard_text_length(ffi_handler.VGUI_System)

    if (clipboard_text_length > 0) then
        local buffer = ffi.new('char[?]', clipboard_text_length)

        ffi_handler.get_clipboard_text(ffi_handler.VGUI_System, 0, buffer, clipboard_text_length * ffi.sizeof('char[?]', clipboard_text_length))
        return ffi.string(buffer, clipboard_text_length - 1)
    end

    return ''
end

cfg_system.set_clipboard = function(text)
    ffi_handler.set_clipboard_text(ffi_handler.VGUI_System, text, #text)
end
EngineClient.ExecuteClientCmd('clear')


file_downloader.urlmon = ffi.load('UrlMon')
file_downloader.wininet = ffi.load('WinInet')
file_downloader.download_file_from_url = function(from, to)
    file_downloader.wininet.DeleteUrlCacheEntryA(from)
    file_downloader.urlmon.URLDownloadToFileA(nil, from, to, 0,0)
end

file_downloader.ct = ffi.typeof('char[?]')
file_downloader.c_invalid_handle_value = ffi.cast('void*', -1)

package.loaded.readfile = function(filename)
    local fp = ffi.C.CreateFileA(filename, 0x80000000, 3, nil, 3, 128, nil)
    if file_downloader.c_invalid_handle_value ~= fp then
        local size = ffi.C.GetFileSize(fp, nil)
        local buf = file_downloader.ct(size + 1)
        ffi.C.ReadFile(fp, buf, size, nil, nil)
        ffi.C.CloseHandle(fp)
        return ffi.string(buf, size)
    end
end

file_downloader.game_path_str = EngineClient.GetGameDirectory()
file_downloader.game_path = string.gsub(file_downloader.game_path_str, '\\csgo', '\\')
local files_to_download = {
    'nl\\melancholia\\small_pixel.ttf', 'nl\\melancholia\\1.png', 'nl\\melancholia\\2.png', 'nl\\melancholia\\3.png', 'nl\\melancholia\\4.png', 'nl\\melancholia\\5.png', 'nl\\melancholia\\6.png', 'nl\\melancholia\\7.png', 'nl\\melancholia\\8.png', 'nl\\melancholia\\9.png', 'nl\\melancholia\\velocity_warning.png'
}
local image = {}
for i = 1, #files_to_download do
    if package.loaded.readfile(files_to_download[i]) then
        for i=1, 9 do
            image[i] = Render.LoadImageFromFile(('nl\\melancholia\\%s.png'):format(i), Vector2.new(25, 25))
        end
    else
        ffi.C.CreateDirectoryA('nl\\melancholia\\', NULL)
       
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/947429839101624320/952177172557234227/small_pixel.ttf', 'nl\\melancholia\\small_pixel.ttf')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/988498559575941130/velocity_warning.png', 'nl\\melancholia\\velocity_warning.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535076482158612/1.png', 'nl\\melancholia\\1.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535089039925308/2.png', 'nl\\melancholia\\2.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535107276759070/3.png', 'nl\\melancholia\\3.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535116068012032/4.png', 'nl\\melancholia\\4.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535127631712266/5.png', 'nl\\melancholia\\5.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535142051708958/6.png', 'nl\\melancholia\\6.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535152923357194/7.png', 'nl\\melancholia\\7.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/990682553419714631/8.png', 'nl\\melancholia\\8.png')
        file_downloader.download_file_from_url('https://cdn.discordapp.com/attachments/967383362241167420/989535189493485568/9.png', 'nl\\melancholia\\9.png')
       
        table.insert(miscellaneous.stuff, {text2 = {
            name = '',
            hit = '',
            who = Cheat.GetCheatUserName(),
            in_the = ', reload script!',
            where = '',
            for_ = '',
            how_much = '',
            damage = '',
            how_muc_r = '',
            health = ''
        }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
    end
end

miscellaneous.phrases  = {        
    "???? ??? *FLOW HVH* sent to hell by » ??????",
    '???? ?? ?? ????? ??? ??? ??? ?? ????? ',
    '`???????????.?? ?????? ?? ??? ???',
    '?? ????? ???????? ???? ??????? ???????????.???? ',
    '☆꧁✬◦°˚°◦. ɛʐ ʄօʀ ʍɛʟǟռƈɦօʟɨǟ .◦°˚°◦✬꧂☆',
    '?????? ?????????? ?????????',
    '? ???? ?????? ??? ???? ???? ?????? ??. ???????????.',
    'ⓜⓔⓛⓐⓝⓒⓗⓞⓛⓘⓐ ???最好的lua dominates hvh scene ',
    'did you want to kill me? ᵍᵉᵗ `ᵐᵉˡᵃⁿᶜʰᵒˡⁱᵃ.ʷˢ',
    '▄︻デ`ᵯēłⱥꞥȼħꝋłīⱥ.ⱳꞩ > ƀēꞩⱦ łᵾⱥ ӻꝋɍ ꞥēꝟēɍłꝋꞩē══━一',
    '?? ??? ???? ?? ?? ???? ??? ??? `???????????.?? ',
    '???? ??? ???? ???, ???? ????? ?? ??????????? ',
    'աh͙ҽr͙ҽ a͙ɾe͙ վo͙մ g͙օi͙ղg͙ ҍa͙ʂt͙ąr͙ժ',
    '??????????? - ??? ???? ????? ?????? ' ,
    '▄︻デ₲Ꝋ ꞨŁɆɆꝐ ⱲɆȺҞ ĐꝊ₲ ══━一',
    '☆꧁✬◦°˚°◦. ɮʏ ɮɛֆȶ ʟʊǟ .◦°˚°◦✬꧂☆',
}

-- @region: refs
local refs = {
    double_tap = Menu.FindVar('Aimbot', 'Ragebot', 'Exploits', 'Double Tap'),
    hide_shots = Menu.FindVar('Aimbot', 'Ragebot', 'Exploits', 'Hide Shots'),
    auto_peek = Menu.FindVar('Miscellaneous', 'Main', 'Movement', 'Auto Peek'),
    slow_walk = Menu.FindVar('Aimbot', 'Anti Aim', 'Misc', 'Slow Walk'),
    safe_points = Menu.FindVar('Aimbot', 'Ragebot', 'Misc', 'Safe Points'),
    body_aim = Menu.FindVar('Aimbot', 'Ragebot', 'Misc', 'Body Aim'),
    minimum_damage = Menu.FindVar('Aimbot', 'Ragebot', 'Accuracy', 'Minimum Damage'),
    fl_enable = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Enable Fake Lag'),
    fl_limit = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Limit'),
    fl_random = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Lag', 'Randomization'),

    remove_scope = Menu.FindVar('Visuals', 'View', 'Camera', 'Remove Scope'),

    pitch = Menu.FindVar('Aimbot', 'Anti Aim', 'Main', 'Pitch'),
    yaw = Menu.FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Base'),
    yaw_add = Menu.FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Add'),
    jitter = Menu.FindVar('Aimbot', 'Anti Aim', 'Main', 'Yaw Modifier'),
    jitter_value = Menu.FindVar('Aimbot', 'Anti Aim', 'Main', 'Modifier Degree'),
    left_desync_value = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Left Limit'),
    right_desync_value = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Right Limit'),
    fake_option = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Fake Options'),
    lby_mode = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'LBY Mode'),
    freestand_desync = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Freestanding Desync'),
    desync_on_shot = Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Desync On Shot'),

    leg_movement = Menu.FindVar('Aimbot', 'Anti Aim', 'Misc', 'Leg Movement'),
    slowwalk = Menu.FindVar('Aimbot', 'Anti Aim', 'Misc', 'Slow Walk'),
    fakeduck = Menu.FindVar('Aimbot', 'Anti Aim', 'Misc', 'Fake Duck')
}
-- @endregion

local screen_size = EngineClient.GetScreenSize()

-- @region: fonts
local fonts = {
    pixel9 = Render.InitFont('nl\\melancholia\\small_pixel.ttf', 9) or error and Render.InitFont('Smallest Pixel-7', 9),
    verdana25 = Render.InitFont('verdana', 25),
    verdana12 = Render.InitFont('verdana', 12),
    verdana9 = Render.InitFont('verdana', 9),
    tahomab13 = Render.InitFont('tahoma', 12, {'b'}),
    tahobab12 = Render.InitFont('tahoma', 12, {'b'}),
    calibrib24 = Render.InitFont('calibri', 24, {'b'}),
    verdanab18 = Render.InitFont('verdana', 18, {'b'}),
    verdanab11 = Render.InitFont('verdana', 11, {'b'}),
    verdanab10 = Render.InitFont('verdana', 10, {'b'}),
    verdanar11 = Render.InitFont('verdana', 11, {'r'}),
    verdanar12 = Render.InitFont('verdana', 12, {'r'}),
    verdanar12bi = Render.InitFont("verdana", 10, {"b", "i"}),
    verdanar12i = Render.InitFont("verdana", 12, {"i"}),
    lucida_consoler10 = Render.InitFont('lucida console', 10, {'r'})
}
-- @endregion

-- @region: helpers
helpers.cheat = { callbacks = {}, RegisterCallback = function(self, callback, funct)  isExists = false for i = 1, #self.callbacks do if self.callbacks[i].callback == callback then isExists = true break end end if not isExists then table.insert(self.callbacks, {callback = callback, functions = {}}) isExists = true end for i = 1, #self.callbacks do if self.callbacks[i].callback == callback then table.insert(self.callbacks[i].functions, funct) break end end self:Update() end, Update = function(self) for i = 1, #self.callbacks do  function run(...) for j = 1, #self.callbacks[i].functions do self.callbacks[i].functions[j](...) end end Cheat.RegisterCallback(self.callbacks[i].callback, run) end end }
function C_BasePlayer:GetVelocity() first_velocity = self:GetProp('m_vecVelocity[0]') second_velocity = self:GetProp('m_vecVelocity[1]') speed = math.floor(math.sqrt(first_velocity * first_velocity + second_velocity * second_velocity)) return speed end
function C_BasePlayer:GetState() flags = self:GetProp('m_fFlags') velocity = self:GetVelocity() if bit.band(flags, 1) == 1 then if refs.fakeduck:Get() then return 'Fakeducking' else if bit.band(flags, 4) == 4 then return 'Crouching' else if refs.slow_walk:Get() then return 'Slowwalking' else if velocity <= 3 then return 'Standing' else return 'Moving' end end end end elseif bit.band(flags, 1) == 0 and self:GetProp('m_flDuckAmount') < 0.7 then return 'Air' elseif bit.band(flags, 1) == 0 and self:GetProp('m_flDuckAmount') >= 0.7 then return 'Air+Duck' end end
function C_BasePlayer:GetFlag(shift) return bit.band(self:GetProp('m_fFlags'), bit.lshift(1, shift)) ~= 0 end
function C_BasePlayer:GetBodyYaw() if self == nil then return end return math.abs(math.max(-58, math.min(58, math.floor((self:GetProp('m_flPoseParameter')[12] or 0) * 120 - 60 + .5, 1)))) end
helpers.lerp = function(time,a,b) return a * (1-time) + b * time end
helpers.dragging_fn = function(name, base_x, base_y) return (function() local a = {} local b, c, d, e, f, g, h, i, j, k, l, m, n, o local p = {__index = {drag = function(self, ...)  q, r = self:get()  s, t = a.drag(q, r, ...) if q ~= s or r ~= t then     self:set(s, t) end return s, t end, set = function(self, q, r)  j, k = EngineClient.GetScreenSize().x, EngineClient.GetScreenSize().y self.x_reference:Set(math.floor(q / j * self.res)) self.y_reference:Set(math.floor(r / k * self.res)) end, get = function(self)  j, k = EngineClient.GetScreenSize().x, EngineClient.GetScreenSize().y return self.x_reference:Get() / self.res * j, self.y_reference:Get() / self.res * k end}} function a.new(u, v, w, x) x = x or 10000  j, k = EngineClient.GetScreenSize().x, EngineClient.GetScreenSize().y  y = Menu.SliderInt('Visuals', 'Visuals', u .. ' window position x', math.floor(v / j * x), 0, math.floor(x))  z = Menu.SliderInt('Visuals', 'Visuals', u .. ' window position y', math.floor(w / k * x), 0, math.floor(x)) y:SetVisible(false) z:SetVisible(false) return setmetatable({name = u, x_reference = y, y_reference = z, res = x}, p) end      function a.drag(q, r, A, B, C, D, E) if GlobalVars.framecount ~= b then c = Cheat.IsMenuVisible() f, g = d, e d, e = Cheat.GetMousePos().x, Cheat.GetMousePos().y i = h h = Cheat.IsKeyDown(1) m = l l = {} o = n n = false j, k = EngineClient.GetScreenSize().x, EngineClient.GetScreenSize().y end if c and i ~= nil then if (not i or o) and h and f > q and g > r and f < q + A and g < r + B then n = true q, r = q + d - f, r + e - g if not D then q = math.max(0, math.min(j - A, q)) r = math.max(0, math.min(k - B, r)) end end end table.insert(l, {q, r, A, B}) return q, r, A, B end return a end)().new(name, base_x, base_y) end
-- @endregion

-- @region: ui
ui.dormant_aimbot = Menu.Switch('Rage-Bot', 'Rage-Bot', 'Dormant Aimbot', false, 'Shoots at the enemy when he is dormant esp')
ui.adaptive_damage = Menu.Combo('Rage-Bot', 'Rage-Bot', 'Adaptive Damage', {'Adaptive Damage', 'Custom'}, 0)
ui.dormant_aimbot_damage = Menu.SliderInt('Rage-Bot', 'Rage-Bot', 'Minimum Damage', 5, 1, 100)
ui.ideal_tick = Menu.Switch('Rage-Bot', 'Rage-Bot', 'Ideal Tick', false, 'Reduces the chance of backshooting when auto-peeking')
ui.prev_os = Menu.Switch('Rage-Bot', 'Rage-Bot', 'Prevent OS', false, 'Reduces the chance of backshooting')
ui.prediction_error_fix = Menu.Switch('Rage-Bot', 'Rage-Bot', 'Prediction Error Fix', false, 'Reduces the number of misses by prediction error, but can crash on unload lua')

ui.presets = Menu.Combo('Anti-Hit', 'Anti-Hit', 'Preset ', {'Disabled', 'Adaptive Center', 'Offset Jitter', 'Custom'}, 0)
ui.type = Menu.Combo('Anti-Hit', 'Builder', 'Currect State', {'Global', 'Standing', 'Crouching', 'Slowwalk', 'Running', 'Air', 'Crouch-Air'}, 0)
ui.manual_yaw_base = Menu.Combo('Anti-Hit', 'Anti-Hit', 'Manual Yaw Base', {'Disabled', 'Forward', 'Backward', 'Right', 'Left', 'At Target', 'Freestanding'}, 5)
ui.auto_awp_sw = Menu.Switch('Anti-Hit', 'Anti-Hit', 'Adaptive AWP/AUTO AA on SW', false)
ui.override_1 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Standing', false)
ui.override_2 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Crouching', false)
ui.override_3 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Slowwalk', false)
ui.override_4 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Running', false)
ui.override_5 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Air', false)
ui.override_6 = Menu.Switch('Anti-Hit', 'Builder', 'Enable Crouch-Air', false)
ui.anti_hit_helpers = Menu.MultiCombo('Anti-Hit', 'Anti-Hit', 'Anti-Hit Helpers', {'Legit AA on E', 'Anti-Knife', 'Disable FL on HS', 'Bombsite E Fix', 'Shit AA on Warmup', 'Better Onshot'}, 0)
antiaim.condition_list = {
    '[G] ', '[S] ', '[C] ', '[SW] ', '[R] ', '[A] ', '[C-A] ',
}
for i = 1, #antiaim.condition_list do
    table.insert(anitaim_condition, {
        yaw_mode = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Yaw Mode', {'Jitter', 'Perfect'}, 0),
        yaw_add_l = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Yaw Add L', 0, -180, 180),
        yaw_add_r = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Yaw Add R', 0, -180, 180),
        switch_ticks = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Switch Ticks', 4, 4, 20),
        jitter = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Yaw Modifier', {'Disabled', 'Center', 'Offset', 'Random', 'Spin'}, 0),
        modifier_mode = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Modifier Mode', {'Static', 'Random', 'Desync'}, 0),
        jitter_value = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Modifier Deg', 0, -180, 180),
        jitter_value1 = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Modifier Deg #2', 0, -180, 180),
        fake_type = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Fake Type', {'Desync', 'Random'}, 0),
        left_desync_value = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Left Limit', 0, 0, 60),
        right_desync_value = Menu.SliderInt('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Right Limit', 0, 0, 60),
        fake_option = Menu.MultiCombo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Fake Options', {'Avoid Overlap', 'Jitter', 'Randomize Jitter'}, 0),
        lby_mode = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'LBY Mode', {'Disabled', 'Opposite', 'Sway'}, 0),
        freestand_desync = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Freestand Fake', {'Off', 'Peek Fake', 'Peek Real'}, 0),
        desync_on_shot = Menu.Combo('Anti-Hit', 'Builder', antiaim.condition_list[i]..'Fake On Shot', {'Disabled', 'Opposite', 'Freestanding', 'Switch'}, 0),
    })
end

ui.anti_brute = Menu.Switch('Anti-Brute', 'Anti-Brute', 'Enable', false)
ui.anti_brute_add = Menu.Button('Anti-Brute', 'Anti-Brute', 'Add', '')
ui.anti_brute_remove = Menu.Button('Anti-Brute', 'Anti-Brute', 'Remove', '')
ui.anti_brute_switch = Menu.Switch('Anti-Brute', 'Anti-Brute', 'Switch Side', false)
ui.anti_brute_resetter = Menu.Switch('Anti-Brute', 'Anti-Brute', 'Resetting the Anti-Brute Data at the Start of a Round', false)
ui.anti_brute_phase1 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 1] Fake Limit', 0, -58, 58)
ui.anti_brute_phase2 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 2] Fake Limit', 0, -58, 58)
ui.anti_brute_phase3 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 3] Fake Limit', 0, -58, 58)
ui.anti_brute_phase4 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 4] Fake Limit', 0, -58, 58)
ui.anti_brute_phase5 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 5] Fake Limit', 0, -58, 58)
ui.anti_brute_phase6 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 6] Fake Limit', 0, -58, 58)
ui.anti_brute_phase7 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 7] Fake Limit', 0, -58, 58)
ui.anti_brute_phase8 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 8] Fake Limit', 0, -58, 58)
ui.anti_brute_phase9 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 9] Fake Limit', 0, -58, 58)
ui.anti_brute_phase10 = Menu.SliderInt('Anti-Brute', 'Anti-Brute', '[Phase 10] Fake Limit', 0, -58, 58)
ui.phases = Menu.SliderInt('Anti-Brute', 'Anti-Brute', 'Phases number', 7, 2, 10)

ui.ideal_anim_breaker = Menu.MultiCombo('Anti-Hit', 'Anti-Hit', 'Ideal Anim Breaker', {'IdealAirLegs', 'IdealLegFucker', 'ForcePitch 0'}, 0)

ui.visuals = Menu.MultiCombo('Visuals', 'Visuals', 'Visuals', {'Watermark', 'Keybinds', 'MH Indicators', 'Extraneous indicators', 'Hands in Zoom', 'Custom Zoom', 'Custom Autopeek', 'Ideal tick visualize', 'Velocity Modifier', 'Hit Marker', 'Damage Marker', 'Spectator List', 'Damage Indicator'}, 0)
ui.watermark_color = Menu.ColorEdit('Visuals', 'Colors', 'Watermark Color', Color.RGBA(117, 117, 255, 255))
ui.watermark_info_color = Menu.ColorEdit('Visuals', 'Colors', 'Watermark Info Color', Color.RGBA(117, 117, 255, 255))
ui.custom_name = Menu.Combo('Visuals', 'Visuals', 'Watermark Username', {'Neverlose', 'Steam', 'Custom'}, 0)
ui.name_input = Menu.TextBox('Visuals', 'Visuals', 'Custom Username', 64, Cheat.GetCheatUserName())
ui.keybinds_color = Menu.ColorEdit('Visuals', 'Colors', 'Keybinds Color', Color.RGBA(117, 117, 255, 255))
ui.accent_color = Menu.ColorEdit('Visuals', 'Colors', 'Accent Color', Color.RGBA(117, 117, 255, 255))
ui.indicator_style = Menu.Combo('Visuals', 'Visuals', 'Indicators Style', {'Default', 'Modern'}, 0)
ui.anim_scope = Menu.Switch('Visuals', 'Visuals', 'Disable Zoom anim', false)
ui.scope_color = Menu.ColorEdit('Visuals', 'Colors', 'Zoom Color', Color.RGBA(255, 255, 255, 255))
ui.scope_color1 = Menu.ColorEdit('Visuals', 'Colors', 'Zoom Color 1', Color.RGBA(255, 255, 255, 0))
ui.scope_size = Menu.SliderInt('Visuals', 'Visuals', 'Custom Zoom Size', 50, 20, screen_size.y/2)
ui.scope_gap = Menu.SliderInt('Visuals', 'Visuals', 'Custom Zoom Gap', 10, 0, screen_size.y/2)
ui.auto_peek = Menu.ColorEdit('Visuals', 'Colors', 'Autopeek Color', Color.RGBA(255, 255, 255, 200))
ui.hitmarker_color = Menu.ColorEdit('Visuals', 'Colors', 'Hitmarker Color', Color.new(1, 1, 1, 1))
ui.dmg_marker_color = Menu.ColorEdit('Visuals', 'Colors', 'Damage Marker Kill Color', Color.RGBA(117, 117, 255, 255))
ui.dmg_ind_style = Menu.Combo('Visuals', 'Visuals', 'Damage Indicator', {'Default', 'Kibit'}, 0)
ui.dmg_ind_color = Menu.ColorEdit('Visuals', 'Colors', 'Damage Indicator Color', Color.new(1, 1, 1, 1))

ui.quickpeek = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Quick Peek', false, 'Returns at peak')
ui.hitlog = Menu.MultiCombo('Miscellaneous', 'Miscellaneous', 'Hit-Logs', {'Under Cross', 'Console'}, 0)
ui.trash_talk = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Trashtalk', false, 'Trashtalk')
ui.enemy_chat_viewer = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Enemy Chat Viewer', false)
ui.mute_enemy = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Mute Enemy', false)
ui.clan_tag = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Clantag Spammer', false, 'Clan tag animation in the tab')
ui.hitsound_custom = Menu.Switch('Miscellaneous', 'Miscellaneous', 'Skeet Hitsound', false, 'The sound when hitting')

ui.default_cfg = Menu.Button('Miscellaneous', 'Settings', 'Load Default Config', '')
ui.export_cfg = Menu.Button('Miscellaneous', 'Settings', 'Export Config', '')
ui.import_cfg = Menu.Button('Miscellaneous', 'Settings', 'Import Config', '')
-- @endregion

anti_bruteforce.work = false
anti_bruteforce.work_value = 0.0
anti_bruteforce.work_memory = {}
anti_bruteforce.memory = {}

for i = 0, 64 do
    table.insert(anti_bruteforce.memory, i, {count = 0})
end

anti_bruteforce.add = function() if ui.phases:Get() < 10 then ui.phases:Set(ui.phases:Get() + 1) end end
anti_bruteforce.remove = function() if ui.phases:Get() > 2 then ui.phases:Set(ui.phases:Get() - 1) end end

-- @region: menu visibles
touch_callback.callback1 = function()
    ui.dormant_aimbot_damage:SetVisible(ui.dormant_aimbot:Get() and ui.adaptive_damage:Get() == 1)
    ui.prev_os:SetVisible(ui.ideal_tick:Get())
    ui.override_1:SetVisible(ui.type:Get() == 1 and ui.presets:Get() == 3)
    ui.override_2:SetVisible(ui.type:Get() == 2 and ui.presets:Get() == 3)
    ui.override_3:SetVisible(ui.type:Get() == 3 and ui.presets:Get() == 3)
    ui.override_4:SetVisible(ui.type:Get() == 4 and ui.presets:Get() == 3)
    ui.override_5:SetVisible(ui.type:Get() == 5 and ui.presets:Get() == 3)
    ui.override_6:SetVisible(ui.type:Get() == 6 and ui.presets:Get() == 3)
    ui.type:SetVisible(ui.presets:Get() == 3)
    ui.custom_name:SetVisible(ui.visuals:Get(1))
    ui.watermark_color:SetVisible(ui.visuals:Get(1))
    ui.watermark_info_color:SetVisible(ui.visuals:Get(1))
    ui.name_input:SetVisible(ui.custom_name:Get() == 2 and ui.visuals:Get(1))
    ui.accent_color:SetVisible(ui.visuals:Get(3) or ui.visuals:Get(4) or ui.visuals:Get(9))
    ui.indicator_style:SetVisible(ui.visuals:Get(3))
    ui.keybinds_color:SetVisible(ui.visuals:Get(2))
    ui.anim_scope:SetVisible(ui.visuals:Get(6))
    ui.scope_color:SetVisible(ui.visuals:Get(6))
    ui.mute_enemy:SetVisible(ui.enemy_chat_viewer:Get())
    ui.scope_size:SetVisible(ui.visuals:Get(6))
    ui.scope_gap:SetVisible(ui.visuals:Get(6))
    ui.auto_peek:SetVisible(ui.visuals:Get(7))
    ui.hitmarker_color:SetVisible(ui.visuals:Get(10))
    ui.dmg_marker_color:SetVisible(ui.visuals:Get(11))
    ui.dmg_ind_style:SetVisible(ui.visuals:Get(13))
    ui.dmg_ind_color:SetVisible(ui.visuals:Get(13))
    for k,v in pairs(anitaim_condition) do
        for i, data in pairs(v) do
            if ui.presets:Get() == 3 then anitaim_condition[k].jitter_value1:SetVisible(anitaim_condition[k].modifier_mode:Get() ~= 0 and (k == 1 and true or k == 2 and ui.override_1:Get() or k == 3 and ui.override_2:Get() or k == 4 and ui.override_3:Get() or k == 5 and ui.override_4:Get() or k == 6 and ui.override_5:Get() or k == 7 and ui.override_6:Get()) and ui.type:Get()+1 == k) anitaim_condition[k].switch_ticks:SetVisible(anitaim_condition[k].yaw_mode:Get() == 0 and (k == 1 and true or k == 2 and ui.override_1:Get() or k == 3 and ui.override_2:Get() or k == 4 and ui.override_3:Get() or k == 5 and ui.override_4:Get() or k == 6 and ui.override_5:Get() or k == 7 and ui.override_6:Get()) and ui.type:Get()+1 == k) data:SetVisible(ui.type:Get()+1 == k and (k == 1 and true or k == 2 and ui.override_1:Get() or k == 3 and ui.override_2:Get() or k == 4 and ui.override_3:Get() or k == 5 and ui.override_4:Get() or k == 6 and ui.override_5:Get() or k == 7 and ui.override_6:Get()) and ui.presets:Get() == 3) else data:SetVisible(9 == k and ui.presets:Get() == 3) end
        end
    end

    ui.anti_brute:SetVisible(ui.presets:Get() ~= 0)
    ui.anti_brute_add:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_remove:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_switch:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_resetter:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_phase1:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_phase2:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool())
    ui.anti_brute_phase3:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 3)
    ui.anti_brute_phase4:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 4)
    ui.anti_brute_phase5:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 5)
    ui.anti_brute_phase6:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 6)
    ui.anti_brute_phase7:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 7)
    ui.anti_brute_phase8:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 8)
    ui.anti_brute_phase9:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() >= 9)
    ui.anti_brute_phase10:SetVisible(ui.presets:Get() ~= 0 and ui.anti_brute:GetBool() and ui.phases:Get() == 10)
end
ui.phases:SetVisible(false)
ui.anti_brute_add:RegisterCallback(anti_bruteforce.add)
ui.anti_brute_remove:RegisterCallback(anti_bruteforce.remove)
ui.scope_color1:SetVisible(false)
touch_callback.callback1()

local all_touch_callbacks = {
    ui.presets, ui.type, ui.dormant_aimbot, ui.ideal_tick, ui.visuals, ui.override_1, ui.adaptive_damage, ui.override_2, ui.override_3, ui.override_4, ui.override_5, ui.override_6, ui.hitsound_custom, ui.custom_name, ui.enemy_chat_viewer, ui.anti_brute_add, ui.anti_brute_remove, ui.anti_brute, anitaim_condition[1].yaw_mode, anitaim_condition[2].yaw_mode, anitaim_condition[3].yaw_mode, anitaim_condition[4].yaw_mode, anitaim_condition[5].yaw_mode, anitaim_condition[6].yaw_mode, anitaim_condition[7].yaw_mode, anitaim_condition[1].modifier_mode, anitaim_condition[2].modifier_mode, anitaim_condition[3].modifier_mode, anitaim_condition[4].modifier_mode, anitaim_condition[5].modifier_mode, anitaim_condition[6].modifier_mode, anitaim_condition[7].modifier_mode
}

for i = 1, #all_touch_callbacks do
    all_touch_callbacks[i]:RegisterCallback(function()
        touch_callback.callback1()
    end)
end
-- @endregion

-- @region: ragebot
ragebot.fix_ang = function(angles)
    while angles.pitch < -180.0 do
        angles.pitch = angles.pitch + 360.0
    end
    while angles.pitch > 180.0 do
        angles.pitch = angles.pitch - 360.0
    end

    while angles.yaw < -180.0 do
        angles.yaw = angles.yaw + 360.0
    end
    while angles.yaw > 180.0 do
        angles.yaw = angles.yaw - 360.0
    end

    if angles.pitch > 89.0 then
        angles.pitch = 89.0
    elseif angles.pitch < -89.0 then
        angles.pitch = -89.0
    end
    if angles.yaw > 180.0 then
        angles.yaw = 180.0
    elseif angles.pitch < -180.0 then
        angles.pitch = -180.0
    end

    return angles
end

ragebot.vec_ang = function(src, dist)
    local forward = dist - src

    if forward.x == 0 and forward.y == 0 then
        local yaw = 0

        if forward.z > 0 then
            pitch = 270
        else
            pitch = 90
        end

    else
        yaw = (math.atan2(forward.y, forward.x) * 180 / math.pi)
        if yaw < 0 then
            yaw = yaw + 360
        end

        tmp = math.sqrt(forward.x * forward.x + forward.y * forward.y)
        pitch = (math.atan2(-forward.z, tmp) * 180 / math.pi)

        if pitch < 0 then
            pitch = pitch + 360
        end

    end

    return ragebot.fix_ang(QAngle.new(pitch, yaw, 0))
end
ragebot.modify_velocity = function(cmd, goalspeed)
    local minspeed = math.sqrt((cmd.forwardmove * cmd.forwardmove) + (cmd.sidemove * cmd.sidemove))
    if goalspeed <= 0 or minspeed <= 0 then
        return
    end

    if EntityList.GetLocalPlayer():GetProp('m_flDuckAmount') >= 1 then
        goalspeed = goalspeed * 2.94117647
    end

    if minspeed <= goalspeed then
        return
    end

    local speedfactor = goalspeed / minspeed
    cmd.forwardmove = cmd.forwardmove * speedfactor
    cmd.sidemove = cmd.sidemove * speedfactor
end
ragebot.roundStarted = 0
ragebot.player_info_prev = {}
for i = 1, 64 do
    ragebot.player_info_prev[i] = {
        origin = Vector.new(0, 0, 0),
    }
end

ragebot.dormant_aim = function(cmd)
    if ui.dormant_aimbot:GetBool() then
        local lp = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
        if lp == nil then return end
        ragebot.can_hit_i = false
        ragebot.choke = false
        local ent = lp:GetActiveWeapon()
        if not ent then return end
        local inaccuracy = 1 / ent:GetInaccuracy(ent)
        if inaccuracy == nil then return end
        local tickcount = GlobalVars.tickcount
        local eyepos = lp:GetEyePosition()
        local simtime = lp:GetProp('m_flSimulationTime')
        local weapon = ent:GetWeaponID()
        local scoped = lp:GetProp('m_bIsScoped')
   
        local onground = bit.band(lp:GetProp('m_fFlags'), bit.lshift(1, 0))
        if tickcount < ragebot.roundStarted then return end -- to prevent shooting at ghost dormant esp @ the beginning of round
        local is_AWP = weapon == 9
        local is_auto = (weapon == 38 or weapon == 11)
        local is_scout = weapon == 40
        if ent:IsKnife() or ent:IsGrenade() or ent:IsReloading() or weapon == 31 then return end
        local hs_fix = refs.hide_shots:GetBool() and 0.3 or 0
        if weapon == 64 then -- for some reason can_shoot returns always false with r8 despite all 3 props being true, no idea why
            ragebot.can_shoot = simtime > ent:GetProp('m_flNextPrimaryAttack') + hs_fix -- doing this fixes it ><
        elseif ent:IsPistol() and not weapon == 64 and not weapon == 1 then
            ragebot.can_shoot = false
        else
            ragebot.can_shoot = simtime > math.max(lp:GetProp('m_flNextAttack') + hs_fix, ent:GetProp('m_flNextPrimaryAttack') + hs_fix, ent:GetProp('m_flNextSecondaryAttack'))
        end
   
        -- new player info
        local players = EntityList.GetEntitiesByName('CCSPlayer')
        ragebot.player_info = {}
        for i = 1, #players do
            local player = players[i]:GetPlayer()
            if EngineClient.IsConnected() and lp:IsAlive() then
                --if plist_get(player, 'Add to whitelist') then goto skip end
                if player:IsDormant() and not player:IsTeamMate() and player:GetProp('m_iHealth') > 0 and player ~= lp then
                    if player:GetRenderOrigin():Length2D() > ent:GetWeaponRange() then return end
                    ragebot.origin = player:GetProp('m_vecOrigin')
                    ragebot.alpha_multiplier = player:GetESPAlpha() -- grab alpha of the dormant esp
                    if ragebot.player_info_prev[i] ~= nil and ragebot.origin.x ~= 0 and ragebot.alpha_multiplier > 0 then -- if origin / dormant esp is valid
                        local dormant_accurate = ragebot.alpha_multiplier > 0.1 -- for debug purposes lower this to 0.1
                        if dormant_accurate then
                            local target_points = {
                                ragebot.origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector.new(0, 0, 28) or Vector.new(0, 0, 38)),
                                ragebot.origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector.new(0, 0, 30) or Vector.new(0, 0, 40)),
                                ragebot.origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector.new(0, 0, 32) or Vector.new(0, 0, 42)),
                                ragebot.origin + (player:GetProp('m_flDuckAmount') >= 1 and Vector.new(0, 0, 40) or Vector.new(0, 0, 50))
                            }
                       
                            for i = 1, #target_points do
                                local target = target_points[i]
                                local target_pos = ragebot.vec_ang(eyepos, target)
                                local dmg = Cheat.FireBullet(lp, eyepos, target)
                                if is_AWP then
                                    max_player_speed_alt = 100
                                elseif is_auto then
                                    max_player_speed_alt = 120
                                else
                                    max_player_speed_alt = ent:GetMaxSpeed() * 0.86
                                end
                                if ui.adaptive_damage:Get() == 0 then
                                    dormant_damage = refs.minimum_damage:GetInt()
                                else
                                    dormant_damage = ui.dormant_aimbot_damage:GetInt()
                                end
                                ragebot.can_hit = (dmg.trace.hit_entity == nil or dmg.trace.hit_entity:EntIndex() == player:EntIndex()) and (dmg.damage >= dormant_damage) and (not player:IsVisible(target)) -- added visibility check to mitigate shooting at anomalies?
                               
                                if ragebot.can_hit then
                                    ragebot.can_hit_i = true
                                    if ragebot.can_shoot then
                                        ragebot.modify_velocity(cmd, (scoped and max_player_speed_alt or ent:GetMaxSpeed())*0.2)
                                        -- autoscope
                                        if not scoped and ent:IsSniper() and onground == 1 then
                                            cmd.buttons = bit.bor(cmd.buttons, 2048)
                                        end
                                    end
                                   
                                    if refs.hide_shots:GetBool() then
                                        ragebot.choke = ragebot.can_shoot
                                    else
                                        ragebot.choke = true
                                    end
                                   
                                    if inaccuracy >= 90 and ragebot.choke then
                                        cmd.viewangles.pitch = target_pos.pitch
                                        cmd.viewangles.yaw = target_pos.yaw
                                        cmd.viewangles.roll = 0
                                        cmd.buttons = bit.bor(cmd.buttons, 1)
                                        -- dont shoot again
                                        ragebot.can_shoot = false
                                    end
                                end
                            end
                        end
                    end
                    ragebot.player_info[i] = {ragebot.origin, ragebot.alpha_multiplier, ragebot.can_hit_i}
                end
            end
        end
        ragebot.player_info_prev = ragebot.player_info
    end
end

ragebot.resetter = function(e)
    if not ui.dormant_aimbot:Get() then return end
    if e:GetName() ~= 'round_prestart' then return end
    local lp = EntityList.GetClientEntity(EngineClient.GetLocalPlayer()):GetPlayer()
    if lp == nil then return end
    freezetime = (CVar.FindVar('mp_freezetime'):GetFloat()+1) / GlobalVars.interval_per_tick -- get freezetime plus 1 second and disable dormantbob for that amount of ticks
    ragebot.roundStarted = GlobalVars.tickcount + freezetime
    ragebot.origin = nil
    ragebot.player_info_prev = {}
    for i = 1, 64 do
        ragebot.player_info_prev[i] = {
            origin = Vector.new(0, 0, 0),
        }
    end
    ragebot.player_info = {}
end

ragebot.gjioer = false
ragebot.teleport_tick = 0
ragebot.ideal_tick = function()
    local GetNetChannelInfo = EngineClient.GetNetChannelInfo()
    local ping = GetNetChannelInfo:GetAvgLatency(0) * 1000
    local AIPeek = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        bind = binds[i]
        if bind:GetName() == 'Peek bot key' and bind:IsActive() then
            AIPeek = true
        end
    end

    if (refs.auto_peek:Get() or AIPeek) and refs.double_tap:Get() then
        idt = true
    else
        idt = false
    end

    if ui.ideal_tick:Get() then
        if ui.prev_os:Get() and idt then
            refs.fl_limit:SetInt(0)
            if ping >= 60 then
                refs.fl_limit:SetInt(8)
            elseif ping <= 30 then
                refs.fl_limit:SetInt(0)
            else
                refs.fl_limit:SetInt(4)
            end
        else
            refs.fl_limit:SetInt(14)
        end

        if idt then
            if ragebot.gjioer then
                ragebot.teleport_tick = ragebot.teleport_tick + 1
                if ragebot.teleport_tick > 1 then
                    ragebot.gjioer = false
                    ragebot.teleport_tick = 0
                end
                Exploits.OverrideDoubleTapSpeed(23) -- O_o
            end
        else
            Exploits.OverrideDoubleTapSpeed(13)
        end
    end
end

helpers.cheat:RegisterCallback('registered_shot', function(shot)
    if refs.auto_peek:Get() and refs.double_tap:Get() and ui.ideal_tick:Get() then
        Exploits.ForceTeleport()
        Exploits.ForceCharge()
        ragebot.gjioer = true
        ragebot.teleport_tick = 0
    end
end)

ragebot.normalize_yaw = function(yaww) while yaww > 180 do yaww = yaww - 360 end while yaww < -180 do yaww = yaww + 360 end return yaww end
ragebot.mathdeg_atan = function(xdelta, ydelta)
    if xdelta == 0 and ydelta == 0 then
        return 0
    end
    return math.deg(math.atan2(ydelta, xdelta))
end

ragebot.nearest = function()
    if EngineClient.IsConnected() == nil then return end
    if EntityList.GetLocalPlayer() == nil then return end
    local eyepos = EntityList.GetLocalPlayer():GetEyePosition()
    local viewangles = EngineClient.GetViewAngles()
    local bestenemy = nil
    local fov = 180
    local all_players = EntityList.GetEntitiesByName('CCSPlayer')
    for i = 1, #all_players do
        local enemy = all_players[i]:GetPlayer()
        if enemy ~= nil and enemy ~= EntityList.GetLocalPlayer() and not enemy:IsTeamMate() then
            cur = enemy:GetProp('m_vecOrigin')
            cur_fov = math.abs(ragebot.normalize_yaw(ragebot.mathdeg_atan(eyepos.x - cur.x, eyepos.y - cur.y) - viewangles.yaw + 180))
            if cur_fov < fov then
                fov = cur_fov
                bestenemy = enemy
            end
        end
    end
    return bestenemy
end

-- @endregion

-- @region: anti-aims
antiaim.legitaa_time = 0
antiaim.check = false
antiaim.side = 1
antiaim.override_yaw = function(cmd, yaw_add, jitter_value, jitter_type)
    if FakeLag.SentPackets() ~= 0 and ClientState.m_choked_commands == 0 then
        antiaim.side = antiaim.side * -1
    end
   
    local yaw_modifier = yaw_add
   
    if jitter_type == 1 then
        yaw_modifier = yaw_modifier+(jitter_value/2)*antiaim.side
    elseif jitter_type == 2 then
        yaw_modifier = yaw_modifier+jitter_value*((antiaim.side+1)/2)
    elseif jitter_type == 3 then
        yaw_modifier = math.random(-jitter_value,jitter_value)
    elseif jitter_type == 4 then
        yaw_modifier = yaw_modifier-(GlobalVars.tickcount*3)%jitter_value
    end
   
    return yaw_modifier
end

antiaim.conditions = function(cmd)
    local local_player = EntityList.GetLocalPlayer()
    if local_player == nil then return end
    local tickcount = GlobalVars.tickcount % 4 > ClientState.m_choked_commands
    local anti_aim_invert = antiaim.side ~= 1
    if EngineClient.IsConnected() and local_player:IsAlive() then
        if gkidfds then
            local preset_values = function()
                local set_antiaim = function(table)
                    refs.yaw_add:Set(0)
                    AntiAim.OverrideYawOffset(antiaim.override_yaw(cmd, table[1], table[3], table[2]))
                    AntiAim.OverrideLimit(antiaim.side ~= 1 and table[4] or table[5])

                    if table[6] == 2 then
                        AntiAim.OverrideInverter(antiaim.side ~= 1)
                    end

                    refs.lby_mode:SetInt(table[7])
                    refs.freestand_desync:SetInt(table[8])
                    refs.desync_on_shot:SetInt(table[9])
                end

                local preset_settings = {
                    -- {Yaw Add, Yaw Modifier, Modifier Degree, Left Limit, Right Limit, Fake Options, LBY Mode, Freestanding Desync, Desync On Shot}
                    [1] = {
                        ['Standing'] = {antiaim.side ~= 1 and -12 or 6, 1, 37, 60, 60, 2, 1, 0, 2},
                        ['Moving'] = {antiaim.side ~= 1 and -9 or 0, 1, 60, 52, 60, 2, 0, 0, 3},
                        ['Crouching'] = {antiaim.side ~= 1 and -14 or 18, 1, 36, 57, 60, 2, 1, 0, 0},
                        ['Fakeducking'] = {antiaim.side ~= 1 and -10 or 10, 1, 60, 60, 60, 2, 1, 0, 0},
                        ['Slowwalking'] = {antiaim.side ~= 1 and -15 or 16, 1, 45, 42, 55, 2, 1, 0, 2},
                        ['Air'] = {antiaim.side ~= 1 and -1 or 10, 1, 55, 52, 60, 2, 1, 0, 0},
                        ['Air+Duck'] = {antiaim.side ~= 1 and -4 or 11, 1, 45, 60, 60, 2, 1, 0, 0},
                    },

                    [2] = {
                        ['Standing'] = {antiaim.side ~= 1 and -14 or 5, 2, 42, 45, 48, 2, 0, 0, 2},
                        ['Moving'] = {antiaim.side ~= 1 and -31 or 7, 2, 28, 42, 54, 2, 1, 0, 3},
                        ['Crouching'] = {antiaim.side ~= 1 and -23 or 5, 2, 45, 48, 58, 2, 1, 0, 1},
                        ['Fakeducking'] = {antiaim.side ~= 1 and -10 or 10, 1, 69, 60, 60, 2, 1, 0, 0},
                        ['Slowwalking'] = {antiaim.side ~= 1 and -25 or 11, 2, 32, 48, 49, 2, 0, 0, 2},
                        ['Air'] = {antiaim.side ~= 1 and -22 or 3, 1, 35, 54, 58, 2, 0, 0, 0},
                        ['Air+Duck'] = {antiaim.side ~= 1 and -18 or 5, 2, 37, 54, 52, 2, 1, 0, 1},
                    }
                }
                local current_preset_settings = preset_settings[ui.presets:Get()][local_player:GetState()]
           
                if ui.presets:Get() ~= 3 then
                    set_antiaim(current_preset_settings)
                end
            end

            if ui.presets:Get() == 3 then
                local state_aa = 'off'
                if local_player:GetState() == 'Air+Duck' and ui.override_6:GetBool() then
                    state_id = 7
                elseif local_player:GetState() == 'Air' and ui.override_5:GetBool() then
                    state_id = 6
                elseif local_player:GetState() == 'Crouching' and ui.override_2:GetBool() then
                    state_id = 3
                elseif local_player:GetState() == 'Slowwalking' and ui.override_3:GetBool() then
                    state_id = 4
                elseif local_player:GetState() == 'Moving' and ui.override_4:GetBool() then
                    state_id = 5
                elseif local_player:GetState() == 'Standing' and ui.override_1:GetBool() then
                    state_id = 2
                else
                    state_id = 1
                end

                if anitaim_condition[state_id].modifier_mode:Get() == 0 then
                    jit_val = anitaim_condition[state_id].jitter_value:Get()
                elseif anitaim_condition[state_id].modifier_mode:Get() == 1 then
                    if anitaim_condition[state_id].jitter_value:Get() < anitaim_condition[state_id].jitter_value1:Get() then
                        jit_val = Utils.RandomInt(anitaim_condition[state_id].jitter_value:Get(), anitaim_condition[state_id].jitter_value1:Get())
                    else
                        jit_val = math.random(anitaim_condition[state_id].jitter_value:Get(), anitaim_condition[state_id].jitter_value1:Get())
                    end
                else
                    jit_val = antiaim.side == 1 and anitaim_condition[state_id].jitter_value:Get() or anitaim_condition[state_id].jitter_value1:Get()
                end

                if anitaim_condition[state_id].yaw_mode:Get() == 0 then
                    invert_aye = (anitaim_condition[state_id].switch_ticks:Get())/2 <= (GlobalVars.tickcount % anitaim_condition[state_id].switch_ticks:Get()) and anitaim_condition[state_id].yaw_add_r:Get() or anitaim_condition[state_id].yaw_add_l:Get()
                else
                    if anitaim_condition[state_id].fake_option:Get(3) then
                        local rndm = Utils.RandomInt(0, 1) == 0
                        invert_aye = rndm and anitaim_condition[state_id].yaw_add_r:Get() or anitaim_condition[state_id].yaw_add_l:Get()
                    elseif anitaim_condition[state_id].fake_option:Get(2) then
                        invert_aye = antiaim.side == 1 and anitaim_condition[state_id].yaw_add_r:Get() or anitaim_condition[state_id].yaw_add_l:Get()
                    else
                        anti_aim_invert = AntiAim.GetInverterState()
                        invert_aye = anti_aim_invert and anitaim_condition[state_id].yaw_add_r:Get() or anitaim_condition[state_id].yaw_add_l:Get()
                    end
                end

                refs.yaw_add:Set(0)
                --if ClientState.m_choked_commands == 0 then
                    if anitaim_condition[state_id].fake_option:Get(3) then
                        local rndm = Utils.RandomInt(0, 1) == 0
                        AntiAim.OverrideYawOffset(antiaim.override_yaw(cmd, invert_aye, jit_val, anitaim_condition[state_id].jitter:Get()))
                        if anitaim_condition[state_id].fake_type:Get() == 0 then
                            AntiAim.OverrideLimit(rndm and anitaim_condition[state_id].left_desync_value:Get() or anitaim_condition[state_id].right_desync_value:Get())
                        else
                            AntiAim.OverrideLimit(Utils.RandomInt(anitaim_condition[state_id].left_desync_value:Get(), anitaim_condition[state_id].right_desync_value:Get()))
                        end
                        AntiAim.OverrideInverter(rndm)
                    elseif anitaim_condition[state_id].fake_option:Get(2) then
                        --print('123')
                        AntiAim.OverrideYawOffset(antiaim.override_yaw(cmd, invert_aye, jit_val, anitaim_condition[state_id].jitter:Get()))
                        if anitaim_condition[state_id].fake_type:Get() == 0 then
                            AntiAim.OverrideLimit(antiaim.side ~= 1 and anitaim_condition[state_id].left_desync_value:Get() or anitaim_condition[state_id].right_desync_value:Get())
                        else
                            AntiAim.OverrideLimit(Utils.RandomInt(anitaim_condition[state_id].left_desync_value:Get(), anitaim_condition[state_id].right_desync_value:Get()))
                        end
                        AntiAim.OverrideInverter(antiaim.side ~= 1)
                    else
                        anti_aim_invert = AntiAim.GetInverterState()
                        AntiAim.OverrideYawOffset(antiaim.override_yaw(cmd, invert_aye, jit_val, anitaim_condition[state_id].jitter:Get()))
                        if anitaim_condition[state_id].fake_type:Get() == 0 then
                            AntiAim.OverrideLimit(anti_aim_invert and anitaim_condition[state_id].left_desync_value:Get() or anitaim_condition[state_id].right_desync_value:Get())
                        else
                            AntiAim.OverrideLimit(Utils.RandomInt(anitaim_condition[state_id].left_desync_value:Get(), anitaim_condition[state_id].right_desync_value:Get()))
                        end
                        AntiAim.OverrideInverter(Menu.FindVar('Aimbot', 'Anti Aim', 'Fake Angle', 'Inverter'):Get() and true or false)
                    end
                --end
                refs.fake_option:Set(anitaim_condition[state_id].fake_option:Get(1) and 1 or 0)
                refs.lby_mode:Set(anitaim_condition[state_id].lby_mode:Get())
                refs.freestand_desync:Set(anitaim_condition[state_id].freestand_desync:Get())
                refs.desync_on_shot:Set(anitaim_condition[state_id].desync_on_shot:Get())
            elseif ui.presets:Get() ~= 0 then
                preset_values()
            end

            local active_weapon = local_player:GetActiveWeapon()
            if active_weapon == nil then return end
            local weapon_id = active_weapon:GetWeaponID()

            if ui.auto_awp_sw:Get() and (weapon_id == 9 or weapon_id == 38 or weapon_id == 11) and refs.slow_walk:Get() then
                refs.yaw_add:Set(0)
                if ClientState.m_choked_commands == 0 then
                    AntiAim.OverrideYawOffset(antiaim.override_yaw(cmd, (antiaim.side == 1 and -2 or -5), 1, 0))
                    AntiAim.OverrideLimit(antiaim.side == 1 and 18 or 60)
                    AntiAim.OverrideInverter(false)
                end

                refs.fake_option:Set(1)
                refs.lby_mode:Set(0)
                refs.freestand_desync:Set(1)
                refs.desync_on_shot:Set(3)
            end
        end
       
        gkidfds = true
       
        if anti_bruteforce.work and ui.anti_brute:Get() then
            local phase = {
                [0] = ui.anti_brute_phase1,
                [1] = ui.anti_brute_phase2,
                [2] = ui.anti_brute_phase3,
                [3] = ui.anti_brute_phase4,
                [4] = ui.anti_brute_phase5,
                [5] = ui.anti_brute_phase6,
                [6] = ui.anti_brute_phase7,
                [7] = ui.anti_brute_phase8,
                [8] = ui.anti_brute_phase9,
                [9] = ui.anti_brute_phase10
            }
            if ragebot.nearest() ~= nil and anti_bruteforce.memory[ragebot.nearest():EntIndex()].count ~= nil and phase[anti_bruteforce.memory[ragebot.nearest():EntIndex()].count] ~= nil then
                anti_bruteforce.override_limit(phase[anti_bruteforce.memory[ragebot.nearest():EntIndex()].count]:Get(), true)
            end
        end
        if ui.manual_yaw_base:Get() ~= 0 then refs.yaw:Set(ui.manual_yaw_base:Get() - 1) end
        if not Cheat.IsKeyDown(0x45) then antiaim.legitaa_time = GlobalVars.realtime refs.pitch:Set(1) end
        if ui.anti_hit_helpers:Get(1) then
            if Cheat.IsKeyDown(0x45) and not off_legit_aa then
                local C4 = EntityList.GetEntitiesByClassID(129);
                for C4i = 1, #C4 do
                    defuse = local_player:GetRenderOrigin():DistTo(C4[C4i]:GetRenderOrigin()) < 100
                end
                local plant = local_player:GetProp('m_bInBombZone')
                local host = local_player:GetProp('m_bIsGrabbingHostage')
               
                if defuse or (weapon_id == 49 and plant) or host then
                    antiaim.check = true
                else
                    antiaim.check = false
                end
                if not antiaim.check then
                    state_aa = 'legit aa'
                    refs.pitch:Set(0)
                    AntiAim.OverrideYawOffset(180)
                    AntiAim.OverrideLimit(60)
                    refs.fake_option:Set(0)
                    refs.yaw:Set(1)
                    refs.lby_mode:Set(1)
                    refs.freestand_desync:Set(1)
                    refs.desync_on_shot:Set(2)
                    if Cheat.IsKeyDown(0x45) then E = false if GlobalVars.realtime > antiaim.legitaa_time + 0.2 then if E == false then EngineClient.ExecuteClientCmd('+use') E = true end if E then EngineClient.ExecuteClientCmd('-use') end end else  if E then EngineClient.ExecuteClientCmd('-use') E = false end end
                end
            else
                state_aa = 'off'
            end
        end
    end
end

antiaim.fakelag = function()
    if ui.anti_hit_helpers:Get(3) and refs.hide_shots:Get() then
        refs.fl_enable:Set(false)
    else
        refs.fl_enable:Set(true)
    end
end

antiaim.avoid_backstab = function()
    if ui.anti_hit_helpers:Get(2) then
        local all_players = EntityList.GetEntitiesByName('CCSPlayer')
        for i = 1, #all_players do
            local enemy = all_players[i]:GetPlayer()
            if enemy ~= EntityList.GetLocalPlayer() and not enemy:IsTeamMate() and not enemy:IsDormant() and enemy:IsAlive() and enemy:GetActiveWeapon() ~= nil and enemy:GetActiveWeapon():IsKnife() and enemy:IsVisible(enemy:GetRenderOrigin()) then
                if EntityList.GetLocalPlayer():GetRenderOrigin():DistTo(enemy:GetProp('m_vecOrigin')) <= 300 and not Cheat.IsKeyDown(0x45) then
                    refs.yaw:Set(4)
                    AntiAim.OverrideYawOffset(180)
                end
            end
        end
    end
end

antiaim.better_hs = function()
    if ui.anti_hit_helpers:Get(6) and refs.hide_shots:Get() then
        Exploits.ForceCharge()
    end
end

antiaim.bombsite_e_fix = function(cmd)
    if ui.anti_hit_helpers:Get(4) then
        local local_player = EntityList.GetLocalPlayer()
        if local_player == nil then return end
        local is_in_bombzone = local_player:GetProp("m_bInBombZone")
        local team_num = local_player:GetProp("m_iTeamNum")

        if is_in_bombzone and team_num == 2 then
            local self_eye_position = local_player:GetEyePosition()
            local view_angles_in_vector = Cheat.AngleToForward(EngineClient.GetViewAngles())

            local final_point = self_eye_position + view_angles_in_vector * 8192
            local mask_offset = 0x4600400B

            local trace_data = EngineTrace.TraceRay(self_eye_position, final_point, local_player, mask_offset)
            local trace_fraction = trace_data.fraction
            local trace_hit_entity = trace_data.hit_entity

            local is_using = false
            if trace_data ~= nil then
                if trace_fraction < 1 and trace_hit_entity ~= nil then
                    local entity_classname = trace_hit_entity:GetClassName()
                    is_using = entity_classname ~= "CWorld" and entity_classname ~= "CFuncBrush" and entity_classname ~= "CCSPlayer"
                end
            end
            off_legit_aa = false
            if bit.band(cmd.buttons, 32) == 32 then
                if not is_using then
                    AntiAim.OverridePitch(89)
                    AntiAim.OverrideYawOffset(0)
                    off_legit_aa = true
                    cmd.buttons = bit.band(cmd.buttons, bit.bnot(32))
                end
            end
        end
    end
end

antiaim.shit_aa_on_warmup = function()
    if ui.anti_hit_helpers:Get(5) and EntityList.GetGameRules():GetProp('m_bWarmupPeriod') then
        if not off_legit_aa then
            AntiAim.OverrideYawOffset(math.random(-30, 30))
            AntiAim.OverrideLimit(math.random(0, 40))
            AntiAim.OverrideLBYOffset(math.random(-58, 59))
        end
    end
end
-- @endregion

-- @region: anti-bruteforce
anti_bruteforce.override_limit = function(angle, isoverride)
    if angle < 0 then
        if isoverride and ui.anti_brute_switch:Get() then AntiAim.OverrideInverter(true) end
        AntiAim.OverrideLimit(math.abs(angle))
    elseif angle == 0 or angle > 0 then
        if isoverride and ui.anti_brute_switch:Get() then AntiAim.OverrideInverter(false) end
        AntiAim.OverrideLimit(angle)
    end
end

anti_bruteforce.vec_closest_point_on_ray = function(target, ray_start, ray_end)
    local to = target - ray_start
    local direction = ray_end - ray_start
    local ray_length = #direction

    direction.x = direction.x / ray_length
    direction.y = direction.y / ray_length
    direction.z = direction.z / ray_length

    local direction_along = direction.x * to.x + direction.y * to.y + direction.z * to.z
    if direction_along < 0 then return ray_start end
    if direction_along > ray_length then return ray_end end

    return Vector.new(ray_start.x + direction.x * direction_along, ray_start.y + direction.y * direction_along, ray_start.z + direction.z * direction_along)
end

anti_bruteforce.tick_work = 0
anti_bruteforce.distance = 0
anti_bruteforce.bullet_impact = function(eye_pos, eyepos, impact)
    anti_bruteforce.distance = anti_bruteforce.vec_closest_point_on_ray(eye_pos, eyepos, impact):DistTo(eye_pos)
    if anti_bruteforce.distance > 65 then return end
    anti_bruteforce.tick_work = GlobalVars.tickcount
end

anti_bruteforce.handle_brutforcetime = function()
    if ui.presets:Get() == 0 then return end
    for i, var in ipairs(anti_bruteforce.work_memory) do
        if i > 1 then
            table.remove(anti_bruteforce.work_memory,i)
        end
        anti_bruteforce.work = true
        anti_bruteforce.work_value = GlobalVars.realtime - var.time
       
        if anti_bruteforce.work_value > 4 then
            anti_bruteforce.work_value = 0
            anti_bruteforce.work = false
            table.remove(anti_bruteforce.work_memory, i)
        end
    end
end

anti_bruteforce.count = 0
anti_bruteforce.anti_bruteforcee = function(e)
    if ui.presets:Get() == 0 then return end
    if e:GetName() ~= 'bullet_impact' then return end
    if anti_bruteforce.tick_work == GlobalVars.tickcount then return end
    if not EngineClient.IsConnected() then return end
    if not EntityList.GetLocalPlayer():IsAlive() then return end
    if not EntityList.GetPlayerForUserID(e:GetInt('userid')) then return end
    if not e:GetInt('userid') then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')):IsAlive() == false then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')):IsDormant() then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')):IsTeamMate() then return end
    if not ui.anti_brute:GetBool() then return end
   
    local impact = Vector.new(e:GetInt('x'), e:GetInt('y'), e:GetInt('z'))
    local eyepos = EntityList.GetPlayerForUserID(e:GetInt('userid')):GetEyePosition()
    local eye_pos = EntityList.GetLocalPlayer():GetEyePosition()

    local head_vec = anti_bruteforce.bullet_impact(eye_pos, eyepos, impact)

    if anti_bruteforce.distance < 65 then
        anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count + 1
        if ui.phases:Get()-1 < anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count then
            anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = 0
        end
        anti_bruteforce.count = anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count

        table.insert(miscellaneous.stuff, {text2 = {
            name = '',
            hit = 'Switch due to shot [dst: ',
            who = ('%.0f'):format(anti_bruteforce.distance),
            in_the = ']',
            where = '',
            for_ = '',
            how_much = '',
            damage = '',
            how_muc_r = '',
            health = ''
        }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
        --table.insert(stuff, {textt = text, timet = GlobalVars.realtime})
        table.insert(anti_bruteforce.work_memory, 1, {time = GlobalVars.realtime})
    end
end

anti_bruteforce.resetter = function(e)
    if ui.presets:Get() == 0 and not ui.anti_brute_resetter:Get() then return end
    if e:GetName() ~= 'player_death' then return end
    if e:GetInt('userid') == nil then return end
    if not EngineClient.IsConnected() then return end
    if not EntityList.GetPlayerForUserID(e:GetInt('userid')) then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')):IsAlive() == false then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')):IsDormant() then return end
    if EntityList.GetLocalPlayer() == nil then return end
    if EntityList.GetPlayerForUserID(e:GetInt('userid')) == EntityList.GetLocalPlayer() then
        anti_bruteforce.memory[EntityList.GetPlayerForUserID(e:GetInt('userid')):EntIndex()].count = 0

        table.insert(miscellaneous.stuff, {text2 = {
            name = '',
            hit = 'Reset Brute-Force Data',
            who = '',
            in_the = '',
            where = '',
            for_ = '',
            how_much = '',
            damage = '',
            how_muc_r = '',
            health = ''
        }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
    end
end
-- @endregion

-- @region: animations
animations.math_clamp = function(value, min, max)
    return math.min(max, math.max(min, value))
end

animations.math_lerp = function(a, b_, t)
    local t = animations.math_clamp(GlobalVars.frametime * (0.045 * 175), 0, 1)

    if type(a) == 'userdata' then
        r, g, b, a = a.r, a.g, a.b, a.a
        e_r, e_g, e_b, e_a = b_.r, b_.g, b_.b, b_.a
        r = animations.math_lerp(r, e_r, t)
        g = animations.math_lerp(g, e_g, t)
        b = animations.math_lerp(b, e_b, t)
        a = animations.math_lerp(a, e_a, t)
        return Color.new(r, g, b, a)
    end

    local d = b_ - a
    d = d * t
    d = d + a

    if b_ == 0 and d < 0.01 and d > -0.01 then
        d = 0
    elseif b_ == 1 and d < 1.01 and d > 0.99 then
        d = 1
    end

    return d
end

animations.anim_new = function(name, new, remove, speed)
    if not animations.anim_list[name] then
        animations.anim_list[name] = {}
        animations.anim_list[name].color = Color.new(0, 0, 0, 0)
        animations.anim_list[name].number = 0
        animations.anim_list[name].call_frame = true
    end

    if remove == nil then
        animations.anim_list[name].call_frame = true
    end

    if speed == nil then
        speed = 0.010
    end

    if type(new) == 'userdata' then
        lerp = animations.math_lerp(animations.anim_list[name].color, new, speed)
        animations.anim_list[name].color = lerp

        return lerp
    end

    lerp = animations.math_lerp(animations.anim_list[name].number, new, speed)
    animations.anim_list[name].number = lerp

    return lerp
end

animations.anim_get = function(name)
    return animations.anim_list[name] == nil and {number = 0, color = Color.new(1, 1, 1, 0), call_frame = false} or animations.anim_list[name]
end

animations.same_colors = function(color1, color2)
    return color1.r == color2.r and color1.g == color2.g and color1.b == color2.b and color1.a == color2.a
end

animations.anim_upd = function()
    for k, v in pairs(animations.anim_list) do
        if not animations.anim_list[k].call_frame then
            if type(animations.anim_get(k).number) == 'userdata' then
                if animations.same_colors(animations.anim_new(k, Color.new(0, 0, 0, 0), true), Color.new(0, 0, 0, 0)) then
                    animations.anim_list[k] = nil
                end
            else
                if animations.anim_new(k, 0, true) == 0 then
                    animations.anim_list[k] = nil
                end
            end
            goto skip
        end

        animations.anim_list[k].call_frame = false
        ::skip::
    end
end
-- @endregion

-- @region: visuals
local get_my_steamid = Panorama.LoadString([[
    return MyPersonaAPI.GetXuid()
]])

local my_steam = get_my_steamid()
local dowloaded = false
Http.GetAsync(('https://steamcommunity.com/profiles/%s/?xml=1'):format(my_steam), function(url_content)
    if url_content == nil then return end
    link_start = string.find(url_content, '<avatarMedium>')
    if link_start == nil then return end
    link_end = string.find(url_content, '</avatarMedium>')
    if link_end == nil then return end
    ht4r = url_content:sub(link_start+23,link_end-4);
    Http.GetAsync(ht4r, function(response)
        image1 = Render.LoadImage(response, Vector2.new(11, 11))
        dowloaded = true
    end)
end)

local client = {}
client.data_call = {}
client.delay_call = function(time, fn)
    table.insert(client.data_call, {
        fn = fn,
        time = time,
        realtime = GlobalVars.realtime
    })

    client.delay_call_f = function()
        for i, data in ipairs(client.data_call) do
            if data.realtime + data.time < GlobalVars.realtime then
                data.fn()
                data.realtime = GlobalVars.realtime
            end
        end
    end
end

-- @note: example

local json = Panorama.LoadString([[
    return {
        stringify: JSON.stringify,
        parse: JSON.parse,
        time: () => {
            var now = new Date();

            var hour = now.getHours();
            var minute = now.getMinutes();
            var second = now.getSeconds();

            if(hour.toString().length == 1) {
                hour = '0'+hour;
            }
            if(minute.toString().length == 1) {
                minute = '0'+minute;
            }
            if(second.toString().length == 1) {
                second = '0'+second;
            }  
            var dateTime = hour+':'+minute+':'+second;  

            return dateTime;
        },
    };
]])()

local get_fps = 0
local watermark_info_time = 0
local watermark_info = ('v1.4.2 | %s | ultimate'):format(json:time())
local watermark_info_y = 0

client.delay_call(0.4, function() --Oh no cringe
    get_fps = 1 / GlobalVars.frametime
end)

visuals.indicators.info = function(e)
    if e:GetName() ~= 'player_spawn' then return end
    local local_player = EntityList.GetLocalPlayer()
    if local_player == nil then return end
    local userid = e:GetInt('userid')
    if userid == nil then return end
    local userid_p = EntityList.GetPlayerForUserID(e:GetInt('userid'))
    if userid_p == nil then return end

    if userid_p == local_player then
        watermark_info = ('v1.4.2 | %s | ultimate'):format(json:time())
        watermark_info_time = 0
        watermark_info_y = 0
    end
end

visuals.indicators.watermark = function()
    --ui.visuals:Get(1)
    local watermark_alpha = animations.anim_new('watermark alpha', ui.visuals:Get(1) and 1 or 0)
    if EngineClient.IsConnected() and watermark_alpha > 0.01 then
        if ui.custom_name:Get() == 0 then
            username = Cheat.GetCheatUserName()
        elseif ui.custom_name:Get() == 1 then
            username = EntityList.GetLocalPlayer():GetName()
        else
            username = ui.name_input:Get()
        end
        local text = ('melancholia.ws    | %s | %sms | %sfps'):format(username, math.floor(EngineClient.GetNetChannelInfo():GetLatency(0) * 1000), math.floor(get_fps))
        bw1 = Render.CalcTextSize(text, 9, fonts.pixel9).x
        bw = animations.anim_new('watermark anim', bw1)
        height = 20
        local sw, sh = screen_size.x, screen_size.y
        local x = sw*0.5
        local y = sh - 20

        --Render.GradientBoxFilled(Vector2.new((x + bw)-40, y), Vector2.new((x + bw)-80, y + height), Color.RGBA(0, 0, 0, 0), Color.RGBA(0, 0, 0, 80), Color.RGBA(0, 0, 0, 0), Color.RGBA(0, 0, 0, 80))
        add_y = animations.anim_new('info anim', watermark_info_y)
        if watermark_info_time < 850 then
            watermark_info_y = 50
            watermark_info_time = watermark_info_time + 1
        else
            watermark_info_y = 0
        end
        info_alpha = animations.anim_new('info aplha', add_y > 6.7 and 1 or 0)
        if add_y > 1.7 and info_alpha > 0.01 then
            Render.Text(watermark_info, Vector2.new(sw/2-Render.CalcTextSize(watermark_info, 9, fonts.pixel9).x/2, y+30-add_y), Color.new(ui.watermark_info_color:GetColor().r, ui.watermark_info_color:GetColor().g, ui.watermark_info_color:GetColor().b, watermark_alpha*info_alpha), 9, fonts.pixel9, true)
        end
        Render.BoxFilled(Vector2.new((x - bw/2)-5, y+1), Vector2.new((x + bw/2)+4, y + height), Color.RGBA(9, 9, 10, math.floor(watermark_alpha*200)))
        Render.Box(Vector2.new((x - bw/2)-5, y+1), Vector2.new((x + bw/2)+4, y + height), Color.RGBA(9, 9, 10, math.floor(watermark_alpha*255)))
       
        --Render.GradientBoxFilled(Vector2.new((x - bw)+80, y), Vector2.new((x - bw)+40, y + height), Color.RGBA(0, 0, 0, 80), Color.RGBA(0, 0, 0, 0), Color.RGBA(0, 0, 0, 80), Color.RGBA(0, 0, 0, 0))
        Render.Text(text, Vector2.new(sw/2-bw/2, y+6), Color.new(.4, .4, .4, watermark_alpha), 9, fonts.pixel9, true)
       
        Render.Text('melancholia.ws', Vector2.new(sw/2-bw/2, y+6), Color.new(ui.watermark_color:GetColor().r, ui.watermark_color:GetColor().g, ui.watermark_color:GetColor().b, watermark_alpha), 9, fonts.pixel9, true)
        Render.Text(tostring(math.floor(EngineClient.GetNetChannelInfo():GetLatency(0) * 1000)), Vector2.new(sw/2-bw/2 + Render.CalcTextSize(('melancholia.ws    | %s | '):format(username), 9, fonts.pixel9).x, y+6), Color.new(ui.watermark_color:GetColor().r, ui.watermark_color:GetColor().g, ui.watermark_color:GetColor().b, watermark_alpha), 9, fonts.pixel9, true)
        Render.Text(tostring(math.floor(get_fps)), Vector2.new(sw/2-bw/2 + Render.CalcTextSize(('melancholia.ws    | %s | %sms | '):format(username, math.floor(EngineClient.GetNetChannelInfo():GetLatency(0) * 1000)), 9, fonts.pixel9).x, y+6), Color.new(ui.watermark_color:GetColor().r, ui.watermark_color:GetColor().g, ui.watermark_color:GetColor().b, watermark_alpha), 9, fonts.pixel9, true)
        if dowloaded then
            Render.Image(image1, Vector2.new(sw/2-bw/2 + Render.CalcTextSize(('melancholia.ws'):format(username), 9, fonts.pixel9).x+4, y+5), Vector2.new(11, 11), Color.new(1, 1, 1, watermark_alpha))
        end
    end
end

local body_yawf = 0
visuals.indicators.indicator = function()
    local local_player = EntityList.GetLocalPlayer()
    if not EngineClient.IsConnected() or not local_player:IsAlive() or local_player == nil then
        return
    end

    local anti_aim_invert = AntiAim.GetInverterState()
    local isDmg = false
    local isPing = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        bind = binds[i]
        if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
            isDmg = true
        end
        if bind:GetName() == 'Fake Ping' and bind:IsActive() then
            isPing = true
        end
    end

    local anims = {
        indicators_style1 = animations.anim_new('indicators style 1', ui.visuals:Get(3) and ui.indicator_style:Get() == 0 and 1 or 0),
        add_x = animations.anim_new('m_bIsScoped add 1', local_player:GetProp('m_bIsScoped') and 40 or 0)
    }
    if anti_aim_invert then
        anims.indicator_color = Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, anims.indicators_style1)
    else
        anims.indicator_color = Color.new(1, 1, 1, anims.indicators_style1)
    end

    anims.anim_pc = animations.anim_new('prec color 1', anims.indicator_color)

    if not anti_aim_invert then
        anims.indicator_color = Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, anims.indicators_style1)
    else
        anims.indicator_color = Color.new(1, 1, 1, anims.indicators_style1)
    end

    anims.anim_tn = animations.anim_new('tion color 1', anims.indicator_color)
    if anims.indicators_style1 >= 0.01 then
        local add_y = 22 * anims.indicators_style1
        local w1 = Render.CalcTextSize('ultimate', 9, fonts.pixel9)
        Render.Text('ultimate', Vector2.new(screen_size.x/2-w1.x/2 + 3 + anims.add_x, screen_size.y/2+add_y), Color.new(1, 1, 1, anims.indicators_style1), 9, fonts.pixel9, true)
        add_y = add_y + 9
        local w = Render.CalcTextSize('melancholia.ws', 9, fonts.pixel9)
        local w2 = Render.CalcTextSize('melanch', 9, fonts.pixel9)
        Render.Text('melanch', Vector2.new(screen_size.x/2-w.x/2 + 3 + anims.add_x, screen_size.y/2+add_y), anims.anim_pc, 9, fonts.pixel9, true)
        Render.Text('olia.ws`', Vector2.new(screen_size.x/2-w.x/2+w2.x + 3 + anims.add_x, screen_size.y/2+add_y), anims.anim_tn, 9, fonts.pixel9, true)
        add_y = add_y + 9
        if ClientState.m_choked_commands == 0 then
            body_yawf = math.min(local_player:GetBodyYaw(), 56)
        end
        body_yaw = animations.anim_new('body_yaw a', body_yawf)
        Render.BoxFilled(Vector2.new(screen_size.x/2-w.x/2 + 12 + anims.add_x, screen_size.y/2+add_y+1), Vector2.new(screen_size.x/2-w.x/2 + 60 + anims.add_x, screen_size.y/2+add_y+6), Color.new(.1, .1, .1, .7 * anims.indicators_style1))
        Render.Box(Vector2.new(screen_size.x/2-w.x/2 + 12 + anims.add_x, screen_size.y/2+add_y+1), Vector2.new(screen_size.x/2-w.x/2 + 60 + anims.add_x, screen_size.y/2+add_y+6), Color.new(.1, .1, .1, .7 * anims.indicators_style1))
        Render.GradientBoxFilled(Vector2.new(screen_size.x/2-w.x/2 + 13 + anims.add_x, screen_size.y/2+add_y+2), Vector2.new(screen_size.x/2-w.x/2 + 13 + (body_yaw/1.23) + anims.add_x, screen_size.y/2+add_y+5), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, 1 * anims.indicators_style1), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, .3 * anims.indicators_style1), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, 1 * anims.indicators_style1), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, .3 * anims.indicators_style1))
        add_y = add_y + 7
       
        local m_indicators =
        {
            {
                text = "RAPID",
                color = Exploits.GetCharge() == 1 and Color.new(.83, .83, .83) or Color.new(1, 0, 0),
                bool = refs.double_tap:Get()
            },
            {
                text = "OS-AA",
                color = Color.new(.51, .76, .07),
                bool = refs.hide_shots:Get()
            },
            {
                text = "DMG",
                color = Color.new(.83, .83, .83),
                bool = isDmg
            },
            {
                text = "SAFE",
                color = Color.new(.83, .83, .83),
                bool = refs.safe_points:Get() == 2
            },
            {
                text = "BAIM",
                color = Color.new(.83, .83, .83),
                bool = refs.body_aim:Get() == 2
            },
            {
                text = "PING",
                color = Color.new(.51, .76, .07),
                bool = isPing
            },
            {
                text = "DUCK",
                color = Color.new(.83, .83, .83),
                bool = refs.fakeduck:Get()
            }
        }

        for i, v in pairs(m_indicators) do
            local width = Render.CalcTextSize(v.text, 9, fonts.pixel9)
            anims.alpha = animations.anim_new(('alpha %s'):format(i), v.bool and 1 or 0)
            anims.color = animations.anim_new(('color %s'):format(i), Color.new(v.color.r, v.color.g, v.color.b, anims.alpha*anims.indicators_style1))

            if anims.alpha > 0.01 then
                add_y1 = animations.anim_new(('das %s'):format(i), add_y)
                Render.Text(v.text, Vector2.new(screen_size.x/2-width.x/2 + 3 + anims.add_x, screen_size.y/2+add_y1), anims.color, 9, fonts.pixel9, true)
                add_y = add_y + 9
            end
        end
    end
end

visuals.indicators.indicator3 = function()
    local local_player = EntityList.GetLocalPlayer()
    if not EngineClient.IsConnected() or not local_player:IsAlive() or local_player == nil then
        return
    end

    local anti_aim_invert = AntiAim.GetInverterState()
    local isDmg = false
    local isPing = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        bind = binds[i]
        if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
            isDmg = true
        end
        if bind:GetName() == 'Fake Ping' and bind:IsActive() then
            isPing = true
        end
    end

    local anims = {
        indicators_style3 = animations.anim_new('indicators style 3', ui.visuals:Get(3) and ui.indicator_style:Get() == 1 and 1 or 0),
        add_x = animations.anim_new('m_bIsScoped add 3', local_player:GetProp('m_bIsScoped') and 40 or 0)
    }
    if anti_aim_invert then
        anims.indicator_color = Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, anims.indicators_style3)
    else
        anims.indicator_color = Color.new(1, 1, 1, anims.indicators_style3)
    end

    anims.anim_pc = animations.anim_new('prec color 3', anims.indicator_color)

    if not anti_aim_invert then
        anims.indicator_color = Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, anims.indicators_style3)
    else
        anims.indicator_color = Color.new(1, 1, 1, anims.indicators_style3)
    end

    anims.anim_tn = animations.anim_new('tion color 3', anims.indicator_color)
    if anims.indicators_style3 >= 0.01 then
        local add_y = 15 * anims.indicators_style3
        --anims.alpha1 = math.floor(math.sin(math.abs(-math.pi + (GlobalVars.curtime * (2.25 / .75)) % (math.pi * 2))) * 200)/255
        --anims.alpha = animations.anim_new('anims.alpha a', anims.alpha1)
        local w1 = Render.CalcTextSize('melan cholia', 10, fonts.verdanar12bi)
       
        Render.Text('melan', Vector2.new(screen_size.x/2-w1.x/2 + 1 + anims.add_x, screen_size.y/2+1+add_y), Color.new(0, 0, 0, anims.indicators_style3/2), 10, fonts.verdanar12bi)
        Render.Text('melan', Vector2.new(screen_size.x/2-w1.x/2 + 2 + anims.add_x, screen_size.y/2+add_y), anims.anim_pc, 10, fonts.verdanar12bi)
        Render.Text('cholia', Vector2.new(screen_size.x/2 + 0 + anims.add_x, screen_size.y/2+1+add_y), Color.new(0, 0, 0, anims.indicators_style3/2), 10, fonts.verdanar12bi)
        Render.Text('cholia', Vector2.new(screen_size.x/2 + 1 + anims.add_x, screen_size.y/2+add_y), anims.anim_tn, 10, fonts.verdanar12bi)
        add_y = add_y + 11
        local w = Render.CalcTextSize('melancholia.ws', 9, fonts.pixel9)
        local w2 = Render.CalcTextSize('melanch', 9, fonts.pixel9)
        --Render.Text('melanch', Vector2.new(screen_size.x/2-w.x/2 + 3 + anims.add_x, screen_size.y/2+add_y), anims.anim_pc, 9, fonts.pixel9, true)
        --Render.Text('olia.ws`', Vector2.new(screen_size.x/2-w.x/2+w2.x + 3 + anims.add_x, screen_size.y/2+add_y), anims.anim_tn, 9, fonts.pixel9, true)

        if ClientState.m_choked_commands == 0 then
            body_yawf = local_player:GetBodyYaw()*1.724138
        end
        body_yaw = animations.anim_new('body_yaw3 a', body_yawf)
       
        Render.Text(('%.0f%%'):format(body_yawf), Vector2.new(screen_size.x/2-Render.CalcTextSize(('%.0f%%'):format(body_yawf), 9, fonts.pixel9).x/2 + 1 + anims.add_x, screen_size.y/2+add_y), Color.new(1, 1, 1, anims.indicators_style3), 9, fonts.pixel9, true)
        --add_y = add_y + 9
        --Render.Text(local_player:GetState(), Vector2.new(screen_size.x/2-Render.CalcTextSize(local_player:GetState(), 9, fonts.pixel9).x/2 + 1 + anims.add_x, screen_size.y/2+add_y), Color.new(1, 1, 1), 9, fonts.pixel9, true)
        add_y = add_y + 9
       
        local m_indicators =
        {
            {
                text = "      HS",
                color = Color.new(1, 1, 1),
                bool = refs.hide_shots:Get()
            },
            {
                text = "DT      ",
                color = Exploits.GetCharge() == 1 and Color.new(1, 1, 1) or (refs.double_tap:Get() and Color.new(1, 0, 0) or Color.new(1, 1, 1)),
                bool = refs.double_tap:Get(),
            },
            {
                text = "FS",
                color = Color.new(1, 1, 1),
                bool = refs.yaw:Get() == 5
            }
        }

        for i, v in pairs(m_indicators) do
            local width = Render.CalcTextSize(v.text, 9, fonts.pixel9)
            anims.alpha = animations.anim_new(('alpha3 %s'):format(i), v.bool and 1 or 0.3)
            anims.color = animations.anim_new(('color3 %s'):format(i), Color.new(v.color.r, v.color.g, v.color.b, anims.alpha*anims.indicators_style3))

            add_y1 = animations.anim_new(('das3 %s'):format(i), add_y)
            Render.Text(v.text, Vector2.new(screen_size.x/2-width.x/2 + 1 + anims.add_x, screen_size.y/2+add_y1), anims.color, 9, fonts.pixel9, true)
        end
    end
end

visuals.indicators.Render_Shadow = function(start_pos, endpos, color)
    Render.GradientBoxFilled(start_pos, Vector2.new(start_pos.x + ((endpos.x - start_pos.x) / 2), endpos.y), Color.RGBA(0.0, 0.0, 0.0, 0.0), color, Color.RGBA(0.0, 0.0, 0.0, 0.0), color)
    Render.GradientBoxFilled(Vector2.new(start_pos.x + ((endpos.x - start_pos.x) / 2), start_pos.y), endpos, color, Color.RGBA(0.0, 0.0, 0.0, 0.0), color, Color.RGBA(0.0, 0.0, 0.0, 0.0))
end

visuals.indicators.Render_Indicator = function(i, col, cur)
    local position = Vector2.new(20, (screen_size.y / 1.55) + (39 * cur))

    visuals.indicators.Render_Shadow(Vector2.new(position.x - 10, position.y - 7), Vector2.new(position.x + 22, position.y + 26), Color.new(0, 0, 0, 0.21 * col.a))

    Render.Image(image[i], Vector2.new(20, ((screen_size.y / 1.55) + (39 * cur))-3), Vector2.new(25, 25), col)
    --Render.Text(text, positionS, Color.new(0.13, 0.13, 0.13, 0.49 * col.a), 24, fonts.calibrib24)
    --Render.Text(text, position, col, 24, fonts.calibrib24)
end

visuals.indicators.indicator2 = function()
    if not EngineClient.IsConnected() or not EntityList.GetLocalPlayer():IsAlive() or EntityList.GetLocalPlayer() == nil then
        return
    end
    local cur_dmg = refs.minimum_damage:GetInt()
    if cur_dmg > 100 then cur_dmg = '+'..cur_dmg-100 end
    local isDmg = false
    local isPing = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        bind = binds[i]
        if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
            isDmg = true
        end
        if bind:GetName() == 'Fake Ping' and bind:IsActive() then
            isPing = true
        end
    end
    local anims2 = {
        indicators_stylel = animations.anim_new('ui.visuals:Get(4)', ui.visuals:Get(4) and 1 or 0)
    }

    if anims2.indicators_stylel >= 0.01 then
        local current_pos = 1
        --if ui.additional_ind:GetBool(1) then
        --    indicators.Render_Indicator(tostring(cur_dmg), Color.RGBA(213, 213, 214, 255 * indicators_style4), current_pos); current_pos = current_pos - 1;
        --else
        --    if isDmg then
        --        indicators.Render_Indicator('Damage: '..tostring(cur_dmg), Color.RGBA(213, 213, 214, 255 * indicators_style4), current_pos); current_pos = current_pos - 1;
        --    end
        --end
        local colors = Color.new(.51, .76, .07)
        for k, v in pairs(ragebot.player_info_prev) do
            if k ~= nil then
                if v[3] then
                    colors = Color.new(.98, .87, .11)
                    break
                end
            end
        end
        local s_indicators =
        {
            {
                img = 3,
                color = Exploits.GetCharge() == 1 and Color.new(.83, .83, .83) or Color.new(1, 0, 0),
                bool = refs.double_tap:Get(),
            },
            {
                img = 4,
                color = Color.new(.51, .76, .07),
                bool = refs.hide_shots:Get()
            },
            {
                img = 9,
                color = Color.new(.83, .83, .83),
                bool = isDmg
            },
            {
                img = 1,
                color = Color.new(.83, .83, .83),
                bool = refs.safe_points:Get() == 2
            },
            {
                img = 6,
                color = Color.new(.83, .83, .83),
                bool = refs.body_aim:Get() == 2
            },
            {
                img = 2,
                color = Color.new(.51, .76, .07),
                bool = isPing
            },
            {
                img = 5,
                color = EntityList.GetLocalPlayer():GetVelocity() > 260 and Color.new(.51, .76, .07) or Color.new(1, 0, 0),
                bool = bit.band(EntityList.GetLocalPlayer():GetProp('m_fFlags'), bit.lshift(1,0)) == 0
            },
            {
                img = 7,
                color = Color.new(.83, .83, .83),
                bool = refs.fakeduck:Get()
            },
            {
               
                img = 8,
                color = colors,
                bool = ui.dormant_aimbot:Get()
            }
        }
        --visuals.indicators.Render_Indicator('DUCK', Color.new(.83, .83, .83), current_pos); current_pos = current_pos - 1;
        for idx, value in pairs(s_indicators) do
            --local width = Render.CalcTextSize(v.text, 9, fonts.pixel9)
            anims2.alpha2 = animations.anim_new(('alpha2 %s'):format(idx), value.bool and 1 or 0)
            anims2.color2 = animations.anim_new(('color2 %s'):format(idx), Color.new(value.color.r, value.color.g, value.color.b, anims2.alpha2*anims2.indicators_stylel))

            if anims2.alpha2 > 0.01 then
                --Render.Text(v.text, Vector2.new(screen_size.x/2-width.x/2 + 3 + anims.add_x, screen_size.y/2+add_y), anims.color, 9, fonts.pixel9, true)
                --visuals.indicators.Render_Indicator(tostring(cur_dmg), Color.RGBA(213, 213, 214, 255 * indicators_style4), current_pos); current_pos = current_pos - 1;
                visuals.indicators.Render_Indicator(value.img, anims2.color2, current_pos); current_pos = current_pos - 1;
            end
        end
    end
end

--visuals.indicators.velocity_warning_image = Render.LoadImage(visuals.indicators.velocity_warning_image_bytes, Vector2.new(700/3, 200/3))

ui.visuals:RegisterCallback(function(val)
    if not ui.visuals:Get(5) then
        CVar.FindVar('fov_cs_debug'):SetInt(0);
    end
end)

visuals.indicators.viewmodel_in_scope = function()
    if not ui.visuals:Get(5) then return end
    if EntityList.GetLocalPlayer() == nil then return end
    local m_bIsScoped = EntityList.GetLocalPlayer():GetProp('m_bIsScoped')
    if m_bIsScoped then
        CVar.FindVar('fov_cs_debug'):SetInt(90);
    else
        CVar.FindVar('fov_cs_debug'):SetInt(0);
    end
end

visuals.indicators.custom_scope = function()
    if not ui.visuals:Get(6) then return end
    refs.remove_scope:SetInt(2)
    local_player = EntityList.GetLocalPlayer()
    if local_player == nil or not local_player:IsAlive() then return end

    local anim_num = (not ui.anim_scope:Get() and (animations.anim_new('custom scope anim', local_player:GetProp('m_bIsScoped') and 1 or 0)) or (local_player:GetProp('m_bIsScoped') and 1 or 0))

    local scope_gap1 = ui.scope_gap:GetInt() * anim_num
    local scope_size1 = ui.scope_size:GetInt() * anim_num
    local scope_color_1 = ui.scope_color:Get()
    local scope_color_2 = ui.scope_color1:Get()
    local width = 1

    scope_color_1.a = scope_color_1.a * anim_num
    scope_color_2.a = scope_color_2.a * anim_num
   

    local start_x = screen_size.x / 2
    local start_y = screen_size.y / 2

    --Left
    Render.GradientBoxFilled(Vector2.new(start_x - scope_gap1, start_y), Vector2.new(start_x - scope_size1, start_y + width), scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

    --Right
    Render.GradientBoxFilled(Vector2.new(start_x + scope_gap1, start_y), Vector2.new(start_x + scope_size1, start_y + width), scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

    --Up
    Render.GradientBoxFilled(Vector2.new(start_x, start_y + scope_gap1), Vector2.new(start_x + width, start_y + scope_size1), scope_color_1, scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))

    --Down
    Render.GradientBoxFilled(Vector2.new(start_x, start_y - scope_gap1), Vector2.new(start_x + width, start_y - scope_size1), scope_color_1, scope_color_1, Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a), Color.new(scope_color_1.r, scope_color_1.g, scope_color_1.b, scope_color_2.a))
end

visuals.indicators.auto_peek_pos = function()
    if ui.visuals:GetBool(7) and refs.auto_peek:Get() then
        if autopeek_pos == nil then
            autopeek_pos = EntityList.GetLocalPlayer():GetProp('m_vecOrigin')
        end
    else
        autopeek_pos = nil
    end
end

visuals.indicators.auto_peek = function()
    if ui.visuals:GetBool(7) then
        peek_alpha = animations.anim_new('alpha peek', refs.auto_peek:Get() and 1 or 0)
        if peek_alpha > 0.01 and autopeek_pos ~= nil then
            --Render.Circle3DFilled(autopeek_pos, 32, 17, Color.new(.4, .4, .4, .6), false)
            Render.Circle3D(autopeek_pos, 32, 17, Color.new(ui.auto_peek:GetColor().r, ui.auto_peek:GetColor().g, ui.auto_peek:GetColor().b, ui.auto_peek:GetColor().a*peek_alpha), true)
            Render.Circle3D(autopeek_pos, 32, 17.2, Color.new(ui.auto_peek:GetColor().r, ui.auto_peek:GetColor().g, ui.auto_peek:GetColor().b, ui.auto_peek:GetColor().a*peek_alpha), true)
        end
    end
end


visuals.indicators.hitmarkers = {timer = 0, alpha = 0}
visuals.indicators.registered_shot = function(shot)
    if ui.visuals:Get(10) then
        local local_player = EntityList.GetLocalPlayer()
        if local_player == nil then return end

        if EngineClient.IsConnected() and local_player:IsAlive() then
            if shot.reason == 0 then
                table.insert(visuals.indicators.hitmarkers, {timer = GlobalVars.realtime, alpha = 0})
            end
        end
    end
end

visuals.indicators.crosshair_hitmarker = function()
    if ui.visuals:Get(10) then
        local local_player = EntityList.GetLocalPlayer()
        if local_player == nil then return end

        if EngineClient.IsConnected() and local_player:IsAlive() then
            for i, info in ipairs(visuals.indicators.hitmarkers) do
                info.alpha = helpers.lerp(GlobalVars.frametime * 8, info.alpha, info.timer + 0.5 < GlobalVars.realtime and 0 or 0.9)
                Render.Line(Vector2.new(screen_size.x / 2 - 5, screen_size.y / 2 - 5), Vector2.new(screen_size.x / 2 - 10, screen_size.y / 2 - 10), Color.new(ui.hitmarker_color:GetColor().r, ui.hitmarker_color:GetColor().g, ui.hitmarker_color:GetColor().b, info.alpha))
                Render.Line(Vector2.new(screen_size.x / 2 + 5, screen_size.y / 2 - 5), Vector2.new(screen_size.x / 2 + 10, screen_size.y / 2 - 10), Color.new(ui.hitmarker_color:GetColor().r, ui.hitmarker_color:GetColor().g, ui.hitmarker_color:GetColor().b, info.alpha))
             
                Render.Line(Vector2.new(screen_size.x / 2 + 5, screen_size.y / 2 + 5), Vector2.new(screen_size.x / 2 + 10, screen_size.y / 2 + 10), Color.new(ui.hitmarker_color:GetColor().r, ui.hitmarker_color:GetColor().g, ui.hitmarker_color:GetColor().b, info.alpha))
                Render.Line(Vector2.new(screen_size.x / 2 - 5, screen_size.y / 2 + 5), Vector2.new(screen_size.x / 2 - 10, screen_size.y / 2 + 10), Color.new(ui.hitmarker_color:GetColor().r, ui.hitmarker_color:GetColor().g, ui.hitmarker_color:GetColor().b, info.alpha))

                if info.timer + 1.5 < GlobalVars.realtime then table.remove(visuals.indicators.hitmarkers, i) end
            end
        end
    end
end

visuals.indicators.dmg_marker = {}
visuals.indicators.damage_marker = function()
    local damagemind = animations.anim_new('damage indicator', ui.visuals:Get(11) and 1 or 0)

    if damagemind <= 0.01 then return end
    if EntityList.GetLocalPlayer() == nil then return end
    for i, mark in ipairs(visuals.indicators.dmg_marker) do
        mark.pos.z = mark.pos.z + 50 * GlobalVars.frametime
        pos = Render.WorldToScreen(mark.pos)
        mark.size = mark.size - GlobalVars.frametime * 55
        Render.Text('-' .. mark.damage, Vector2.new(pos.x, pos.y), mark.is_lethal and Color.new(ui.dmg_marker_color:GetColor().r, ui.dmg_marker_color:GetColor().g, ui.dmg_marker_color:GetColor().b, 0.05 * mark.size * damagemind) or Color.new(.4, .4, .4, 0.05 * mark.size * damagemind), 9, fonts.pixel9, true, true)

        if mark.time + 3 < GlobalVars.realtime or mark.size < 0 then
            table.remove(visuals.indicators.dmg_marker, i)
        end
    end
end

visuals.indicators.damage_marker_event = function(e)
    if e:GetName() ~= 'player_hurt' then return end
    if e:GetInt('attacker') == nil then return end
    if e:GetInt('userid') == nil then return end
    if EntityList.GetPlayerForUserID(e:GetInt('attacker')) == EntityList.GetLocalPlayer() then
        table.insert(visuals.indicators.dmg_marker, {size = 120, pos = EntityList.GetPlayerForUserID(e:GetInt('userid')):GetHitboxCenter(e:GetInt('hitgroup')), damage = e:GetInt('dmg_health'), is_lethal = (e:GetInt('health') < 1), time = GlobalVars.realtime})
    end
end

visuals.indicators.round_prestart = function(e)
    if e:GetName() ~= "round_prestart" then return end
    visuals.indicators.hitmarkers = {}
    visuals.indicators.dmg_marker = {}
end

visuals.indicators.self_connected = function(e)
    if e:GetName() ~= "player_connect_full" then return end
    visuals.indicators.hitmarkers = {}
    visuals.indicators.dmg_marker = {}
end

dragging_k = helpers.dragging_fn('Keybinds', math.floor(screen_size.x - screen_size.x * CVar.FindVar('safezonex'):GetFloat() / 1.385), math.floor(screen_size.y * CVar.FindVar('safezoney'):GetFloat() / 2.5))
getbinds = function() binds = {} cheatbinds = Cheat.GetBinds() for i = 1, #cheatbinds do table.insert(binds, 1, cheatbinds[i]) end return binds end
local data_k = {
    [''] = {alpha_k = 0}
}
width_k = 0
alpha_k = 0
width_ka = 0
visuals.indicators.hotkey_list = function()
    local hotkey_list_alpha = animations.anim_new('hotkey_list alpha', ui.visuals:Get(2) and 1 or 0)
    local max_width = 0
    local frametime = 14 * GlobalVars.frametime
    local add_y = 0
    local total_width = 66
    local x, y = dragging_k:get()
    x,y=math.floor(x), math.floor(y)
    local active_binds = {}
    local bind = getbinds()
    for i = 1, #bind do
        local binds = bind[i]
        local bind_name = binds:GetName():lower():gsub("^%l", string.upper)
   
        local bind_state = binds:GetValue():lower()
        bind_state = binds:GetMode()
        if bind_state == 0 then bind_state = 'toggled' elseif bind_state == 1 then bind_state = 'holding' end
        if data_k[bind_name] == nil then
            data_k[bind_name] = {alpha_k = 0}
        end
        data_k[bind_name].alpha_k = animations.math_lerp(data_k[bind_name].alpha_k, binds:IsActive() and 1 or 0, frametime)
        local bind_state_size = Render.CalcTextSize(bind_state, 9, fonts.pixel9)
        local bind_name_size = Render.CalcTextSize(bind_name, 9, fonts.pixel9)
   
        Render.Text(bind_name, Vector2.new(x+2+1, y + 22 + add_y), Color.new(.8, .8, .8, data_k[bind_name].alpha_k*hotkey_list_alpha), 9, fonts.pixel9, true)
        Render.Text('['..bind_state..']', Vector2.new(x-1+2 + (width_ka - bind_state_size.x - 9), y + 22 + add_y), Color.new(.8, .8, .8, data_k[bind_name].alpha_k*hotkey_list_alpha), 9, fonts.pixel9, true)
   
        add_y = add_y + 13 * data_k[bind_name].alpha_k
   
        width_k = bind_state_size.x + bind_name_size.x + 18
        if width_k > 119 then
            if width_k > max_width then
                max_width = width_k
            end
        end
        if binds:IsActive() then
            table.insert(active_binds, binds)
        end
    end
    alpha_k = animations.math_lerp(alpha_k, (Cheat.IsMenuVisible() or #active_binds > 0) and 1 or 0, frametime)
    width_ka = animations.math_lerp(width_ka, math.max(max_width, 119), frametime)
    if (alpha_k > 0 or Cheat.IsMenuVisible()) and EngineClient.IsConnected() then
        Render.BoxFilled(Vector2.new(x, y), Vector2.new(x+width_ka, y+19), Color.RGBA(9, 9, 10, math.floor(alpha_k*200*hotkey_list_alpha)))
        Render.Box(Vector2.new(x, y), Vector2.new(x+width_ka, y+19), Color.RGBA(9, 9, 10, math.floor(alpha_k*255*hotkey_list_alpha)))
        Render.Text('keybinds', Vector2.new(x+1+width_ka / 2 - Render.CalcTextSize('keybinds', 9, fonts.pixel9).x/2, y+5), Color.new(ui.keybinds_color:GetColor().r, ui.keybinds_color:GetColor().g, ui.keybinds_color:GetColor().b, alpha_k*hotkey_list_alpha), 9, fonts.pixel9, true)
    end
    dragging_k:drag(width_ka, 18)
end

local spectating_players = function(player)
    local buffer = { }

    local players = EntityList.GetEntitiesByName('CCSPlayer')
    for tbl_idx, player_pointer in pairs(players) do
        if player_pointer:GetPlayer():EntIndex() ~= player:EntIndex() then
            if not player_pointer:GetPlayer():IsAlive() and not player_pointer:IsDormant() then
                local spectatingMode = player_pointer:GetPlayer():GetProp('m_iObserverMode')
                local spectatingPlayer = player_pointer:GetPlayer():GetProp('m_hObserverTarget')

                if spectatingPlayer then
                    if spectatingMode >= 4 or spectatingMode <= 5 then
                        local spectatingEntity = EntityList.GetClientEntityFromHandle(spectatingPlayer)
                        if spectatingEntity ~= nil and spectatingEntity:EntIndex() == player:EntIndex() then
                            local player_info = player_pointer:GetPlayer():GetPlayerInfo()

                            table.insert(buffer, 1, {
                                ['name'] = player_pointer:GetPlayer():GetName()
                            })
                        end
                    end
                end
            end
        end
    end
    return buffer
end

local get_spectating_players = function()
    if not EngineClient.IsConnected() or EngineClient.GetLocalPlayer() == nil or EntityList.GetLocalPlayer() == nil then return end
    local local_player = EntityList.GetLocalPlayer()
    if local_player:IsAlive() then
        return spectating_players(local_player:GetPlayer())
    else
        local m_hObserverTarget = local_player:GetProp('m_hObserverTarget')
        if m_hObserverTarget then
            local targetEntity = EntityList.GetClientEntityFromHandle(m_hObserverTarget)
            if targetEntity ~= nil then
                if targetEntity:IsPlayer() then
                    return spectating_players(targetEntity:GetPlayer())
                end
            end
        end
    end
end

visuals.indicators.spectator_list = function()
    if not ui.visuals:Get(12) then return end
    local get_spectators = get_spectating_players()
    if get_spectators == nil then return end
    for i = 1, #get_spectators do
        v = get_spectators[i]
        Render.Text(v.name, Vector2.new(screen_size.x-Render.CalcTextSize(v.name, 9, fonts.pixel9).x-2,-10+12*i), Color.new(1, 1, 1, 1), 9, fonts.pixel9, true)
    end
end

visuals.indicators.damage_indicator = function()
    local isDmg = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        local bind = binds[i]
        if bind:GetName() == 'Minimum Damage' and bind:IsActive() then
            isDmg = true
        end
    end
    local screendmgind = animations.anim_new("screen damage indicator", ui.visuals:Get(13) and 1 or 0)
    local cur_dmg = Menu.FindVar('Aimbot', 'Ragebot', 'Accuracy', 'Minimum Damage'):GetInt()
    if cur_dmg == 0 then cur_dmg = 'auto' elseif cur_dmg > 100 then cur_dmg = '+'..cur_dmg-100 end
    if ui.dmg_ind_style:Get() == 0 then
        Render.Text(tostring(cur_dmg), Vector2.new(screen_size.x/2+10, screen_size.y/2+10), Color.new(ui.dmg_ind_color:GetColor().r, ui.dmg_ind_color:GetColor().g, ui.dmg_ind_color:GetColor().b, screendmgind), 9, fonts.pixel9, true)
    else
        Render.Text((isDmg and '1' or '0'), Vector2.new(screen_size.x/2-15, screen_size.y/2-25), Color.new(ui.dmg_ind_color:GetColor().r, ui.dmg_ind_color:GetColor().g, ui.dmg_ind_color:GetColor().b, screendmgind), 9, fonts.pixel9, true)
        Render.Text(tostring(cur_dmg), Vector2.new(screen_size.x/2+10, screen_size.y/2-25), Color.new(ui.dmg_ind_color:GetColor().r, ui.dmg_ind_color:GetColor().g, ui.dmg_ind_color:GetColor().b, screendmgind), 9, fonts.pixel9, true)
    end
end

visuals.indicators.ideal_tick = function()
    if not ui.visuals:Get(8) then return end
    local charge = Exploits.GetCharge()
    local charge_x = charge * 100
    local charge_comp = math.floor(charge_x)
    local AIPeek = false
    local binds = Cheat.GetBinds()
    for i = 1, #binds do
        bind = binds[i]
        if bind:GetName() == 'Peek bot key' and bind:IsActive() then
            AIPeek = true
        end
    end

    if (refs.auto_peek:Get() or AIPeek) and refs.double_tap:Get() then
        local color = Exploits.GetCharge() == 1 and Color.new(.83, .83, .83) or Color.new(1, 0, 0)
        color_it = animations.anim_new('ideal tick color', Color.new(color.r, color.g, color.b, 1))

        local text_size = Render.CalcTextSize("+/-CHARGED IDEAL TICK (" .. charge_comp .. "%)", 9, fonts.pixel9)
        Render.Text("+/-CHARGED IDEAL TICK (" .. charge_comp .. "%)", Vector2.new(screen_size.x / 2 - text_size.x / 2, screen_size.y / 2 - 40), color_it, 9, fonts.pixel9, true)
    end
end

visuals.indicators.dragginvm = helpers.dragging_fn('Velocity Modifier', screen_size.x / 2 - 82, screen_size.y / 2 - 200)

visuals.indicators.rgb_health_based = function(percentage)
    local r = 124*2 - 124 * percentage
    local g = 195 * percentage
    local b = 13
    return r, g, b
end

visuals.indicators.a_width = 0
visuals.indicators.modifier_vel = 0
visuals.indicators.velocity_warning = Render.LoadImageFromFile('nl\\melancholia\\velocity_warning.png', Vector2.new(75, 61))
visuals.indicators.velocity_modifier = function()
    local velind = animations.anim_new('velocity indicator', ui.visuals:Get(9) and 1 or 0)
    if velind <= 0.01 then return end
    local me = EntityList.GetLocalPlayer()
    if not me then return end
    if not me:IsAlive() then return end
    if Cheat.IsMenuVisible() then
        modifier_vel = .5
        if not ui.visuals:Get(9) then modifier_vel = 1 end
        vel_show_off = true
    else
        modifier_vel = me:GetProp('m_flVelocityModifier')
        vel_show_off = false
    end

    visuals.indicators.modifier_vel = animations.math_lerp(visuals.indicators.modifier_vel, modifier_vel, GlobalVars.frametime * 8)
   
    local text_vel = string.format('Slowed down %.0f%%', math.floor(visuals.indicators.modifier_vel*100))

    local text_width_vel = 95--Render.CalcTextSize(text_vel, 7, tahoma_bold13).x

    visuals.indicators.a_width = animations.math_lerp(visuals.indicators.a_width, math.floor((text_width_vel - 2) * modifier_vel), GlobalVars.frametime * 8)

    local xv, yv = visuals.indicators.dragginvm:get()
    local r, g, b = visuals.indicators.rgb_health_based(visuals.indicators.modifier_vel)
    local velind1 = animations.anim_new('visuals.indicators.modifier_vel == 1', visuals.indicators.modifier_vel == 1 and 0 or 1)
    if not vel_show_off and visuals.indicators.modifier_vel == 1.00 and velind1 <= 0.01 then return end
    --Render.Image(visuals.indicators.velocity_warning, Vector2.new(xv+90-55, yv-50+50), Vector2.new(75, 61), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, velind*velind1))
    Render.Image(visuals.indicators.velocity_warning, Vector2.new(xv+90-73, yv-50+40), Vector2.new(75, 61), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, velind*velind1))
   
    Render.BoxFilled(Vector2.new(xv, yv+14+32), Vector2.new(xv+165-55, yv+31+32), Color.RGBA(16, 16, 16, math.floor(255*velind*velind1)), 6)
    Render.BoxFilled(Vector2.new(xv, yv+15+32), Vector2.new(xv+65-55+(visuals.indicators.a_width + 6), yv+30+32), Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, velind*velind1), 6)
    Render.Box(Vector2.new(xv, yv+14+32), Vector2.new(xv+165-55, yv+31+32), Color.RGBA(0, 0, 0, math.floor(255*velind*velind1)), 6)

    Render.Text(text_vel, Vector2.new(xv+15, yv+19+32), Color.RGBA(255, 255, 255, math.floor(255*velind*velind1)), 9, fonts.pixel9, true)

    visuals.indicators.dragginvm:drag(110, 65)

    if Cheat.IsMenuVisible() then
        Render.Box(Vector2.new(xv, yv), Vector2.new(xv+110, yv+65), Color.new(1, 1, 1, velind))
    end
end

visuals.indicators.rendering = false
visuals.indicators.render_start = function()
    if not ui.visuals:Get() then
        return
    end

    if not EngineClient.IsInGame() then
        return
    end
   
    if not EntityList.GetLocalPlayer() or not EntityList.GetLocalPlayer():IsAlive() then
        return
    end

    visuals.indicators.rendering = true
end

visuals.indicators.render_end = function()
    animations.anim_upd()
    visuals.indicators.rendering = false
end
-- @endregion

-- @region: miscellaneous
ffi_handler.ENTITY_LIST_POINTER = ffi.cast('void***', Utils.CreateInterface('client.dll', 'VClientEntityList003')) or error('Failed to find VClientEntityList003!')
ffi_handler.GET_CLIENT_ENTITY_FN = ffi.cast('uintptr_t (__thiscall*)(void*, int)', ffi_handler.ENTITY_LIST_POINTER[0][3])

ffi_handler.get_entity_address = function(entity_index)
    local addr = ffi_handler.GET_CLIENT_ENTITY_FN(ffi_handler.ENTITY_LIST_POINTER, entity_index)
    return addr
end

ffi_handler.hook = {hooks = {}}
ffi_handler.hook.new = function(cast, callback, hook_addr, size, trampoline, org_bytes_tramp)
    if ui.prediction_error_fix:Get() then                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          end --Завтра сделаю
        local size = size or 5
        local trampoline = trampoline or false
        local new_hook, mt = {}, {}
        local detour_addr = tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, callback))))
        local void_addr = ffi.cast('void*', hook_addr)
        local old_prot = ffi.new('unsigned long[1]')
        local org_bytes = ffi.new('uint8_t[?]', size)
        ffi.copy(org_bytes, void_addr, size)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       if trampoline then
        local alloc_addr = ffi.gc(ffi.C.VirtualAlloc(nil, size + 5, 0x1000, 0x40), function(addr) ffi.C.VirtualFree(addr, 0, 0x8000) end)
        local trampoline_bytes = ffi.new('uint8_t[?]', size + 5, 0x90)
        if org_bytes_tramp then
            local bytes = {}
            for byte in org_bytes_tramp:gmatch('(%x%x)') do
                table.insert(bytes, tonumber(byte, 16))
            end
            trampoline_bytes = ffi.new('uint8_t[?]', size + 5, bytes)
        else
            ffi.copy(trampoline_bytes, org_bytes, size)
        end
        trampoline_bytes[size] = 0xE9
        ffi.cast('uint32_t*', trampoline_bytes + size + 1)[0] = hook_addr - tonumber(ffi.cast('intptr_t', ffi.cast('void*', ffi.cast(cast, alloc_addr)))) - size
        ffi.copy(alloc_addr, trampoline_bytes, size + 5)
        new_hook.call = ffi.cast(cast, alloc_addr)
        mt = {__call = function(self, ...)
            return self.call(...)
        end}
    else
        new_hook.call = ffi.cast(cast, hook_addr)
        mt = {__call = function(self, ...)
            self.stop()
            local res = self.call(...)
            self.start()
            return res
        end}
    end
    local hook_bytes = ffi.new('uint8_t[?]', size, 0x90)
    hook_bytes[0] = 0xE9
    ffi.cast('uint32_t*', hook_bytes + 1)[0] = detour_addr - hook_addr - 5
    new_hook.status = false
    local function set_status(bool)
        new_hook.status = bool
        ffi.C.VirtualProtect(void_addr, size, 0x40, old_prot)
        ffi.copy(void_addr, bool and hook_bytes or org_bytes, size)
        ffi.C.VirtualProtect(void_addr, size, old_prot[0], old_prot)
    end
    new_hook.stop = function() set_status(false) end
    new_hook.start = function() set_status(true) end
    new_hook.start()

    table.insert(ffi_handler.hook.hooks, new_hook)
    return setmetatable(new_hook, mt)
end

miscellaneous.is_jumping = false
miscellaneous.ground_ticks, miscellaneous.end_time = 1, 0
miscellaneous.updateCSA_hk = function(thisptr, edx)
    local localplayer = EntityList.GetClientEntity(EngineClient.GetLocalPlayer())
    if localplayer == nil then return miscellaneous.updateCSA_fn(thisptr, edx) end
    local lp_ptr = ffi_handler.get_entity_address(EngineClient.GetLocalPlayer())
    if ui.ideal_anim_breaker:Get() == 0 then miscellaneous.updateCSA_fn(thisptr, edx) return end
    if ui.ideal_anim_breaker:Get(1) then
        ffi.cast('float*', lp_ptr+10104)[6] = 1
    end

    if ui.ideal_anim_breaker:Get(2) then
        ffi.cast('float*', lp_ptr+10104)[0] = 1
    end

    if ui.ideal_anim_breaker:Get(3) then
        ffi.cast('float*', lp_ptr+10104)[12] = 0
    end

    miscellaneous.updateCSA_fn(thisptr, edx)

    if ui.ideal_anim_breaker:Get(1) then
        ffi.cast('float*' , lp_ptr+10104)[6] = 1
    end

    if ui.ideal_anim_breaker:Get(3) then
        if bit.band(EntityList.GetLocalPlayer():GetProp('m_fFlags'), 1) == 1 then
            miscellaneous.ground_ticks = miscellaneous.ground_ticks + 1
        else
            miscellaneous.ground_ticks = 0
            miscellaneous.end_time = GlobalVars.curtime + 1
        end
        if not miscellaneous.is_jumping and miscellaneous.ground_ticks > 1 and miscellaneous.end_time > GlobalVars.curtime then
            ffi.cast('float*' , lp_ptr+10104)[12] = 0.5
        end
    end
end

helpers.cheat:RegisterCallback('destroy', function()
    for i, v in ipairs(ffi_handler.hook.hooks) do
        if v.status then
            v.stop()
        end
    end
end)
miscellaneous.updateCSA_fn = ffi_handler.hook.new('void(__fastcall*)(void*, void*)', miscellaneous.updateCSA_hk, ffi.cast('uintptr_t', Utils.PatternScan('client.dll', '8B F1 80 BE ? ? ? ? ? 74 36', -5))) or error("updateCSA_fn can't hook")

miscellaneous.set_movement = function(cmd, xz, yz, lp)
    local current_pos = lp:GetProp('m_vecOrigin')
    local yaw = EngineClient.GetViewAngles().yaw

    local vector_forward = {
        x = current_pos.x - xz,
        y = current_pos.y - yz,
    }

    local velocity = {
        x = -(vector_forward.x * math.cos(yaw / 180 * math.pi) + vector_forward.y * math.sin(
            yaw / 180 * math.pi)
        ),

        y = vector_forward.y * math.cos(yaw / 180 * math.pi) - vector_forward.x * math.sin(
            yaw / 180 * math.pi
        ),
    }

    cmd.forwardmove = velocity.x * 15
    cmd.sidemove = velocity.y * 15
end

miscellaneous.quick_peek = function(cmd)
    if not ui.quickpeek:Get() then return end
    local localplayer = EntityList.GetLocalPlayer()
    if localplayer == nil then return end
   
    if EngineClient.IsConnected() and localplayer:IsAlive() then
        local W = bit.band(cmd.buttons, 8) == 8
        local S = bit.band(cmd.buttons, 16) == 16
        local D = bit.band(cmd.buttons, 512) == 512
        local A = bit.band(cmd.buttons, 1024) == 1024
        local moving = W or S or D or A

        if not refs.auto_peek:GetBool() then
            cur_pos = localplayer:GetProp('m_vecOrigin')
        end

        local default_origin = localplayer:GetProp('m_vecOrigin')
        local is_in_air = bit.band(localplayer:GetProp('m_fFlags'), bit.lshift(1,0)) == 0

        if not is_in_air then
            if refs.auto_peek:GetBool() then
                if cur_pos ~= nil then
                    if not moving and cur_pos.x ~= default_origin.x and cur_pos.y ~= default_origin.y then
                        miscellaneous.set_movement(cmd, cur_pos.x, cur_pos.y, localplayer)
                    end
                end
            end
        end
    end
end

miscellaneous.hitgroup_names = { 'generic', 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
miscellaneous.missgroup_names = { 'head', 'chest', 'stomach', 'left arm', 'right arm', 'left leg', 'right leg', 'neck', '?', 'gear' }
miscellaneous.miss_reason = { 'unknown', 'spread', 'occlusion', 'prediction error' }
miscellaneous.num_format = function(b) local c=b%10;if c==1 and b~=11 then return b..'st'elseif c==2 and b~=12 then return b..'nd'elseif c==3 and b~=13 then return b..'rd'else return b..'th'end end

miscellaneous.hit_id = 0
miscellaneous.total_hits = 0
miscellaneous.ragebot_shot = function(shot)
    miscellaneous.total_hits = EntityList.GetLocalPlayer():GetProp('m_totalHitsOnServer')
    miscellaneous.miss_hitbox = miscellaneous.missgroup_names[shot.hitgroup] or '?'
end

miscellaneous.hitlog_shot = function(shot)
    miscellaneous.hit_id = miscellaneous.hit_id + 1
    local shot_id = miscellaneous.num_format((miscellaneous.hit_id % 15) + 1)
    local safety = refs.safe_points:Get()
    local name = string.lower(EntityList.GetClientEntity(shot.target_index):GetPlayer():GetName())
    if name == nil then return end
    if ui.hitlog:Get(2) then
        local hgroup = miscellaneous.hitgroup_names[shot.hitgroup + 1] or '?'
        local hit_chance = tostring(math.floor(shot.hitchance + 0.5))
        local m_iHealth = tostring(math.max(EntityList.GetClientEntity(shot.target_index):GetPlayer():GetProp('m_iHealth')-shot.damage, 0))
        local aimed_hgroup = miscellaneous.hitgroup_names[shot.wanted_hitgroup + 1] or '?'
        local miss_reason = miscellaneous.miss_reason[shot.reason]

        if shot.reason == 0 then
            text = string.format('hit %s bullet in %s\'s in %s for %d damage ( hitchance: %s%% | history(Δ): %d )',
            shot_id, name, hgroup, shot.damage, hit_chance, shot.backtrack)
            textc = string.format('hit %s bullet in %s\'s in %s for %d damage ( hitchance: %s | history(Δ): %d )',
            shot_id, name, hgroup, shot.damage, hit_chance .. '%%', shot.backtrack)
        elseif shot.reason == 1 then
            shot_reason = (shot.reason == 1 and miscellaneous.total_hits ~= EntityList.GetLocalPlayer():GetProp('m_totalHitsOnServer')) and 'damage rejection' or 'unknown'
            text = string.format('missed %s shot at %s\'s in %s(%s%%) due to %s ( dmg: %d | history(Δ): %d )',
            shot_id, name, miscellaneous.miss_hitbox, hit_chance, shot_reason, shot.wanted_damage, shot.backtrack)
        else
            text = string.format('missed %s shot at %s\'s in %s(%s%%) due to %s ( dmg: %d | history(Δ): %d )',
            shot_id, name, miscellaneous.miss_hitbox, hit_chance, miss_reason, shot.wanted_damage, shot.backtrack)
        end
        if shot.reason == 0 then
            ffi_handler.color_print(Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, 1), '[melancholia] ')
            ffi_handler.color_print(Color.RGBA(216, 216, 216, 255), textc .. '\n')
        else
            ffi_handler.color_print(Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, 1), '[melancholia] ')
            ffi_handler.color_print(Color.RGBA(216, 216, 216, 255), text .. '\n')
        end
    end
    if ui.hitlog:Get(1) then
        if shot.reason == 0 then
            table.insert(miscellaneous.stuff, {text2 = {
                name = '',
                hit = 'Hit ',
                who = name,
                in_the = ' in the ',
                where = miscellaneous.hitgroup_names[shot.hitgroup + 1] or '?',
                for_ = ' for ',
                how_much = shot.damage,
                damage = ' damage (',
                how_muc_r = tostring(math.max(EntityList.GetClientEntity(shot.target_index):GetPlayer():GetProp('m_iHealth')-shot.damage, 0)),
                health = ' health remaining)'
            }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
        else
            table.insert(miscellaneous.stuff,{text2 = {
                name = '',
                hit = 'Missed ',
                who = name,
                in_the = ' in the ',
                where = miscellaneous.miss_hitbox,
                for_ = ' due to ',
                how_much = miscellaneous.miss_reason[shot.reason],
                damage = '',
                how_muc_r = '',
                health = ''
            }, alpha = 0, alpha1 = 0, type = 'Miss', time = GlobalVars.realtime})
        end
    end
end

miscellaneous.hit_enemy = function(e)
    if e:GetName() ~= 'player_hurt' then return end
    local weapon = e:GetString('weapon', '');
    if weapon == 'hegrenade' or weapon == 'inferno' or weapon == 'knife' then
        if e:GetInt('userid') == nil then return end
        if e:GetInt('attacker') == nil then return end
        local attacker_id = EntityList.GetPlayerForUserID(e:GetInt('attacker'))
        if attacker_id == nil or attacker_id ~= EntityList.GetLocalPlayer() then
            return
        end
        local server_damage = e:GetInt('dmg_health')
       
        local hittype = 'Hit'
        if weapon == 'hegrenade' then
            hittype = 'naded';
        elseif weapon == 'inferno' then
            hittype = 'burned';
        elseif weapon == 'knife' then
            hittype = 'knifed';
        end
        local target_id = EntityList.GetPlayerForUserID(e:GetInt('userid'))
        if target_id == nil then return end
        local target_name = target_id:GetName()
        local health = target_id:GetProp('m_iHealth')-server_damage
        if health < 0 then health = 0 end
        local text = ('%s %s for %i damage (%i remaining)'):format(hittype, target_name, server_damage, health)
        if ui.hitlog:Get(2) then
            ffi_handler.color_print(Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, 1), '[melancholia] ')
            ffi_handler.color_print(Color.RGBA(216, 216, 216, 255), text .. '\n')
        end
        if ui.hitlog:Get(1) then
            table.insert(miscellaneous.stuff, {text2 = {
                name = '',
                hit = hittype..' ',
                who = target_name,
                in_the = ' for ',
                where = server_damage,
                for_ = ' damage (',
                how_much = health,
                damage = ' remaining)',
                how_muc_r = '',
                health = ''            
            }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
        end
    end
end

miscellaneous.render_string = function(x,y,cen,string,color,TYPE,font,fontsize) if TYPE == 0 then Render.Text(string, Vector2.new(x, y), color, fontsize, font, false, cen) elseif TYPE == 1 then --[[Render.Text(string, Vector2.new(x + 1, y + 1), Color.new(.05, .05, .05, color.a / 1.5), fontsize, font, false, cen) ]]Render.Text(string, Vector2.new(x, y), color, fontsize, font, true, cen) elseif TYPE == 2 then Render.Text(string, Vector2.new(x, y), color, fontsize, font, true, cen) end end
miscellaneous.hitlog_draw = function()
    --if ui.hitlog:Get(1) then
        local y_add = 0
        for i, notify in ipairs(miscellaneous.stuff) do
            local frametime = GlobalVars.frametime * 8

            if notify.time + 1 > GlobalVars.realtime then
                notify.alpha = animations.math_lerp(notify.alpha, 1, frametime)
                notify.alpha1 = animations.math_lerp(notify.alpha1, 1, frametime / 1.5)
            end

            local string = notify.text2.name .. notify.text2.hit .. notify.text2.who .. notify.text2.in_the .. notify.text2.where ..notify.text2.for_ .. notify.text2.how_much .. notify.text2.damage .. notify.text2.how_muc_r .. notify.text2.health

            local s = {
                string = Render.CalcTextSize(tostring(string), 9, fonts.pixel9).x / 2,
                name = Render.CalcTextSize(tostring(notify.text2.name), 9, fonts.pixel9).x,
                hit = Render.CalcTextSize(tostring(notify.text2.hit), 9, fonts.pixel9).x,
                in_the = Render.CalcTextSize(tostring(notify.text2.in_the), 9, fonts.pixel9).x,
                who = Render.CalcTextSize(tostring(notify.text2.who), 9, fonts.pixel9).x,
                where = Render.CalcTextSize(tostring(notify.text2.where), 9, fonts.pixel9).x,
                for_ = Render.CalcTextSize(tostring(notify.text2.for_), 9, fonts.pixel9).x,
                how_much = Render.CalcTextSize(tostring(notify.text2.how_much), 9, fonts.pixel9).x,
                damage = Render.CalcTextSize(tostring(notify.text2.damage), 9, fonts.pixel9).x,
                how_muc_r = Render.CalcTextSize(tostring(notify.text2.how_muc_r), 9, fonts.pixel9).x,
                health = Render.CalcTextSize(tostring(notify.text2.health), 9, fonts.pixel9).x
            }
       
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.name),notify.type == 'Hit' and Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, notify.alpha) or Color.new(204 / 255, 51 / 255, 51 / 255, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.hit),Color.new(1, 1, 1, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.who),notify.type == 'Hit' and Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, notify.alpha) or Color.new(204 / 255, 51 / 255, 51 / 255, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.who,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.in_the),Color.new(1, 1, 1, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.where),notify.type == 'Hit' and Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, notify.alpha) or Color.new(204 / 255, 51 / 255, 51 / 255, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who + s.where,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.for_),Color.new(1, 1, 1, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who + s.where + s.for_,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.how_much),notify.type == 'Hit' and Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, notify.alpha) or Color.new(204 / 255, 51 / 255, 51 / 255, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who + s.where + s.for_ +s.how_much,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.damage),Color.new(1, 1, 1, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who + s.where + s.for_ +s.how_much +s.damage,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.how_muc_r),notify.type == 'Hit' and Color.new(ui.accent_color:GetColor().r, ui.accent_color:GetColor().g, ui.accent_color:GetColor().b, notify.alpha) or Color.new(204 / 255, 51 / 255, 51 / 255, notify.alpha),1,fonts.pixel9, 9)
            miscellaneous.render_string(notify.alpha1 * 40 - 40 + screen_size.x / 2 - s.string + s.name + s.hit + s.in_the + s.who + s.where + s.for_ +s.how_much +s.damage +s.how_muc_r,screen_size.y * 81 / 100 - y_add,false,tostring(notify.text2.health),Color.new(1, 1, 1, notify.alpha),1,fonts.pixel9, 9)

            if notify.time + (5 - 0.1) < GlobalVars.realtime then
                notify.alpha1 = animations.math_lerp(notify.alpha1, 2, frametime / 1.5)
            end

            if notify.time + 5 < GlobalVars.realtime and notify.alpha1 > 1.5 then
                notify.alpha = animations.math_lerp(notify.alpha, 0, frametime)
            end

            if notify.alpha < 0.02 and (notify.time + 5 < GlobalVars.realtime) or #miscellaneous.stuff > 5 then
                table.remove(miscellaneous.stuff, i)
            end
            y_add = y_add + 12 * notify.alpha
        end
    --end
end
local current_phase = 0
miscellaneous.get_word = function(words)
    current_phase = current_phase + 1
    if current_phase > #words then
        current_phase = 1
    end
    return words[current_phase]:gsub('\'', '')
end

miscellaneous.trashtalk = function(e)
    if e:GetName() ~= 'player_death' then return end
    me = EntityList.GetLocalPlayer()
    victim = EntityList.GetPlayerForUserID(e:GetInt('userid'))
    attacker = EntityList.GetPlayerForUserID(e:GetInt('attacker'))
    if victim == attacker or attacker ~= me then return end
    EngineClient.ExecuteClientCmd('say ' .. miscellaneous.get_word(miscellaneous.phrases))
end

miscellaneous.set_clantag = ffi.cast('int(__fastcall*)(const char*, const char*)', Utils.PatternScan('engine.dll', '53 56 57 8B DA 8B F9 FF 15'))

miscellaneous.gamesense_anim = function(text, indices)
    if not EngineClient.IsConnected() then return end
    local text_anim = '               ' .. text .. '                      '
    local tickinterval = GlobalVars.interval_per_tick
    local tickcount = GlobalVars.tickcount + math.floor(EngineClient.GetNetChannelInfo():GetLatency(0)+0.22 / GlobalVars.interval_per_tick + 0.5)
    local i = tickcount / math.floor(0.3 / GlobalVars.interval_per_tick + 0.5)
    i = math.floor(i % #indices)
    i = indices[i+1]+1

    return string.sub(text_anim, i, i+15)
end

miscellaneous.enabled_prev = true

miscellaneous.set_clantag('\0', '\0')

miscellaneous.on_run_command = function()
    if ui.clan_tag:GetBool() then
        local local_player = EntityList.GetLocalPlayer()
        if local_player ~= nil and EngineClient.IsConnected() and ClientState.m_choked_commands == 0 then
            clan_tag = miscellaneous.gamesense_anim('melancholia', {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 11, 11, 11, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25})
            if EntityList.GetGameRules():GetProp('m_gamePhase') == 5 then
                clan_tag = miscellaneous.gamesense_anim('melancholia', {11})
                miscellaneous.set_clantag(clan_tag, clan_tag)
            elseif EntityList.GetGameRules():GetProp('m_timeUntilNextPhaseStarts') ~= 0 then
                clan_tag = miscellaneous.gamesense_anim('melancholia', {11})
                miscellaneous.set_clantag(clan_tag, clan_tag)
            elseif clan_tag ~= clan_tag_prev then
                miscellaneous.set_clantag(clan_tag, clan_tag)
            end
            clan_tag_prev = clan_tag
        end
        miscellaneous.enabled_prev = false
    elseif not ui.clan_tag:GetBool() and miscellaneous.enabled_prev == false then
        miscellaneous.set_clantag('\0', '\0')
        miscellaneous.enabled_prev = true
    end
end

miscellaneous.custom_hitsound = function(e)
    if e:GetName() ~= 'player_hurt' then return end
    if not ui.hitsound_custom:Get() then return end
    local me = EntityList.GetLocalPlayer()
    if me == nil then return end
    local attacker = EntityList.GetPlayerForUserID(e:GetInt('attacker'))
    if attacker == nil then return end
    if attacker ~= me then return end
    EngineClient.ExecuteClientCmd('playvol buttons/arena_switch_press_02.wav 1')
end

miscellaneous.mute_enemy = function()
    if ui.mute_enemy:Get() and ui.enemy_chat_viewer:Get() then
        CVar.FindVar('cl_mute_enemy_team'):SetInt(1)
    else
        CVar.FindVar('cl_mute_enemy_team'):SetInt(0)
    end
end
miscellaneous.mute_enemy()
ui.mute_enemy:RegisterCallback(function()
    miscellaneous.mute_enemy()
end)
ui.enemy_chat_viewer:RegisterCallback(function()
    miscellaneous.mute_enemy()
end)
miscellaneous.enemy_chat_viewer = function(e)
    if e:GetName() ~= 'player_say' then return end
    local userid = e:GetInt('userid')
    if userid == nil then return end
    if EntityList.GetPlayerForUserID(userid) == nil then return end
    if ui.enemy_chat_viewer:Get() then
        local event = {
            ENTITY = EntityList.GetPlayerForUserID(userid),
            STRING_TEXT = e:GetString('text'),
            TEAMNUM = EntityList.GetPlayerForUserID(userid):GetProp("m_iTeamNum"),
            LOCATION = EntityList.GetPlayerForUserID(userid):GetProp("m_szLastPlaceName"),
            STRING_NAME = EntityList.GetPlayerForUserID(userid):GetName(),
            ALIVE = EntityList.GetPlayerForUserID(userid):GetProp('m_iHealth') > 0,
        }
        if event.ENTITY:IsTeamMate() then return end
        ffi_handler.print_chat(' ● ' .. (event.TEAMNUM  == 2 and (event.ALIVE and '\x10(Terrorist) \x08' or ' \x10*DEAD* (Terrorist) \x08') or (event.ALIVE and '\x0B(Counter-Terrorist) \x08' or ' \x0B*DEAD* (Counter-Terrorist) \x08')) .. event.STRING_NAME .. ' @ ' .. event.LOCATION .. ' : ' .. event.STRING_TEXT)
    end
end
-- @endregion

-- @region: cfg system
cfg_system.cfg_data = {
    bools = {
        ui.dormant_aimbot,
        ui.ideal_tick,
        ui.prev_os,
        ui.auto_awp_sw,
        ui.override_1,
        ui.override_2,
        ui.override_3,
        ui.override_4,
        ui.override_5,
        ui.override_6,
        ui.anti_brute,
        ui.anti_brute_switch,
        ui.anim_scope,
        ui.quickpeek,
        ui.trash_talk,
        ui.mute_enemy,
        ui.clan_tag,
        ui.enemy_chat_viewer,
        ui.hitsound_custom
    },

    ints = {
        ui.dormant_aimbot_damage,
        ui.presets,
        ui.type,
        ui.manual_yaw_base,
        ui.anti_hit_helpers,
        ui.anti_brute_phase1,
        ui.anti_brute_phase2,
        ui.anti_brute_phase3,
        ui.anti_brute_phase4,
        ui.anti_brute_phase5,
        ui.anti_brute_phase6,
        ui.anti_brute_phase7,
        ui.anti_brute_phase8,
        ui.indicator_style,
        ui.anti_brute_phase9,
        ui.anti_brute_phase10,
        ui.phases,
        ui.ideal_anim_breaker,
        ui.visuals,
        ui.scope_size,
        ui.scope_gap,
        ui.dmg_ind_style,
        ui.hitlog,
        ui.custom_name,
        anitaim_condition[1].switch_ticks, anitaim_condition[2].switch_ticks, anitaim_condition[3].switch_ticks, anitaim_condition[4].switch_ticks, anitaim_condition[5].switch_ticks, anitaim_condition[6].switch_ticks, anitaim_condition[7].switch_ticks,
        anitaim_condition[1].jitter_value1, anitaim_condition[2].jitter_value1, anitaim_condition[3].jitter_value1, anitaim_condition[4].jitter_value1, anitaim_condition[5].jitter_value1, anitaim_condition[6].jitter_value1, anitaim_condition[7].jitter_value1,
        anitaim_condition[1].fake_type, anitaim_condition[2].fake_type, anitaim_condition[3].fake_type, anitaim_condition[4].fake_type, anitaim_condition[5].fake_type, anitaim_condition[6].fake_type, anitaim_condition[7].fake_type,
        anitaim_condition[1].yaw_mode, anitaim_condition[2].yaw_mode, anitaim_condition[3].yaw_mode, anitaim_condition[4].yaw_mode, anitaim_condition[5].yaw_mode, anitaim_condition[6].yaw_mode, anitaim_condition[7].yaw_mode,
        anitaim_condition[1].modifier_mode, anitaim_condition[2].modifier_mode, anitaim_condition[3].modifier_mode, anitaim_condition[4].modifier_mode, anitaim_condition[5].modifier_mode, anitaim_condition[6].modifier_mode, anitaim_condition[7].modifier_mode,
        anitaim_condition[1].yaw_add_l, anitaim_condition[2].yaw_add_l, anitaim_condition[3].yaw_add_l, anitaim_condition[4].yaw_add_l, anitaim_condition[5].yaw_add_l, anitaim_condition[6].yaw_add_l, anitaim_condition[7].yaw_add_l,
        anitaim_condition[1].yaw_add_r, anitaim_condition[2].yaw_add_r, anitaim_condition[3].yaw_add_r, anitaim_condition[4].yaw_add_r, anitaim_condition[5].yaw_add_r, anitaim_condition[6].yaw_add_r, anitaim_condition[7].yaw_add_r,
        anitaim_condition[1].jitter, anitaim_condition[2].jitter, anitaim_condition[3].jitter, anitaim_condition[4].jitter, anitaim_condition[5].jitter, anitaim_condition[6].jitter, anitaim_condition[7].jitter,
        anitaim_condition[1].jitter_value, anitaim_condition[2].jitter_value, anitaim_condition[3].jitter_value, anitaim_condition[4].jitter_value, anitaim_condition[5].jitter_value, anitaim_condition[6].jitter_value, anitaim_condition[7].jitter_value,
        anitaim_condition[1].left_desync_value, anitaim_condition[2].left_desync_value, anitaim_condition[3].left_desync_value, anitaim_condition[4].left_desync_value, anitaim_condition[5].left_desync_value, anitaim_condition[6].left_desync_value, anitaim_condition[7].left_desync_value,
        anitaim_condition[1].right_desync_value, anitaim_condition[2].right_desync_value, anitaim_condition[3].right_desync_value, anitaim_condition[4].right_desync_value, anitaim_condition[5].right_desync_value, anitaim_condition[6].right_desync_value, anitaim_condition[7].right_desync_value,
        anitaim_condition[1].fake_option, anitaim_condition[2].fake_option, anitaim_condition[3].fake_option, anitaim_condition[4].fake_option, anitaim_condition[5].fake_option, anitaim_condition[6].fake_option, anitaim_condition[7].fake_option,
        anitaim_condition[1].lby_mode, anitaim_condition[2].lby_mode, anitaim_condition[3].lby_mode, anitaim_condition[4].lby_mode, anitaim_condition[5].lby_mode, anitaim_condition[6].lby_mode, anitaim_condition[7].lby_mode,
        anitaim_condition[1].freestand_desync, anitaim_condition[2].freestand_desync, anitaim_condition[3].freestand_desync, anitaim_condition[4].freestand_desync, anitaim_condition[5].freestand_desync, anitaim_condition[6].freestand_desync, anitaim_condition[7].freestand_desync,
        anitaim_condition[1].desync_on_shot, anitaim_condition[2].desync_on_shot, anitaim_condition[3].desync_on_shot, anitaim_condition[4].desync_on_shot, anitaim_condition[5].desync_on_shot, anitaim_condition[6].desync_on_shot, anitaim_condition[7].desync_on_shot
    },

    floats = {
     
    },

    strings = {
        ui.name_input
    },

    colors = {
        ui.watermark_color,
        ui.watermark_info_color,
        ui.keybinds_color,
        ui.accent_color,
        ui.scope_color,
        ui.auto_peek,
        ui.hitmarker_color,
        ui.dmg_marker_color,
        ui.dmg_ind_color
    }
}

local de_en_coding = '4f3RQ1iA0oVFEtKl6jUvTeWyYBDcu8CNI5wMxbS2JrqOna9zgdXpsmPLZk7HGh+/'

cfg_system.encode = function(data)
    return ((data:gsub('.', function(x)
        local r,de_en_coding= '', x:byte()
        for i=8,1,-1 do r=r..(de_en_coding%2^i-de_en_coding%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 de_en_coding:sub(c+1,c+1)
    end)..({ '', '==', '=' })[#data%3+1])
end

cfg_system.decode = function(data)
    data = string.gsub(data, '[^'..de_en_coding..'=]', '')
    return (data:gsub('.', function(x)
        if (x == '=') then return '' end
        local r,f='',(de_en_coding: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

ui.export_cfg:RegisterCallback(function()
    local code = {{}, {}, {}, {}, {}}

    for _, bools in pairs(cfg_system.cfg_data.bools) do
        table.insert(code[1], bools:GetBool())
    end

    for _, ints in pairs(cfg_system.cfg_data.ints) do
        table.insert(code[2], ints:GetInt())
    end

    for _, floats in pairs(cfg_system.cfg_data.floats) do
        table.insert(code[3], floats:GetFloat())
    end

    for _, strings in pairs(cfg_system.cfg_data.strings) do
        table.insert(code[4], strings:GetString())
    end

    for _, colors in pairs(cfg_system.cfg_data.colors) do
        local clr = colors:GetColor()
        table.insert(code[5], string.format('%02X%02X%02X%02X', math.floor(clr.r * 255), math.floor(clr.g * 255), math.floor(clr.b * 255), math.floor(clr.a * 255)))
    end
   
    cfg_system.set_clipboard(cfg_system.encode(json.stringify(code)))
    table.insert(miscellaneous.stuff, {text2 = {
        name = '',
        hit = 'Config copied!',
        who = '',
        in_the = '',
        where = '',
        for_ = '',
        how_much = '',
        damage = '',
        how_muc_r = '',
        health = ''
    }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
end)

cfg_system.config_load = function(text)
    local decode_cfg = json.parse(cfg_system.decode(text))
    if decode_cfg == nil then
        table.insert(miscellaneous.stuff, {text2 = {
            name = '',
            hit = '',
            who = 'Failed to load config!',
            in_the = '',
            where = '',
            for_ = '',
            how_much = '',
            damage = '',
            how_muc_r = '',
            health = ''
        }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
    else
        for k, v in pairs(decode_cfg) do
            k = ({[1] = 'bools', [2] = 'ints', [3] = 'floats', [4] = 'strings', [5] = 'colors'})[k]

            for k2, v2 in pairs(v) do
                if (k == 'bools') then
                    cfg_system.cfg_data[k][k2]:SetBool(v2)
                end

                if (k == 'ints') then
                    cfg_system.cfg_data[k][k2]:SetInt(v2)
                end

                if (k == 'floats') then
                    cfg_system.cfg_data[k][k2]:SetFloat(v2)
                end

                if (k == 'strings') then
                    cfg_system.cfg_data[k][k2]:SetString(v2)
                end

                if (k == 'colors') then
                    cfg_system.cfg_data[k][k2]:SetColor(Color.new(tonumber('0x'..v2:sub(1, 2))/255, tonumber('0x'..v2:sub(3, 4))/255, tonumber('0x'..v2:sub(5, 6))/255, tonumber('0x'..v2:sub(7, 8))/255))
                end
            end
        end
        touch_callback.callback1()
        table.insert(miscellaneous.stuff, {text2 = {
            name = '',
            hit = 'Config loaded!',
            who = '',
            in_the = '',
            where = '',
            for_ = '',
            how_much = '',
            damage = '',
            how_muc_r = '',
            health = ''
        }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
    end
end

ui.import_cfg:RegisterCallback(function()
    cfg_system.config_load(cfg_system.get_clipboard())
end)

ui.default_cfg:RegisterCallback(function()
    cfg_system.config_load('CX0d0MrH0MQwK2jX8WTn0M0wK2jX8WTn0MEwK2jX8WTn0M6wKSB5cAtbF30m0MrSYWdpBUgwtw078AomBUgwtX07BS1nuPTn0MIwK2jX8WTn0MxwKSB5cAtbF30dE307BS1nuPTn0MQd0Mrsu2ebF30dEw07BS1nuPTn0MQp0MrSYWdpBUgwEv6wK2jX8WTn0MQm0Mrsu2ebF30dtw07BS1nuPTn0MQL0Mrsu2ebF30dK3078AomBUgwEvxwK2jX8WehF30X0MrH0MQwKMQn0M0wKMQn0MEwKM6n0M6wKMTn0MTwKM6LF30P0MJmK3gwtX07tR4n0MIwKM6LF30k0MJmK3gwEv4wKMTdF30dEU07tv6n0MQX0MJsEwgwEvEwKM4n0MQs0MJgF30dtU07E3gwEvYwKM4n0MQL0MJLF30dK307tXgwEvxwKMuLtMxn0M0g0MJmE3gwEMQwKMQgF30XEw07E3gwEMEwKMEn0M0s0MJgF30XtU07t3gwEMYwKM6n0M0L0MJsF30XK307t3gwEMxwKMQPF30pE307t3gwEpQwKM6n0MEX0MJgF30pEX07E3gwEp6wKM4n0MEm0MJgF30ptw07E3gwEpuwKM4n0MEZ0MJgF30pKU07E3gwtR4wKM4n0M6d0MJgF30sEw07E3gwtREwKM4n0M6s0MJgF30stU07E3gwtRYwKM4n0M6L0MJgF30sK307E3gwtRxwKM4n0MTg0MJgF30mEU07E3gwtv0wKM4n0MTp0MJgF30mt307E3gwtvTwKM4n0MTP0MJgF30mtX07E3gwtvIwKM4n0MTk0MJgF30PE307E3gwtMQwKM4n0MYX0MJaEv6n0MYp0MJgF30Pt307Fvxn0MYm0MJgF30Ptw07E3gwtMuwKMTn0MYZ0MJgF30PKU07KUgwtp4wKM4n0Mud0MJgF30LEw07E3gwtpEwKM4n0Mus0MJdF30LtU07E3gwtpYwKMQn0MuL0MJgF30LK307EUgwtpxwKM4n0MIg0MJgF30ZEU07tvQn0MIX0MJgF30ZEX07tRYn0MIs0MJgF30ZtU07tM4n0MIP0MJgF30ZtX07E3gwKRIwKM6mF30ZKU07E3gwKv4wKMYgF30kEU07E3gwKv0wKMTXF30kEX07E3gwKv6wKM4n0Mxm0MJsK3gwKvYwKM4n0MxL0MJPE3gwKvIwKM4n0Mxk0MJPE3gwEv4g0MJgF30dERQwKM4n0MQgEw07EwgwEv4p0MJgF30dER6wKM0n0MQgtU07E3gwEv4P0MJXF30dERuwKM4n0MQgK307E3gwEv4k0MJdF30dEv4wKM4n0MQdEU07EUgwEvQX0MJgF30dEvEwKM4n0MQdt307E3gwEvQm0MJgF30dEvYwKM4n0MQdtX07E3gwEvQZ0MJgF30dEvxwKM4n0MQXE307E3gwEv0d0MJgF30dEM0wKM4n0MQXEX07E3gwEv0s0MJgF30dEMTwKM4n0MQXtw07E3gwEv0L0MJgF30dEMIwKM4n0MQXKU07EAsn0MEwK2ahF30s0MrH0MQwKwoOBy1Z02sn0MTwK2nwEU070xQsKTeijxBi0wgwEw070MumtpeijxBi0wgwEX070MumtpeijxBi0wgwt3070x0m6MeijxBi0wgwtU070xBijxBijxBi0wgwtw070MxZKvbijxEZ0wgwtX070xBijxBijxBi0wgwK3070MumtpeijxBi0wgwKU070xBijxBijxBi02mh')
    table.insert(miscellaneous.stuff, {text2 = {
        name = '',
        hit = 'Config loaded!',
        who = '',
        in_the = '',
        where = '',
        for_ = '',
        how_much = '',
        damage = '',
        how_muc_r = '',
        health = ''
    }, alpha = 0, alpha1 = 0, type = 'Hit', time = GlobalVars.realtime})
end)
-- @endregion

-- @region: callbacks
helpers.cheat:RegisterCallback('prediction', ragebot.dormant_aim)
helpers.cheat:RegisterCallback('prediction', ragebot.ideal_tick)
helpers.cheat:RegisterCallback('prediction', miscellaneous.quick_peek)

helpers.cheat:RegisterCallback('prediction', antiaim.conditions)
helpers.cheat:RegisterCallback('prediction', antiaim.fakelag)
helpers.cheat:RegisterCallback('prediction', antiaim.avoid_backstab)
helpers.cheat:RegisterCallback('prediction', antiaim.shit_aa_on_warmup)
helpers.cheat:RegisterCallback('prediction', antiaim.better_hs)
helpers.cheat:RegisterCallback('prediction', antiaim.bombsite_e_fix)
helpers.cheat:RegisterCallback('events', anti_bruteforce.anti_bruteforcee)
helpers.cheat:RegisterCallback('createmove', anti_bruteforce.handle_brutforcetime)
helpers.cheat:RegisterCallback('events', anti_bruteforce.resetter)
helpers.cheat:RegisterCallback('destroy', function() CVar.FindVar("sv_maxusrcmdprocessticks"):SetInt(16) CVar.FindVar('cl_mute_enemy_team'):SetInt(0) end)

helpers.cheat:RegisterCallback('draw', visuals.indicators.render_start)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.watermark() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.indicator() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.indicator2() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.indicator3() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.custom_scope() end end)
helpers.cheat:RegisterCallback('createmove', visuals.indicators.viewmodel_in_scope)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.auto_peek() end end)
helpers.cheat:RegisterCallback('createmove', visuals.indicators.auto_peek_pos)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.ideal_tick() end end)
helpers.cheat:RegisterCallback('draw', visuals.indicators.spectator_list)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.damage_indicator() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.velocity_modifier() end end)
helpers.cheat:RegisterCallback('registered_shot', visuals.indicators.registered_shot)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.crosshair_hitmarker() end end)
helpers.cheat:RegisterCallback('events', visuals.indicators.self_connected)
helpers.cheat:RegisterCallback('events', visuals.indicators.round_prestart)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.hotkey_list() end end)
helpers.cheat:RegisterCallback('draw', function() if visuals.indicators.rendering then visuals.indicators.damage_marker() end end)
helpers.cheat:RegisterCallback('events', visuals.indicators.damage_marker_event)
helpers.cheat:RegisterCallback('draw', visuals.indicators.render_end)

helpers.cheat:RegisterCallback('createmove', function(cmd) miscellaneous.is_jumping = bit.band(cmd.buttons, bit.lshift(1, 1)) ~= 0 end)
helpers.cheat:RegisterCallback('ragebot_shot', miscellaneous.ragebot_shot)
helpers.cheat:RegisterCallback('registered_shot', miscellaneous.hitlog_shot)
helpers.cheat:RegisterCallback('events', miscellaneous.hit_enemy)
helpers.cheat:RegisterCallback('draw', miscellaneous.hitlog_draw)
helpers.cheat:RegisterCallback('events', function(e) if ui.trash_talk:Get() then miscellaneous.trashtalk(e) end end)
helpers.cheat:RegisterCallback('draw', miscellaneous.on_run_command)
helpers.cheat:RegisterCallback('draw', client.delay_call_f)
helpers.cheat:RegisterCallback('destroy', function() miscellaneous.set_clantag('\0', '\0') end)
helpers.cheat:RegisterCallback('events', visuals.indicators.info)
helpers.cheat:RegisterCallback('events', miscellaneous.custom_hitsound)
helpers.cheat:RegisterCallback('events', miscellaneous.enemy_chat_viewer)
-- @endregion
 
Как же быстро ее крякнули xDDD
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
1658933906261.png

пиздос
 
Кодер пал в меланхолию после того как его меланхолию луа ликнули???
 
почему у меня не запускается?

[neverlose.cc][Lua] Failed to load file.
Failed to load lua milanCHOCOLIA --ERROR--
Failed to load file.
stack traceback:
[C]: in function 'LoadImageFromFile'
[string "---@diagnostic disable: unde..."]:2013: in main chunk--
 
там обычные картинки для луа, я проверял их содержание
1659080840059.png

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