Advertisement
rydor

MAIN 2023

Mar 31st, 2023 (edited)
980
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 35.84 KB | None | 0 0
  1. local anti_aim = require 'gamesense/antiaim_funcs'
  2.  
  3. local ffi, csgo_weapons = require("ffi"), require("gamesense/csgo_weapons")
  4.  
  5. local entity_get_local_player, entity_get_prop, entity_get_classname, entity_get_player_weapon, entity_hitbox_position, entity_get_players, entity_is_alive, entity_is_dormant, entity_is_enemy, entity_get_origin, entity_set_prop, ui_menu_position, ui_menu_size, ui_reference, ui_new_checkbox, ui_new_slider, ui_new_hotkey, ui_new_combobox, ui_new_color_picker, ui_set_visible, ui_get, ui_set, ui_is_menu_open, ui_new_label, ui_set_callback, ui_new_multiselect, client_screen_size, client_current_threat, client_find_signature, client_create_interface, client_set_event_callback, client_unset_event_callback, client_trace_line, client_random_int, client_userid_to_entindex, client_trace_bullet, client_scale_damage, client_eye_position, client_camera_angles, client_delay_call, client_key_state, client_latency, client_system_time, client_exec, globals_realtime, globals_curtime, globals_absoluteframetime, globals_frametime, globals_chokedcommands, globals_tickcount, renderer_rectangle, renderer_text, renderer_blur, renderer_indicator, renderer_circle_outline, renderer_fadebar , renderer_measure_text, renderer_line, renderer_world_to_screen, renderer_circle, math_floor, math_sqrt, math_abs, math_atan, math_atan2, math_max, math_deg, math_sin, math_cos, math_rad, math_pi, math_min, math_pow, math_random, ffi_cdef, ffi_cast, ffi_typeof, globals_mapname, globals_tickinterval, bit_band =
  6.  
  7. entity.get_local_player, entity.get_prop, entity.get_classname, entity.get_player_weapon, entity.hitbox_position, entity.get_players, entity.is_alive, entity.is_dormant, entity.is_enemy, entity.get_origin, entity.set_prop, ui.menu_position, ui.menu_size, ui.reference, ui.new_checkbox, ui.new_slider, ui.new_hotkey, ui.new_combobox, ui.new_color_picker, ui.set_visible, ui.get, ui.set, ui.is_menu_open, ui.new_label, ui.set_callback, ui.new_multiselect, client.screen_size, client.current_threat, client.find_signature, client.create_interface, client.set_event_callback, client.unset_event_callback, client.trace_line, client.random_int, client.userid_to_entindex, client.trace_bullet, client.scale_damage, client.eye_position, client.camera_angles, client.delay_call, client.key_state, client.latency, client.system_time, client.exec, globals.realtime, globals.curtime, globals.absoluteframetime, globals.frametime, globals.chokedcommands, globals.tickcount, renderer.rectangle, renderer.text, renderer.blur, renderer.indicator, renderer.circle_outline, renderer.gradient, renderer.measure_text, renderer.line, renderer.world_to_screen, renderer.circle, math.floor, math.sqrt, math.abs, math.atan, math.atan2, math.max, math.deg, math.sin, math.cos, math.rad, math.pi, math.min, math.pow, math.random, ffi.cdef, ffi.cast, ffi.typeof, globals.mapname, globals.tickinterval, bit.band
  8.  
  9. local local_player = entity_get_local_player()
  10. local should_swap = false
  11. local it = 0
  12. local enemyclosesttocrosshair = nil
  13.  
  14.  
  15. local ref = {
  16.     enabled = ui_reference("AA", "Anti-aimbot angles", "Enabled"),
  17.     pitch = ui_reference("AA", "Anti-aimbot angles", "pitch"),
  18.     yaw_base = ui_reference("AA", "Anti-aimbot angles", "Yaw base"),
  19.     yaw = {ui_reference("AA", "Anti-aimbot angles", "Yaw")},
  20.     fsbodyyaw = ui_reference("AA", "anti-aimbot angles", "Freestanding body yaw"),
  21.     edgeyaw = ui_reference("AA", "Anti-aimbot angles", "Edge yaw"),
  22.     antiaim = ui_reference("AA", "Anti-aimbot angles", "Enabled"),
  23.     roll = ui_reference("AA", "Anti-aimbot angles", "Roll"),
  24.     is_qp = {ui_reference("RAGE", "Other", "Quick peek assist")},
  25.     body_yaw = {ui_reference("AA", "Anti-aimbot angles", "Body yaw")},
  26.     misc_legs = ui_reference("AA", "other", "leg movement"),
  27.     fl_refference = ui_reference("AA", "Fake Lag", "Enabled"),
  28.     fl_slider = ui_reference("AA", "Fake lag", "Limit"),
  29.     fd_ref = {ui_reference("Rage", "Other", "Duck peek assist")},
  30.     jitter = {ui_reference("AA", "Anti-aimbot angles", "Yaw jitter")},
  31.     fl_ammount = ui_reference("AA", "Fake lag", "Amount"),
  32.     aw_ref = ui_reference("Rage","Other","Automatic Fire"),
  33.     ap_ref = ui_reference("Rage","Other","Automatic Penetration"),
  34.     fov = ui_reference("RAGE", "Other", "Maximum FOV"),
  35.  
  36. }
  37.  
  38. local vars = {
  39.     ["hitgroup_names"] = {"generic", "head", "chest", "stomach", "left arm", "right arm", "left leg", "right leg", "neck", "?", "gear"},
  40.     ["bruteforce"] = false,
  41.     ["closest_enemy"] = nil,
  42.     ["in_fov"] = false,
  43.     ["DEG_TO_RAD"] = math.pi / 180,
  44.     ["RAD_TO_DEG"] = 180 / math.pi,
  45.     ["fire"] = false,
  46.     ["fire_improvements"] = false,
  47.     ["visible_hitboxes"] = 0,
  48.     ["side"] = 1,
  49.     ["last_side"] = 0,
  50.     ["last_hit"] = 0,
  51.     ["hit_side"] = 0,
  52.     ["ft_prev"] = 0
  53. }
  54.  
  55. ui_set(ref.enabled, true)
  56. local ent_state = {
  57.     speed = function(ent) local speed = math_sqrt(math_pow(entity_get_prop(ent, "m_vecVelocity[0]"), 2) + math_pow(entity_get_prop(ent, "m_vecVelocity[1]"), 2)) return speed end,
  58.     is_peeking = function() return (ui_get(ref.is_qp[1]) and ui_get(ref.is_qp[2])) end,
  59.     is_ladder = function(ent) return (entity_get_prop(ent, "m_MoveType") or 0) == 9 end
  60. }
  61.  
  62. local table_contains = function(tbl, val)
  63.     for i = 1, #tbl do
  64.         if tbl[i] == val then
  65.             return true
  66.         end
  67.     end
  68.     return false
  69. end
  70. --Roll in MM From pilot
  71.  
  72. local is_mm_state = 0
  73.  
  74. local game_rule = ffi_cast("intptr_t**", ffi_cast("intptr_t", client_find_signature("client.dll", "\x83\x3D\xCC\xCC\xCC\xCC\xCC\x74\x2A\xA1")) + 2)[0]
  75.  
  76. --Menu Build
  77.  
  78. local lby_breaker = ui_new_checkbox("AA", "Anti-aimbot angles", "Enable Papi-Yaw", true)
  79. local menu_selector = ui_new_combobox("AA", "Anti-aimbot angles", "Menu Selector", {"Anti-Aim", "Misc"})
  80.  
  81. local lby = {
  82.  
  83.     -- desync
  84.     desync_type = ui_new_combobox("aa", "anti-aimbot angles","Desync Calculation",{"Max Desync", "Manual Value"}),
  85.     desync = ui_new_slider("aa", "anti-aimbot angles", "Desync", 0, 65, 63),
  86.     direction_handler = ui_new_combobox("AA", "Anti-aimbot angles", "Direction Handler", {"Automatic", "Manual"}),
  87.     enable = ui_new_checkbox("AA", "Anti-aimbot angles", "Better body freestanding"),
  88.     mode = ui_new_combobox("AA", "Anti-aimbot angles", "Body freestanding mode", { "Hide real", "Hide fake" }),
  89.     smart = ui_new_checkbox("AA", "Anti-aimbot angles", "Smart mode"),
  90.     roll_inverter = ui_new_hotkey("AA", "Anti-aimbot angles", "Roll Side Switch"),
  91.     body_inverter = ui_new_hotkey("AA", "Anti-aimbot angles", "Desync Inverter"),
  92.     roll_enabled = ui_new_checkbox("AA", "Anti-aimbot angles", "\aD6BE73FFEnable Roll {UNSAFE}"),
  93.     roll = ui_new_slider("aa", "anti-aimbot angles", "Roll", -44, 44, 0),
  94.     roll_disablers = ui_new_checkbox("AA", "Anti-aimbot angles", "Disable Roll While Moving"),
  95.  
  96.  
  97.     -- anti-bruteforce references
  98.     check = ui_new_checkbox("AA", "Anti-aimbot angles", "Anti-bruteforce"),
  99.     combo = ui_new_combobox("AA", "Anti-aimbot angles", "Anti-bruteforce mode", { "Opposite", "Random",}),
  100.     ab_conditions = ui_new_combobox("AA", "Anti-aimbot angles", "Anti-bruteforce conditions", { "Always", "Slow-Walk",}),
  101.     ab_range = ui_new_slider("AA", "Anti-aimbot angles", "Anti-bruteforce range", 1, 100, 32)
  102.  
  103. }
  104.  
  105. local misc = {
  106.  
  107.     slide_leg = ui_new_checkbox("AA", "Other","Slide Legs"),
  108.     slow_enabled = ui_new_checkbox("AA", "Other", "Custom Slow Walk"),
  109.     limit_reference = ui_new_slider("AA", "Other", "Slow Walk Speed Factor", 10, 57, 50, 57, "", 1, {[57] = "Max"}),
  110.  
  111.  
  112.     custom_fl_enabled = ui_new_checkbox("AA", "Fake lag", "Enable Custom Fake Lag"),
  113.     custom_fl = ui_new_multiselect("AA", "Fake lag", "Custom Fake Lag Triggers", {"Standing", "Moving", "In Air"}),
  114.     fl_standing_slider = ui_new_slider("aa", "Fake Lag", "Standing Fake Lag", 1, 14, 1),
  115.     fl_standing_mode = ui_new_combobox("AA", "Fake Lag", "Standing Fake Lag", {"Dynamic", "Maximum", "Fluctuate"}),
  116.     fl_moving_slider = ui_new_slider("aa", "Fake Lag", "Moving Fake Lag", 1, 14, 1),
  117.     fl_moving_mode = ui_new_combobox("AA", "Fake Lag", "Moving Fake Lag", {"Dynamic", "Maximum", "Fluctuate"}),
  118.     fl_in_air_slider = ui_new_slider("aa", "Fake Lag", "In-Air Fake Lag", 1, 14, 1),
  119.     fl_in_air_mode = ui_new_combobox("AA", "Fake Lag", "In Air Fake Lag", {"Dynamic", "Maximum", "Fluctuate"}),
  120.     fl_slowwalk_slider = ui_new_slider("aa", "Fake Lag", "Slow-Walk Fake Lag", 1, 14, 1),
  121.     fl_slowwalk_mode = ui_new_combobox("AA", "Fake Lag", "Slow Walk Fake Lag", {"Dynamic", "Maximum", "Fluctuate"}),
  122.     fl_fakeduck_slider = ui_new_slider("aa", "Fake Lag", "Fake-Duck Fake Lag", 1, 14, 1),
  123.     fl_fakeduck_mode = ui_new_combobox("AA", "Fake Lag", "Fake Duck Fake Lag", {"Dynamic", "Maximum", "Fluctuate"}),
  124.     aw_on_key = ui_new_hotkey("AA", "Anti-aimbot angles","Auto Wall On Key"),
  125.     ap_on_key = ui_new_hotkey("AA", "Anti-aimbot angles","Auto Penetration On Key"),
  126.  
  127.     dynamicfov = ui_new_checkbox("AA", "Anti-aimbot angles", "Dynamic FOV"),
  128.     dynamicfov_mode = ui_new_combobox("AA", "Anti-aimbot angles", "\ndynamic_fov_modes", {"Snipers","Deagle", "Pistols","Others"}),
  129.     dynamicfov_autofactor = ui_new_slider("AA", "Anti-aimbot angles", "Dynamic FOV auto factor", 0, 250, 100, true, "x", 0.01),
  130.     dynamicfov_min_snipers = ui_new_slider("AA", "Anti-aimbot angles", "Snipers Dynamic FOV min", 1, 180, 3, true, "°", 1),
  131.     dynamicfov_max_snipers = ui_new_slider("AA", "Anti-aimbot angles", "Snipers Dynamic FOV max", 1, 180, 10, true, "°", 1),
  132.     dynamicfov_min_deagle = ui_new_slider("AA", "Anti-aimbot angles", "Deagle Dynamic FOV min", 1, 180, 3, true, "°", 1),
  133.     dynamicfov_max_deagle = ui_new_slider("AA", "Anti-aimbot angles", "Deagle Dynamic FOV max", 1, 180, 10, true, "°", 1),
  134.     dynamicfov_min_pistols = ui_new_slider("AA", "Anti-aimbot angles", "Pistols Dynamic FOV min", 1, 180, 3, true, "°", 1),
  135.     dynamicfov_max_pistols = ui_new_slider("AA", "Anti-aimbot angles", "Pistols Dynamic FOV max", 1, 180, 10, true, "°", 1),
  136.     dynamicfov_min_others = ui_new_slider("AA", "Anti-aimbot angles", "Others Dynamic FOV min", 1, 180, 3, true, "°", 1),
  137.     dynamicfov_max_others = ui_new_slider("AA", "Anti-aimbot angles", "Others Dynamic FOV max", 1, 180, 10, true, "°", 1),
  138.  
  139.     custom_aa_sw = ui_new_checkbox("AA", "Anti-aimbot angles", "Custom Pitch On Slow Walk"),
  140.     custom_aa_sw_slider = ui_new_slider("aa", "Anti-aimbot angles", "Custom Pitch Angle", -89, 89, 1),
  141.  
  142.     clantag_chg = ui_new_checkbox("AA", "Anti-aimbot angles", "Putang Ina Clan Tag Changer"),
  143.     stop_intro = ui_new_checkbox("aa", "anti-aimbot angles","\aB2ACDDFFEnable freeze animation"),
  144.  
  145.  
  146. }
  147.  
  148.  
  149. local function in_air(player)
  150.     local flags = entity_get_prop(player, "m_fFlags")
  151.    
  152.     if bit_band(flags, 1) == 0 then
  153.         return true
  154.     end
  155.    
  156.     return false
  157. end
  158.  
  159. local function get_velocity(player)
  160.     local x,y,z = entity_get_prop(player, "m_vecVelocity")
  161.     if x == nil then return end
  162.     return math_sqrt(x*x + y*y + z*z)
  163. end
  164.  
  165. local function extrapolate_position(xpos,ypos,zpos,ticks,player)
  166.     local x,y,z = entity_get_prop(player, "m_vecVelocity")
  167.     for i=0, ticks do
  168.         xpos =  xpos + (x*globals_tickinterval())
  169.         ypos =  ypos + (y*globals_tickinterval())
  170.         zpos =  zpos + (z*globals_tickinterval())
  171.     end
  172.     return xpos,ypos,zpos
  173. end
  174.  
  175. local function can_enemy_hit_on_peek(ent,ticks)
  176.     if ent == nil then return end
  177.    
  178.     local origin_x, origin_y, origin_z = entity_get_prop(ent, "m_vecOrigin")
  179.     if origin_z == nil then return end
  180.    
  181.     local sx,sy,sz = entity_hitbox_position(entity_get_local_player(), 11)
  182.     local dx,dy,dz = entity_hitbox_position(entity_get_local_player(), 12)
  183.  
  184.     sx,sy,sz = extrapolate_position(sx, sy, sz, ticks, entity_get_local_player())
  185.     dx,dy,dz = extrapolate_position(dx, dy, dz, ticks, entity_get_local_player())
  186.    
  187.     local ___, left_dmg = client_trace_bullet(ent, origin_x, origin_y, origin_z, sx, sy, sz, true)
  188.     local __, right_dmg = client_trace_bullet(ent, origin_x, origin_y, origin_z, dx, dy, dz, true)
  189.  
  190.     local left_hittable = left_dmg ~= nil and left_dmg > 12
  191.     local right_hittable = right_dmg ~= nil and right_dmg > 12
  192.     local hittable = (left_hittable or right_hittable) and get_velocity(entity_get_local_player()) > 32
  193.    
  194.     return hittable
  195. end
  196. local checkbox_reference, hotkey_reference = ui.reference("AA", "Other", "Slow motion")
  197. -- anti-bruteforce
  198. local function GetClosestPoint(A, B, P)
  199.     local a_to_p = { P[1] - A[1], P[2] - A[2] }
  200.     local a_to_b = { B[1] - A[1], B[2] - A[2] }
  201.  
  202.     local atb2 = a_to_b[1]^2 + a_to_b[2]^2
  203.  
  204.     local atp_dot_atb = a_to_p[1]*a_to_b[1] + a_to_p[2]*a_to_b[2]
  205.     local t = atp_dot_atb / atb2
  206.    
  207.     return { A[1] + a_to_b[1]*t, A[2] + a_to_b[2]*t }
  208. end
  209.  
  210. client_set_event_callback("bullet_impact", function(c)
  211.     if ui_get(lby.check) and entity_is_alive(entity_get_local_player()) then
  212.         local ent = client_userid_to_entindex(c.userid)
  213.         if not entity_is_dormant(ent) and entity_is_enemy(ent) then
  214.             local ent_shoot = { entity_get_prop(ent, "m_vecOrigin") }
  215.             ent_shoot[3] = ent_shoot[3] + entity_get_prop(ent, "m_vecViewOffset[2]")
  216.             local player_head = { entity_hitbox_position(entity_get_local_player(), 0) }
  217.             local closest = GetClosestPoint(ent_shoot, { c.x, c.y, c.z }, player_head)
  218.             local delta = { player_head[1]-closest[1], player_head[2]-closest[2] }
  219.             local delta_2d = math.sqrt(delta[1]^2+delta[2]^2)
  220.        
  221.             if math.abs(delta_2d) < ui_get(lby.ab_range) then
  222.                 local ab_conditions_g = ui_get(lby.ab_conditions)
  223.                 if ab_conditions_g == "Always" then
  224.                     it = it + 1
  225.                     should_swap = true
  226.                 elseif ab_conditions_g == "Slow-Walk" and ui_get(hotkey_reference) then
  227.                     it = it + 1
  228.                     should_swap = true
  229.                 end
  230.             end
  231.         end
  232.     end
  233. end)
  234.  
  235.  
  236. local math_sqrt = math.sqrt
  237.  
  238. local function modify_velocity(cmd, goalspeed)
  239.     if goalspeed <= 0 then
  240.         return
  241.     end
  242.    
  243.     local minimalspeed = math_sqrt((cmd.forwardmove * cmd.forwardmove) + (cmd.sidemove * cmd.sidemove))
  244.    
  245.     if minimalspeed <= 0 then
  246.         return
  247.     end
  248.    
  249.     if cmd.in_duck == 1 then
  250.         goalspeed = goalspeed * 2.94117647 -- wooo cool magic number
  251.     end
  252.    
  253.     if minimalspeed <= goalspeed then
  254.         return
  255.     end
  256.    
  257.     local speedfactor = goalspeed / minimalspeed
  258.     cmd.forwardmove = cmd.forwardmove * speedfactor
  259.     cmd.sidemove = cmd.sidemove * speedfactor
  260. end
  261.  
  262. local function on_setup_cmd(cmd)   
  263.     local checkbox = ui.get(checkbox_reference)
  264.     local hotkey = ui.get(hotkey_reference)
  265.     local limit = ui.get(misc.limit_reference)
  266.    
  267.     if limit >= 57 then
  268.         return
  269.     end
  270.    
  271.     if checkbox and hotkey then
  272.         modify_velocity(cmd, limit)
  273.     end
  274. end
  275.  
  276. client.set_event_callback('setup_command', on_setup_cmd)
  277.  
  278. local on_dynamicfov_event = function()
  279.     local mode = ui_get(misc.dynamicfov_mode)
  280.     local auto_factor = ui_get(misc.dynamicfov_autofactor)
  281.     local max_fov
  282.     local min_fov
  283.  
  284.     if mode == "Snipers" then
  285.         max_fov = ui_get(misc.dynamicfov_max_snipers)
  286.         min_fov = ui_get(misc.dynamicfov_min_snipers)
  287.     elseif mode == "Deagle" then
  288.         max_fov = ui_get(misc.dynamicfov_max_deagle)
  289.         min_fov = ui_get(misc.dynamicfov_min_deagle)
  290.     elseif mode == "Pistols" then
  291.         max_fov = ui_get(misc.dynamicfov_max_pistols)
  292.         min_fov = ui_get(misc.dynamicfov_min_pistols)
  293.     elseif mode == "Others" then
  294.         max_fov = ui_get(misc.dynamicfov_max_others)
  295.         min_fov = ui_get(misc.dynamicfov_min_others)
  296.     end
  297.  
  298.     if auto_factor == nil or max_fov == nil or min_fov == nil then
  299.         return
  300.     end
  301.  
  302.     local old_fov = ui_get(ref.fov)
  303.     local new_fov = old_fov
  304.     local enemies = entity_get_players(true)
  305.  
  306.     if min_fov > max_fov then
  307.         local store_min_fov = min_fov
  308.         min_fov = max_fov
  309.         max_fov = store_min_fov
  310.     end
  311.  
  312.     if #enemies ~= 0 then
  313.         local own_x, own_y, own_z = client_eye_position()
  314.         local own_pitch, own_yaw = client_camera_angles()
  315.         vars.closest_enemy = nil
  316.         local closest_distance = 999999999
  317.  
  318.         for i = 1, #enemies do
  319.             local enemy = enemies[i]
  320.             local enemy_x, enemy_y, enemy_z = entity_hitbox_position(enemy, 0)
  321.  
  322.             local x = enemy_x - own_x
  323.             local y = enemy_y - own_y
  324.             local z = enemy_z - own_z
  325.  
  326.             local yaw = ((math_atan2(y, x) * 180 / math.pi))
  327.             local pitch = -(math_atan2(z, math_sqrt(math_pow(x, 2) + math_pow(y, 2))) * 180 / math.pi)
  328.  
  329.             local yaw_dif = math_abs(own_yaw % 360 - yaw % 360) % 360
  330.             local pitch_dif = math_abs(own_pitch - pitch ) % 360
  331.            
  332.             if yaw_dif > 180 then
  333.                 yaw_dif = 360 - yaw_dif
  334.             end
  335.  
  336.             local real_dif = math_sqrt(math_pow(yaw_dif, 2) + math_pow(pitch_dif, 2))
  337.  
  338.             if closest_distance > real_dif then
  339.                 closest_distance = real_dif
  340.                 vars.closest_enemy = enemy
  341.             end
  342.         end
  343.  
  344.         if vars.closest_enemy ~= nil then
  345.             local closest_enemy_x, closest_enemy_y, closest_enemy_z = entity_hitbox_position(vars.closest_enemy, 0)
  346.             local real_distance = math_sqrt(math_pow(own_x - closest_enemy_x, 2) + math_pow(own_y - closest_enemy_y, 2) + math_pow(own_z - closest_enemy_z, 2))
  347.  
  348.             new_fov = (3800 / real_distance) * (ui_get(misc.dynamicfov_autofactor) * 0.01)
  349.  
  350.             if (new_fov > max_fov) then
  351.                 new_fov = max_fov
  352.             elseif new_fov < min_fov then
  353.                 new_fov = min_fov
  354.             end
  355.         end
  356.  
  357.         new_fov = math_floor(new_fov + 0.5)
  358.  
  359.         if (new_fov > closest_distance)  then
  360.             vars.in_fov = true
  361.         else
  362.             vars.in_fov = false
  363.         end
  364.     else
  365.         new_fov = min_fov
  366.         vars.in_fov = false
  367.     end
  368.  
  369.     if (new_fov ~= old_fov and (mode == "Snipers" or mode == "Deagle" or mode == "Pistols" or mode == "Others")) then
  370.         ui_set(ref.fov, new_fov)
  371.     end
  372. end
  373.  
  374.  
  375. local on_dynamicfov_change = function(ref, value)
  376.     ui_set_visible(misc.dynamicfov_mode, value)
  377.     ui_set_visible(misc.dynamicfov_autofactor, value)
  378. end
  379.  
  380.  
  381. client_set_event_callback("run_command", on_dynamicfov_event)
  382. client_set_event_callback("change", on_dynamicfov_change)
  383.  
  384.  
  385.  
  386. client_set_event_callback("run_command", function(c)
  387.  
  388.     if ui_get(lby.check) and should_swap then
  389.         local _combo = ui_get(lby.combo)
  390.         if _combo == "Opposite" then
  391.             ui_set(ref.body_yaw[2], -ui_get(ref.body_yaw[2]))
  392.         elseif _combo == "Random" then
  393.             ui_set(ref.body_yaw[2], math.random(-60, 60))
  394.         end
  395.         should_swap = false
  396.     end
  397.  
  398.     ui_set(ref.aw_ref, ui_get(misc.aw_on_key))
  399.     ui_set(ref.ap_ref, ui_get(misc.ap_on_key))
  400.  
  401.  
  402.     local lp_hittable = can_enemy_hit_on_peek(enemyclosesttocrosshair,16) and not in_air(local_player)
  403.  
  404.     if ui_get(misc.slide_leg) then
  405.         if lp_hittable then
  406.             ui_set(ref.misc_legs,"off")
  407.         else
  408.             ui_set(ref.misc_legs,"always slide")
  409.         end
  410.     else
  411.         ui_set(ref.misc_legs,"off")
  412.     end
  413.  
  414.     local fl_triggers_g = ui_get(misc.custom_fl)
  415.     local fl_state = false
  416.     local fl_slider_value = 1
  417.     local fl_amount = "Maximum"
  418.  
  419.  
  420.     if table_contains(fl_triggers_g, "Standing") then
  421.         if ent_state.speed(local_player) < 2 then
  422.             fl_state = true
  423.         end
  424.     end
  425.  
  426.     if table_contains(fl_triggers_g, "Moving") then
  427.         if ent_state.speed(local_player) > 2 then
  428.             fl_state = true
  429.         end
  430.     end
  431.  
  432.     if table_contains(fl_triggers_g, "In Air") then
  433.         if in_air(local_player) then
  434.             fl_state = true
  435.         end
  436.     end
  437.  
  438.     ui_set(ref.fl_refference, fl_state)
  439.  
  440.     if in_air(local_player) then
  441.         fl_slider_value = ui_get(misc.fl_in_air_slider)
  442.         fl_amount = ui_get(misc.fl_in_air_mode)
  443.  
  444.     end
  445.  
  446.     if ent_state.speed(local_player) > 2 and not in_air(local_player) then
  447.         fl_slider_value = ui_get(misc.fl_moving_slider)
  448.         fl_amount = ui_get(misc.fl_moving_mode)
  449.     end
  450.  
  451.     if ent_state.speed(local_player) < 2 then
  452.         fl_slider_value = ui_get(misc.fl_standing_slider)
  453.         fl_amount = ui_get(misc.fl_standing_mode)
  454.     end
  455.  
  456.     local slw_true = ui_get(hotkey_reference)
  457.  
  458.     if slw_true then
  459.         fl_slider_value = ui_get(misc.fl_slowwalk_slider)
  460.         fl_amount = ui_get(misc.fl_slowwalk_mode)
  461.     end
  462.  
  463.     local fd_true = ui_get(ref.fd_ref[1])
  464.     if fd_true then
  465.         fl_slider_value = ui_get(misc.fl_fakeduck_slider)
  466.         fl_amount = ui_get(misc.fl_fakeduck_mode)
  467.     end
  468.  
  469.     ui_set(ref.fl_slider, fl_slider_value)
  470.     ui_set(ref.fl_ammount, fl_amount)
  471.     -----------------------------------------------------------------------------------------------------------------------------------------
  472.  
  473.     local selected_aa
  474.     local current_menu
  475.     local state
  476.     local direction_mode_g = ui_get(lby.direction_handler)
  477.  
  478.     current_menu = ui_get(menu_selector)
  479.     state = ui_get(lby_breaker)
  480.     ui_set_visible(menu_selector, state)
  481.  
  482.     -- handle aa
  483.     selected_aa = current_menu == "Anti-Aim"
  484.     ui_set_visible(lby.desync_type, state and selected_aa)
  485.     ui_set_visible(lby.direction_handler, state and selected_aa)
  486.     ui_set_visible(lby.roll_inverter, state and selected_aa and direction_mode_g == "Manual")
  487.     ui_set_visible(lby.body_inverter, state and selected_aa and direction_mode_g == "Manual")
  488.     ui_set_visible(lby.enable, state and selected_aa)
  489.     ui_set_visible(lby.mode, state and selected_aa and ui_get(lby.enable))
  490.     ui_set_visible(lby.smart, state and selected_aa and ui_get(lby.enable))
  491.     ui_set_visible(lby.ab_conditions, state and selected_aa and ui_get(lby.enable))
  492.  
  493.     -- handle roll
  494.     ui_set_visible(lby.roll_enabled, state and selected_aa)
  495.     ui_set_visible(lby.roll, state and selected_aa and ui_get(lby.roll_enabled))
  496.     ui_set_visible(lby.roll_disablers, state and selected_aa)
  497.  
  498.     -- handle antibrute force
  499.     ui_set_visible(lby.check, state and selected_aa)
  500.     ui_set_visible(lby.combo, state and selected_aa and ui_get(lby.check))
  501.     ui_set_visible(lby.ab_range, state and selected_aa and ui_get(lby.check))
  502.  
  503.     -- handle misc
  504.     local selected_misc = current_menu == "Misc"
  505.     ui_set_visible(misc.slide_leg, state and selected_misc)
  506.     ui_set_visible(misc.limit_reference, state and selected_misc)
  507.     ui_set_visible(misc.slow_enabled, state and selected_misc)
  508.     ui_set_visible(misc.limit_reference, state and selected_misc and ui_get(misc.slow_enabled))
  509.     ui_set_visible(misc.custom_fl_enabled, state and selected_misc)
  510.     ui_set_visible(misc.custom_fl, state and selected_misc and ui_get(misc.custom_fl_enabled))
  511.     ui_set_visible(misc.fl_standing_slider, state and selected_misc)
  512.     ui_set_visible(misc.fl_moving_slider, state and selected_misc)
  513.     ui_set_visible(misc.fl_in_air_slider, state and selected_misc)
  514.     ui_set_visible(misc.fl_slowwalk_slider, state and selected_misc)
  515.     ui_set_visible(misc.fl_fakeduck_slider, state and selected_misc)
  516.     ui_set_visible(misc.aw_on_key, state and selected_misc)
  517.     ui_set_visible(misc.ap_on_key, state and selected_misc)
  518.     ui_set_visible(misc.clantag_chg, state and selected_misc)
  519.  
  520.     ui_set_visible(misc.custom_aa_sw, state and selected_misc)
  521.     ui_set_visible(misc.custom_aa_sw_slider, state and selected_misc and ui_get(misc.custom_aa_sw))
  522.  
  523.  
  524.     local mode = ui_get(misc.dynamicfov_mode)
  525.     ui_set_visible(misc.dynamicfov, state and selected_misc)
  526.     ui_set_visible(misc.dynamicfov_mode, state and selected_misc and ui_get(misc.dynamicfov))
  527.     ui_set_visible(misc.dynamicfov_autofactor, state and selected_misc and ui_get(misc.dynamicfov))
  528.    
  529.     ui_set_visible(misc.dynamicfov_min_snipers, state and selected_misc and mode == "Snipers" and ui_get(misc.dynamicfov))
  530.     ui_set_visible(misc.dynamicfov_max_snipers, state and selected_misc and mode == "Snipers" and ui_get(misc.dynamicfov))
  531.  
  532.     ui_set_visible(misc.dynamicfov_min_deagle, state and selected_misc and mode == "Deagle" and ui_get(misc.dynamicfov))
  533.     ui_set_visible(misc.dynamicfov_max_deagle, state and selected_misc and mode == "Deagle" and ui_get(misc.dynamicfov))
  534.  
  535.     ui_set_visible(misc.dynamicfov_min_pistols, state and selected_misc and mode == "Pistols" and ui_get(misc.dynamicfov))
  536.     ui_set_visible(misc.dynamicfov_max_pistols, state and selected_misc and mode == "Pistols" and ui_get(misc.dynamicfov))
  537.  
  538.     ui_set_visible(misc.dynamicfov_min_others, state and selected_misc and mode == "Others" and ui_get(misc.dynamicfov))
  539.     ui_set_visible(misc.dynamicfov_max_others, state and selected_misc and mode == "Others" and ui_get(misc.dynamicfov))
  540.  
  541.     ui_set_visible(misc.dynamicfov, state and selected_misc)
  542.    
  543.  
  544.  
  545. end)
  546.  
  547. local micro_move = function(cmd)
  548.  
  549.    
  550.     if cmd.chokedcommands == 0 or ent_state.speed(local_player) > 2 or ent_state.is_peeking() or cmd.in_attack == 1 then return end
  551.     cmd.forwardmove = 0.1
  552.     cmd.in_forward = 1
  553.  
  554. end
  555.  
  556.  
  557. local desync_func = function(cmd)
  558.     if not ui_get(ref.antiaim) then return end
  559.  
  560.     if not (ui_get(lby_breaker)) then return end
  561.  
  562.     local body_yaw_value = ui_get(ref.body_yaw[2])
  563.     local weapon = csgo_weapons[entity_get_prop(entity_get_player_weapon(local_player), "m_iItemDefinitionIndex")]
  564.     local direction_mode_g
  565.     local desync_type
  566.     local invert_roll_true = false
  567.     if ent_state.is_ladder(local_player) then return end
  568.     if weapon == nil or weapon.type == "grenade" then return end
  569.  
  570.  
  571.  
  572.     -- custom slow walk aa
  573.     local sw_true = ui_get(hotkey_reference)
  574.     local custom_pitch = {ui_reference("AA", "Anti-aimbot angles", "pitch")}
  575.  
  576.     if ui_get(misc.custom_aa_sw) and sw_true then
  577.         ui_set(custom_pitch[1], "Custom")
  578.         ui_set(custom_pitch[2], ui_get(misc.custom_aa_sw_slider))
  579.     else
  580.         ui_set(custom_pitch[1], "Off")
  581.     end
  582.  
  583.     ui_set_visible(custom_pitch[2], false)
  584.  
  585.  
  586.     micro_move(cmd)
  587.    
  588.     direction_mode_g = ui_get(lby.direction_handler)
  589.  
  590.     if direction_mode_g == "Automatic" then
  591.         if body_yaw_value == -180 then
  592.             invert_roll_true = true
  593.         else
  594.             invert_roll_true = false
  595.         end
  596.         local body_side = invert_roll_true and ui_get(lby.desync) or -ui_get(lby.desync)
  597.  
  598.         if cmd.chokedcommands == 0 and cmd.in_attack ~= 1 then
  599.  
  600.             cmd.yaw = cmd.yaw - body_side
  601.  
  602.             cmd.allow_send_packet = false
  603.  
  604.         end
  605.  
  606.     elseif direction_mode_g == "Manual" then
  607.         --inverter
  608.         local body_side = ui_get(lby.body_inverter) and ui_get(lby.desync) or -ui_get(lby.desync)
  609.  
  610.         if cmd.chokedcommands == 0 and cmd.in_attack ~= 1 then
  611.  
  612.             cmd.yaw = cmd.yaw - body_side
  613.  
  614.             cmd.allow_send_packet = false
  615.  
  616.         end
  617.  
  618.     end
  619.  
  620.     --Spoofs Client to use Roll in MM
  621.  
  622.     local is_mm_value = ffi_cast("bool*", game_rule[0] + 124)
  623.     local can_roll_move = true
  624.  
  625.     if ent_state.speed(local_player) > 2 and not ui_get(hotkey_reference) then
  626.         can_roll_move = false
  627.     end
  628.  
  629.     if is_mm_value ~= nil then
  630.  
  631.         if ui_get(lby.roll_enabled) and can_roll_move then
  632.             ui_set(ref.roll, 0)
  633.  
  634.             if direction_mode_g == "Automatic" then
  635.                     cmd.roll = invert_roll_true and ui_get(lby.roll) or -ui_get(lby.roll)
  636.                 if is_mm_value[0] == true then
  637.                     is_mm_value[0] = 0
  638.                     is_mm_state = 1
  639.                 end
  640.             elseif direction_mode_g == "Manual" then
  641.                     cmd.roll = invert_roll_true and ui_get(lby.roll) or -ui_get(lby.roll)            
  642.                 if is_mm_value[0] == true then
  643.                     is_mm_value[0] = 0
  644.                     is_mm_state = 1
  645.                 end
  646.             end
  647.  
  648.         else
  649.  
  650.             if is_mm_value[0] == false and is_mm_state == 1 then
  651.                 cmd.roll = 0
  652.             end
  653.  
  654.         end
  655.  
  656.     end
  657.  
  658.     desync_type = ui_get(lby.desync_type)
  659.     ui_set_visible(lby.desync, desync_type == "Manual Value")
  660. end
  661.  
  662.  
  663. local indicator_func = function()
  664.  
  665.     local desync = ui_get(ref.fov)
  666.     renderer_indicator(19, 117, 175, 255, "FOV : ", math.floor(desync))
  667.  
  668. end
  669.  
  670. local menu_visible = function()
  671.  
  672.     for i, v in pairs(lby) do
  673.         ui_set_visible(v, ui_get(lby_breaker))
  674.     end
  675.  
  676.     state = not ui_get(lby_breaker)
  677.    
  678.     -- default sets
  679.     ui_set(ref.pitch, "Off")
  680.     ui_set(ref.yaw_base,"At Targets")
  681.     ui_set(ref.yaw[1],"Off")
  682.     ui_set(ref.body_yaw[1],"Static")
  683.     ui_set(ref.body_yaw[2],180)
  684.    
  685.  
  686.     ui_set_visible(ref.enabled, state)
  687.     ui_set_visible(ref.pitch, state)
  688.     ui_set_visible(ref.yaw_base, state)
  689.     ui_set_visible(ref.yaw[1], state)
  690.     ui_set_visible(ref.yaw[2], state)
  691.     ui_set_visible(ref.fsbodyyaw, state)
  692.     ui_set_visible(ref.edgeyaw, state)
  693.     ui_set_visible(ref.roll, state)
  694.     ui_set_visible(ref.body_yaw[1], state)
  695.     ui_set_visible(ref.body_yaw[2], state)
  696.     ui_set_visible(ref.jitter[1], state)
  697.     ui_set_visible(ref.jitter[2], state)
  698.    
  699.  
  700. end
  701.  
  702. menu_visible()
  703.  
  704. ui_set_callback(lby_breaker, function(e)
  705.  
  706.     menu_visible()
  707.  
  708.     local set_callback = ui_get(e) and client_set_event_callback or client_unset_event_callback
  709.  
  710.    
  711.     set_callback("setup_command", desync_func)
  712.     set_callback("paint", indicator_func)
  713.  
  714. end)
  715.  
  716. client_set_event_callback("shutdown", function()
  717.  
  718.     if globals_mapname() == nil then is_mm_state = 0 return end
  719.  
  720.     local is_mm_value = ffi_cast("bool*", game_rule[0] + 124)
  721.  
  722.     if is_mm_value ~= nil then
  723.  
  724.         if is_mm_value[0] == false and is_mm_state == 1 then
  725.  
  726.             is_mm_value[0] = 1
  727.  
  728.             is_mm_state = 0
  729.  
  730.         end
  731.  
  732.     end
  733.  
  734. end)
  735.  
  736.  
  737. client_set_event_callback("paint", function()
  738.    
  739.  
  740. end)
  741.  
  742. local data = {
  743.     side = 1,
  744.     last_side = 0,
  745.  
  746.     last_hit = 0,
  747.     hit_side = 0
  748. }
  749. ---endregion
  750.  
  751. ---region functions
  752. local on_setup_command = function(cmd)
  753.     local local_player = entity_get_local_player()
  754.  
  755.     if not local_player or entity_get_prop(local_player, "m_lifeState") ~= 0 then
  756.         return
  757.     end
  758.    
  759.  
  760.     ui_set(ref.fsbodyyaw, false)
  761.    
  762.     -- Get the server's current time
  763.     local now = globals_curtime()
  764.  
  765.     -- Check if our smart mode behaviour is done
  766.     if data.hit_side ~= 0 and now - data.last_hit > 5 then
  767.         -- If so, set the last side to '0' so the anti-aim updates
  768.         data.last_side = 0
  769.  
  770.         -- And reset the smart mode info
  771.         data.last_hit = 0
  772.         data.hit_side = 0
  773.     end
  774.  
  775.     -- Get what mode our freestanding is using
  776.     local _mode = ui_get(lby.mode)
  777.  
  778.     -- Get some properties
  779.     local x, y, z = client_eye_position()
  780.     local _, yaw = client_camera_angles()
  781.  
  782.     -- Create a table where the trace data will be stored
  783.     local trace_data = {left = 0, right = 0}
  784.  
  785.     for i = yaw - 90, yaw + 90, 30 do
  786.         -- I don't know an alternative for continue so..
  787.         -- Don't do any calculations if the current angle is equal to our yaw
  788.         -- This means that this is the center point and thus it doesn't contribute to the calculations
  789.         if i ~= yaw then
  790.             -- Convert our yaw to radians in order to do further calculations
  791.             local rad = math.rad(i)
  792.  
  793.             -- Calculate our destination point
  794.             local px, py, pz = x + 256 * math.cos(rad), y + 256 * math.sin(rad), z
  795.  
  796.             -- Trace a line from our eye position to the previously calculated point
  797.             local fraction = client_trace_line(local_player, x, y, z, px, py, pz)
  798.             local side = i < yaw and "left" or "right"
  799.  
  800.             -- Add the trace's fraction to the trace table
  801.             trace_data[side] = trace_data[side] + fraction
  802.         end
  803.     end
  804.  
  805.     -- Get which side has the lowest fraction amount, which means that it is closer to us.
  806.     data.side = trace_data.left < trace_data.right and 1 or 2
  807.  
  808.     -- If our side didn't change from the last tick then there's no need to update our anti-aim
  809.     if data.side == data.last_side then
  810.         return
  811.     end
  812.  
  813.     -- If it did change, then update our cached side to do further checks
  814.     data.last_side = data.side
  815.  
  816.     -- Check if we should override our side due to the smart mode
  817.     if data.hit_side ~= 0 then
  818.         data.side = data.hit_side == 1 and 2 or 1
  819.     end
  820.  
  821.     -- Get the fake angle's maximum length and calculate what our next body offset should be
  822.     local limit = 180
  823.     local lby = _mode == "Hide real" and (data.side == 1 and limit or -limit) or (data.side == 1 and -limit or limit)
  824.  
  825.     -- Update our body yaw settings
  826.     ui_set(ref.body_yaw[1], "Static")
  827.     ui_set(ref.body_yaw[2], lby)
  828. end
  829.  
  830.  
  831. local on_player_hurt = function(e)
  832.     -- Check if smart mode is disabled
  833.     if not ui_get(lby.smart) then
  834.         return
  835.     end
  836.  
  837.     -- Get the event's entities
  838.     local userid, attacker = client_userid_to_entindex(e.userid), client_userid_to_entindex(e.attacker)
  839.  
  840.     -- Check if we're the one who got hurt and not the one who hurt us
  841.     if local_player == userid and local_player ~= attacker then
  842.         -- If so, set the last side to '0' so the anti-aim updates
  843.         data.last_side = 0
  844.  
  845.         -- Update our smart mode info
  846.         data.last_hit = globals_curtime()
  847.         data.hit_side = data.side
  848.     end
  849. end
  850.  
  851. local handle_menu_visibility = function(self)
  852.     -- Get if the script is enabled and determine if we should set or unset the callbacks
  853.     local enabled = ui_get(self)
  854.     local callback = enabled and client_set_event_callback or client_unset_event_callback
  855.  
  856.     -- Update the other elements' visibility
  857.     ui_set_visible(lby.smart, enabled)
  858.     -- Register/Unregister our callbacks
  859.     callback("setup_command", on_setup_command)
  860.     callback("player_hurt", on_player_hurt)
  861. end
  862.  
  863. handle_menu_visibility(lby.enable)
  864. ---endregion
  865.  
  866. ui_set_callback(lby.enable, handle_menu_visibility)
  867. ui_set_callback(lby.mode, function(self)
  868.     -- Set the last side to '0' so the anti-aim updates
  869.     data.last_side = 0
  870. end)
  871. ---endregion
  872.  
  873.  
  874. ------------- stupid animation
  875. ---------------------- INTRO ANIMATION ----------------------
  876.  
  877. speed_anim_freq = 120
  878. text_anim_freq = 400
  879. time_to_turn_off = false
  880. real_pos_y = 0
  881. real_alpha = 0
  882. start_ticking = 0
  883. text_alpha = 255
  884. should_animate = "start"
  885. local y = 0
  886. local alpha = 255
  887.  
  888. tab,place = "AA","Anti-aimbot angles"
  889.  
  890.  
  891. local lerp = function(a, b, t)
  892.     return a + (b - a) * t
  893. end
  894.  
  895.  
  896. intro_animation = function()
  897.  
  898.     -------------------> INTRO CHECKS <-------------------
  899.     if not ui.get(lby_breaker) and should_animate == "should_intro" then
  900.         should_animate = "stop_introduction"
  901.     elseif not ui.get(lby_breaker) and should_animate == "stop" then
  902.         should_animate = "stop_introduction"
  903.     elseif ui.get(lby_breaker) and ui.get(misc.stop_intro) == false and should_animate == "start" or should_animate == "stop_intro" then
  904.         should_animate = "should_intro"
  905.     elseif ui.get(lby_breaker) and ui.get(misc.stop_intro) and (should_animate == "start" or should_animate == "should_intro") then
  906.         should_animate = "stop_freeze"
  907.     end
  908.  
  909.    
  910.     -------------------> INTRO START <-------------------
  911.     if should_animate == "should_intro" then
  912.      
  913.         X,Y = client.screen_size()
  914.  
  915.    
  916.         y = lerp(y, Y / 2, globals.frametime() * 2)
  917.  
  918.          if y >= Y / 2 - 10 then
  919.             alpha = lerp(alpha, 0, globals.frametime() * 1)
  920.         end
  921.         -------------------> INTRO TEXT <-------------------
  922.         renderer.rectangle(X - X,Y - Y,X,Y,10,10,10,alpha )
  923.         renderer.text(X / 1.2, y - 5, 255, 255, 255, alpha,"cb+",0,"Papi Yaw Semi-Rage Technology")
  924.         --renderer.text(X / 2, y , 255, 255, 255, alpha,"cb+",0,string.format("User - %s","User"))
  925.  
  926.         -------------------> INTRO STOP <-------------------
  927.         if alpha <= 0 then
  928.             should_animate = "stop"
  929.         end
  930.     end
  931.  
  932. end
  933.  
  934. ----------------------       END       ----------------------
  935.  
  936. client.set_event_callback("paint_ui",function()
  937.  
  938.     if ui.get(lby_breaker) then
  939.         intro_animation()
  940.     end
  941.  
  942. end)
  943.  
  944. local duration = 30
  945. local clantags = {"Papi Yaw ", "Papi Yaw ", "Papi Yaw ", "Papi Ya", "Papi Y", "Papi", "Pap", "Pa", "P", "", "P", "Pa", "Pap", "Papi", "Papi Y", "Papi Ya", "Papi Yaw"}
  946. local clantag_prev
  947. client.set_event_callback("run_command", function()
  948.     if not ui_get(misc.clantag_chg) then return end
  949.   local cur = math.floor(globals.tickcount() / duration) % #clantags
  950.   local clantag = clantags[cur+1]
  951.  
  952.   if clantag ~= clantag_prev then
  953.     clantag_prev = clantag
  954.     client.set_clan_tag(clantag)
  955.   end
  956. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement