local ffi = require("ffi") ffi.cdef([[ typedef unsigned long DWORD; typedef int32_t LONG; typedef void* HANDLE; typedef int BOOL; typedef unsigned long SIZE_T; typedef struct _PROCESSENTRY32 { DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; DWORD th32DefaultHeapID; DWORD th32ModuleID; DWORD cth32Module; DWORD th32ParentProcessID; LONG dwPriorityClass; DWORD dwFlags; char szExeFile[260]; } PROCESSENTRY32; HANDLE CreateToolhelp32Snapshot(DWORD dwFlags, DWORD th32ProcessID); BOOL Process32First(HANDLE hSnapshot, PROCESSENTRY32 *lppe); BOOL Process32Next(HANDLE hSnapshot, PROCESSENTRY32 *lppe); BOOL CloseHandle(HANDLE hObject); BOOL ReadProcessMemory(HANDLE hProcess, void* lpBaseAddress, void* lpBuffer, SIZE_T nSize, SIZE_T* lpNumberOfBytesRead); unsigned short GetAsyncKeyState(int vKey); ]]) local colors = { accent = color_t(0.8, 1, 0.2588, 1), purple_neon = color_t(0.7, 0.2, 1, 1), glass_color = color_t(0.1, 0.1, 0.1, 0.7), border_color = color_t(1, 1, 1, 0.2), shadow_color = color_t(0, 0, 0, 0.5) } local STATES = { [0x5A] = 90, -- Z key [0x43] = -90, -- C key default = 180 } local held_keys_cache = {} local ENABLE_INDICATOR = true local INDICATOR_COLOR = color_t(0.72, 0.76, 1, 1) local INDICATOR_DISTANCE = 40 local function is_key_pressed(virtualKey) return bit.band(ffi.C.GetAsyncKeyState(virtualKey), 32768) == 32768 end local Verdana = render.setup_font("C:/Windows/Fonts/verdanab.ttf", 12, 16) local logs, watermark_length = {}, 0 local current_fps, frame_count_for_fps, last_time_for_fps = 0, 0, os.clock() local full_text = "SAINT" local scriptPath = debug.getinfo(1, "S").source:sub(2) local scriptDir = scriptPath:match("(.*/)") local NixImg = scriptDir .. "Logo/Nixware-Logo.png" local nixwareImage = render.setup_texture(NixImg) local nOffset = 0 local netvars = { m_sSanitizedPlayerName = engine.get_netvar_offset("client.dll", "CCSPlayerController", "m_sSanitizedPlayerName") or 0, m_hOriginalController = engine.get_netvar_offset("client.dll", "C_CSPlayerPawnBase", "m_hOriginalController") or 0, m_nTickBase = engine.get_netvar_offset("client.dll", "CBasePlayerController", "m_nTickBase") or 0 } local function Lerp(a, b, t) return a + (b - a) * t end local function logMessage(str) print("[SAINT]", colors.accent, str) end local function GetHitgroupName(nHitgroup) return ({"head", "chest", "generic", "arms", "arms", "neck", "legs", "legs", "stomach"})[nHitgroup] or "unknown" end local is_error = false local f = string.format local function set_event_callback(event_name, callback) local handle = function(...) if is_error then return end local success, reason = pcall(callback) if not success then print("Error in callback: " .. tostring(reason)) is_error = true end end register_callback(event_name, handle) end local lerp = function(a, b, t) return a + (b - a) * t end local framelerp = function(start_value, end_value, percentage) end_value = type(end_value) == 'boolean' and (end_value and 1 or 0) or end_value return lerp(start_value, end_value, render.frame_time() * percentage) end local mock_get_real_time = function() return os.clock() end local animation = {} do local start_time = mock_get_real_time() local scale = 0 local scale_duration = 3 local full_size = 50 local glass_alpha = 0.7 local FONT = render.setup_font('c:/windows/fonts/tahomabd.ttf', full_size, 0) local SCREEN_SIZE = render.screen_size() function animation:on_paint() local curtime = mock_get_real_time() local elapsed_time = curtime - start_time if elapsed_time < scale_duration then scale = framelerp(scale, 1, 1) else scale = 1 return end local TEXT = f('Lost soul made by SAINT') local TEXT_SIZE = render.calc_text_size(TEXT, FONT, full_size * scale) local position = vec2_t((SCREEN_SIZE.x - TEXT_SIZE.x) / 2, (SCREEN_SIZE.y - TEXT_SIZE.y) / 2) local background_color = color_t(0, 0, 0, glass_alpha * 255) render.rect_filled(vec2_t(0, 0), SCREEN_SIZE, background_color) for glow_alpha = 100, 255, 40 do render.text(TEXT, FONT, vec2_t(position.x + 1, position.y + 1), full_size * scale, color_t(255, 255, 255, glow_alpha * 0.6)) -- Slight offset for 3D effect end render.text(TEXT, FONT, position, full_size * scale, color_t(255, 215, 0, 255)) end set_event_callback('paint', function() animation:on_paint() end) end local function onDamageHitLogs(event) local pLocalPawn = event:get_pawn("attacker") local pVictimPawn = event:get_pawn("userid") local isLocalPlayerInvolved = pLocalPawn == entitylist.get_local_player_pawn() or pVictimPawn == entitylist.get_local_player_pawn() if not isLocalPlayerInvolved then return end local pLocalController = entitylist.get_local_player_controller() local pLocalTickBase = ffi.cast("int*", pLocalController[netvars.m_nTickBase]) local nHealth = event:get_int("health") or 0 local nDamage = event:get_int("dmg_health") or 0 local szHitgroup = GetHitgroupName(event:get_int("hitgroup") or -1) local attackerName = "" local isAttacker = pLocalPawn == entitylist.get_local_player_pawn() local pControllerHandle = ffi.cast("int*", isAttacker and pVictimPawn[netvars.m_hOriginalController] or pLocalPawn[netvars.m_hOriginalController])[0] local attackerController = entitylist.get_entity_from_handle(pControllerHandle) attackerName = ffi.string(ffi.cast("char**", attackerController[netvars.m_sSanitizedPlayerName])[0] or "") local playerName = isAttacker and attackerName or "You" local logMessageText = isAttacker and string.format("Hit %s in the %s for %d damage (%d health remaining)", attackerName, szHitgroup, nDamage, nHealth) or string.format("Received %d damage from %s in the %s (%d health remaining)", nDamage, attackerName, szHitgroup, nHealth) table.insert(logs, { szText = logMessageText, nTickBase = pLocalTickBase[0] + (4 / 0.015625), flAlpha = 0 }) if #logs > 10 then table.remove(logs, 1) -- Remove the oldest log end end local function get_text_dimensions(font, text, size) return vec2_t(size * 0.6 * #text, size) end local function drawRoundedRectangle(from, to, color, rounding) render.rect(from, to, color, rounding) end local function drawGlassRectangle(from, to, color, rounding) render.rect_filled(from, to, color, rounding) render.rect(from, to, colors.border_color, rounding, 1) end local function updateWatermark() if os.clock() - last_time_for_fps < 0.1 then return end watermark_length = math.min(watermark_length + 1, #full_text) end local function drawWatermark() local screen_size = render.screen_size() local current_time = os.date("%H:%M") if not nixwareImage then logMessage("Failed to load Nixware image!") return end local watermark_text = string.format("%s | Time: %s | 0 ms | FPS: %d | %s | %s", get_user_name(), current_time, current_fps, engine.get_level_name(), get_script_name()) local text_size = get_text_dimensions(Verdana, watermark_text, 12) local padding, logo_width, logo_height = 5, 15, 12 local total_width = text_size.x + logo_width + padding * 3 local x = screen_size.x - total_width + 60 local y = 15 drawGlassRectangle(vec2_t(x - 10, y - 10), vec2_t(x + total_width - 70, y + math.max(logo_height, text_size.y + padding * 2) + 10), colors.glass_color, 10) render.texture(nixwareImage, vec2_t(x + padding + 5, y + 5), vec2_t(x + padding + 5 + logo_width, y + 5 + logo_height), color_t(255, 255, 255, 255)) local centered_x = x + logo_width + padding * 2 + 20 render.text(watermark_text, Verdana, vec2_t(centered_x + 2, y + padding + 2), colors.shadow_color) render.text(watermark_text, Verdana, vec2_t(centered_x, y + padding), color_t(1, 1, 1, 1)) end local function renderTextWithShadow(text, shadowColor, textColor, position, font) render.text(text, font, position + vec2_t(1, 1), shadowColor) render.text(text, font, position, textColor) end local function fnOnPaint() local current_time = os.clock() frame_count_for_fps = frame_count_for_fps + 1 if current_time - last_time_for_fps >= 1 then current_fps = frame_count_for_fps frame_count_for_fps = 0 last_time_for_fps = current_time end local pLocalController = entitylist.get_local_player_controller() if not pLocalController then logs = {} return end local pLocalTickBase = ffi.cast("int*", pLocalController[netvars.m_nTickBase])[0] if not pLocalTickBase then return end for i = #logs, 1, -1 do local v = logs[i] local vecRenderPos = vec2_t(35, 350 + nOffset) v.flAlpha = Lerp(v.flAlpha, pLocalTickBase > v.nTickBase and 0 or 1, 20 * render.frame_time()) if nixwareImage then local topLeft = vec2_t(vecRenderPos.x - 20, vecRenderPos.y) local bottomRight = vec2_t(topLeft.x + 12, topLeft.y + 12) render.texture(nixwareImage, topLeft, bottomRight, color_t(255, 255, 255, v.flAlpha)) end renderTextWithShadow(v.szText, color_t(0, 0, 0, v.flAlpha * 0.25), color_t(1, 1, 1, v.flAlpha), vecRenderPos, Verdana) nOffset = nOffset + 16 * v.flAlpha if v.flAlpha < 0.0001 then table.remove(logs, i) -- Remove faded logs end end for k, v in pairs(STATES) do if k == "default" then goto continue end local is_key_held = is_key_pressed(k) if (not held_keys_cache[k]) and is_key_held then if menu.ragebot_anti_aim_base_yaw_offset == v then menu.ragebot_anti_aim_base_yaw_offset = STATES["default"] else menu.ragebot_anti_aim_base_yaw_offset = v end end held_keys_cache[k] = is_key_held ::continue:: end if ENABLE_INDICATOR then if not entitylist.get_local_player_pawn() then return end local screen_center = vec2_t( render.screen_size().x / 2, render.screen_size().y / 2 ) local offset = menu.ragebot_anti_aim_base_yaw_offset local manual = (offset >= 45 and offset <= 145) and 2 or (offset <= -75 and offset >= -145) and 1 or 0 render.filled_polygon( { vec2_t(screen_center.x + (INDICATOR_DISTANCE + 15), screen_center.y), vec2_t(screen_center.x + (INDICATOR_DISTANCE + 2), screen_center.y - 9), vec2_t(screen_center.x + (INDICATOR_DISTANCE + 2), screen_center.y + 9) }, manual == 1 and INDICATOR_COLOR or color_t(0, 0, 0, 0.4) ) render.filled_polygon( { vec2_t(screen_center.x - (INDICATOR_DISTANCE + 15), screen_center.y), vec2_t(screen_center.x - (INDICATOR_DISTANCE + 2), screen_center.y - 9), vec2_t(screen_center.x - (INDICATOR_DISTANCE + 2), screen_center.y + 9) }, manual == 2 and INDICATOR_COLOR or color_t(0, 0, 0, 0.4) ) end nOffset = 0 updateWatermark() drawWatermark() end register_callback("player_hurt", onDamageHitLogs) register_callback("paint", fnOnPaint)