SHARE
TWEET

Untitled

a guest Oct 21st, 2019 98 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- ui vars
  2. local ui_get, ui_set, ui_ref = ui.get, ui.set, ui.reference
  3. local client_get_cvar, client_set_cvar = client.get_cvar, client.set_cvar
  4. local ent_get_prop, ent_get_local = entity.get_prop, entity.get_local_player
  5. local globals_curtime = globals.curtime
  6. local globals_tickcount = globals.tickcount
  7. local entity_get_player_weapon = entity.get_player_weapon
  8. local interval_per_tick = globals.tickinterval
  9. local entity_get_players = entity.get_players
  10.  
  11. local hotkey = ui.new_checkbox("lua", "b", "Enable nervos AA")
  12. local resetaa = ui.new_hotkey("lua", "b", "Reset fake on key")
  13. local syncaa = ui.new_hotkey("lua", "b", "Sync fake on key")
  14.  
  15. local chkbox_nervoswalk = ui.new_checkbox("lua", "b", "nervos walk")
  16. local hotkey_nervoswalk = ui.new_hotkey("lua", "b", "nervos walk hotkey")
  17. local slider_nervoswalk = ui.new_slider("lua", "b", "nervos walk speed", 1, 245, 40, true, "%")
  18.  
  19. local ui_left_hotkey = ui.new_hotkey("lua", "b", "Left key")
  20. local ui_left_mode = ui.new_combobox("lua", "b", "Left mode", "Nervos", "Jitter")
  21. local ui_left_offset = ui.new_slider("lua", "b", "Jitter offset", 0, 4, 0)
  22. local ui_right_hotkey = ui.new_hotkey("lua", "b", "Right key")
  23. local ui_right_mode = ui.new_combobox("lua", "b", "Right mode", "Nervos", "Jitter")
  24. local ui_right_offset = ui.new_slider("lua", "b", "Jitter offset", 0, 1, 0)
  25. local ui_backwards_hotkey = ui.new_hotkey("lua", "b", "Backwards key")
  26. local ui_backwards_mode = ui.new_combobox("lua", "b", "Backwards mode", "Nervos")
  27. local ui_freestanding_hotkey = ui.new_hotkey("lua", "b", "Freestanding key")
  28. local ui_indicator_combobox = ui.new_combobox("lua", "b", "Anti-aim indicator", "Off", "Zeus")
  29. local ui_indicator_color_picker = ui.new_color_picker("lua", "b", "Indicator color", "0", "115", "255", "255")
  30.  
  31. -- client vars
  32. local client_log = client.log
  33. local client_draw_text = client.draw_text
  34. local client_screensize = client.screen_size
  35. local client_set_event_callback = client.set_event_callback
  36.  
  37. -- anti-aim references
  38. local yaw_reference, yaw_val_reference = ui_ref("AA", "Anti-aimbot angles", "Yaw")
  39. local yaw_jitter_reference, yaw_jitter_val_reference = ui_ref("AA", "Anti-aimbot angles", "Yaw jitter")
  40. local yaw_base_reference = ui_ref("AA", "Anti-aimbot angles", "Yaw base")
  41. local reference_fake, reference_fake_slider = ui_ref("AA", "Anti-aimbot angles", "body yaw")
  42. local freestanding_reference = ui_ref("AA", "Anti-aimbot angles", "Freestanding")
  43. local on_shot_ref = ui.reference("AA", "Other", "On shot anti-aim")
  44. local duck_peek_ref = ui.reference("RAGE", "Other", "Duck peek assist")
  45.  
  46.  
  47.  
  48.  
  49. local tickcount = globals_tickcount
  50. local lasttick = tickcount()
  51.  
  52. local function timer(delay, f)
  53.     local now = tickcount()
  54.     if lasttick < now - delay then
  55.         f()
  56.         lasttick = now
  57.     end
  58. end
  59.  
  60. local function clamp(min, max, current)
  61.     if current > max then
  62.         current = max
  63.     elseif current < min then
  64.         current = min
  65.     end
  66.     return math.floor(current)
  67. end
  68.  
  69. function IsNumberNegative(intNumber)
  70.     if(string.sub(tostring(intNumber), 1, 1) == "-") then
  71.         return true;
  72.     else
  73.         return false
  74.     end
  75.     return nil
  76. end
  77.  
  78. function round(num, numDecimalPlaces)
  79.     local mult = 10^(numDecimalPlaces or 0)
  80.     return math.floor(num * mult + 0.5) / mult
  81.   end
  82.  
  83. function calc_angle(x_src, y_src, z_src, x_dst, y_dst, z_dst)
  84.     x_delta = x_src - x_dst
  85.     y_delta = y_src - y_dst
  86.     z_delta = z_src - z_dst
  87.     hyp = math.sqrt(x_delta^2 + y_delta^2)
  88.     x = math.atan2(z_delta, hyp) * 57.295779513082
  89.     y = math.atan2( y_delta , x_delta) * 180 / 3.14159265358979323846
  90.  
  91.     if y > 180 then
  92.         y = y - 180
  93.     end
  94.     if y < -180 then
  95.         y = y + 180
  96.     end
  97.     return y
  98. end
  99.  
  100. function get_near_target()
  101.     local enemy_players = entity.get_players(true)
  102.     if #enemy_players ~= 0 then
  103.         local own_x, own_y, own_z = client.eye_position()
  104.         local own_pitch, own_yaw = client.camera_angles()
  105.         local closest_enemy = nil
  106.         local closest_distance = 999999999
  107.                
  108.         for i = 1, #enemy_players do
  109.             local enemy = enemy_players[i]
  110.             local enemy_x, enemy_y, enemy_z = entity.get_prop(enemy, "m_vecOrigin")
  111.                    
  112.             local x = enemy_x - own_x
  113.             local y = enemy_y - own_y
  114.             local z = enemy_z - own_z
  115.  
  116.             local yaw = ((math.atan2(y, x) * 180 / math.pi))
  117.             local pitch = -(math.atan2(z, math.sqrt(math.pow(x, 2) + math.pow(y, 2))) * 180 / math.pi)
  118.  
  119.             local yaw_dif = math.abs(own_yaw % 360 - yaw % 360) % 360
  120.             local pitch_dif = math.abs(own_pitch - pitch ) % 360
  121.                
  122.             if yaw_dif > 180 then yaw_dif = 360 - yaw_dif end
  123.             local real_dif = math.sqrt(math.pow(yaw_dif, 2) + math.pow(pitch_dif, 2))
  124.  
  125.             if closest_distance > real_dif then
  126.                 closest_distance = real_dif
  127.                 closest_enemy = enemy
  128.             end
  129.         end
  130.  
  131.         if closest_enemy ~= nil then
  132.             return closest_enemy, closest_distance
  133.         end
  134.     end
  135.  
  136.     return nil, nil
  137. end
  138.  
  139. local function normalise_angle(angle)
  140.     angle =  angle % 360
  141.     angle = (angle + 360) % 360
  142.     if (angle > 180)  then
  143.         angle = angle - 360
  144.     end
  145.     return angle
  146. end
  147.  
  148. local function is_crouching(ent)
  149.     local flags = ent_get_prop(ent, "m_fFlags")
  150.     local crouching = bit.band(flags, 4)
  151.    
  152.     if crouching == 4 then
  153.         return true
  154.     end
  155.    
  156.     return false
  157. end
  158.  
  159.  
  160. local function setSpeed(newSpeed)
  161.     if newSpeed == 245 then
  162.         return
  163.     end
  164.     local LocalPlayer = ent_get_local
  165.     local vx, vy = ent_get_prop(LocalPlayer(), "m_vecVelocity")
  166.     local velocity = math.floor(math.min(10000, math.sqrt(vx*vx + vy*vy) + 0.5))
  167.     --client.log(velocity)
  168.     local maxvelo = newSpeed
  169.    
  170.     if(velocity<maxvelo) then
  171.         client_set_cvar("cl_sidespeed", maxvelo)
  172.         client_set_cvar("cl_forwardspeed", maxvelo)
  173.         client_set_cvar("cl_backspeed", maxvelo)
  174.     end
  175.    
  176.     if(velocity>=maxvelo) then
  177.         kat=math.atan2(client_get_cvar("cl_forwardspeed"), client_get_cvar("cl_sidespeed"))
  178.         forward=math.cos(kat)*maxvelo;
  179.         side=math.sin(kat)*maxvelo;
  180.         client_set_cvar("cl_sidespeed", side)
  181.         client_set_cvar("cl_forwardspeed", forward)
  182.         client_set_cvar("cl_backspeed", forward)
  183.     end
  184. end
  185.    
  186. -- anti-aim direction/mode bools
  187. local isLeft, isRight, isBack, isFreestanding = false
  188. local deg = 0
  189. -- gets the current antiaim dir/mode
  190. local function get_antiaim_dir()
  191.     if ui_get(ui_freestanding_hotkey) then
  192.         isFreestanding = true
  193.         isLeft, isRight, isBack = false
  194.     elseif ui_get(ui_left_hotkey) then
  195.         isLeft = true
  196.         isFreestanding, isRight, isBack = false
  197.     elseif ui_get(ui_right_hotkey) then
  198.         isRight = true
  199.         isFreestanding, isLeft, isBack = false
  200.     elseif ui_get(ui_backwards_hotkey) then
  201.         isBack = true
  202.         isFreestanding, isLeft, isRight = false
  203.     end
  204. end
  205.  
  206. -- sets the ui values for manual left
  207. local function setLeft()
  208. if ui_get(ui_left_mode) == "Nervos" then
  209.     ui_set(yaw_reference, "180")
  210.    
  211.     if ui_get(resetaa) then
  212.         ui_set(yaw_val_reference, -70)
  213.         ui_set(reference_fake, "jitter")
  214.         ui_set(reference_fake_slider, 9)
  215.         ui_set(yaw_jitter_reference, "off")
  216.     else
  217.         ui_set(yaw_val_reference, 0)
  218.         ui_set(reference_fake, "static")
  219.         ui_set(reference_fake_slider, 171)
  220.         ui_set(yaw_jitter_reference, "off")
  221.     end
  222.    
  223.     ui_set(freestanding_reference, "")     
  224.    
  225.     if ui_get(syncaa) then
  226.         ui_set(yaw_base_reference, "At targets")
  227.     else
  228.         ui_set(yaw_base_reference, "Local view")
  229.     end
  230. elseif ui_get(ui_left_mode) == "Jitter" then
  231.     ui_set(yaw_reference, "180")   
  232.    
  233.     if ui_get(resetaa) then
  234.         ui_set(yaw_val_reference, -70)
  235.         ui_set(reference_fake, "jitter")
  236.         ui_set(reference_fake_slider, 9)
  237.         ui_set(yaw_jitter_reference, "off")
  238.     else
  239.         ui_set(yaw_val_reference, 0)
  240.         local jitter_offset
  241.         ui_set(reference_fake, "jitter")
  242.         if ui_get(ui_left_offset) == 0 then
  243.             jitter_offset = 12
  244.         elseif ui_get(ui_left_offset) == 1 then
  245.             jitter_offset = -110
  246.         elseif ui_get(ui_left_offset) == 2 then
  247.             jitter_offset = 100
  248.         elseif ui_get(ui_left_offset) == 3 then
  249.             jitter_offset = 110
  250.         elseif ui_get(ui_left_offset) == 4 then
  251.             jitter_offset = 119        
  252.         end
  253.         ui_set(reference_fake_slider, jitter_offset)
  254.         ui_set(yaw_jitter_reference, "off")
  255.     end
  256.    
  257.     ui_set(freestanding_reference, "")     
  258.    
  259.     if ui_get(syncaa) then
  260.         ui_set(yaw_base_reference, "At targets")
  261.     else
  262.         ui_set(yaw_base_reference, "Local view")
  263.     end    
  264. end
  265. end
  266.  
  267. -- sets the ui values for manual right
  268. local function setRight()
  269. if ui_get(ui_right_mode) == "Nervos" then
  270.     ui_set(yaw_reference, "180")   
  271.    
  272.     if ui_get(resetaa) then
  273.         ui_set(yaw_val_reference, 90)
  274.         ui_set(reference_fake, "jitter")
  275.         ui_set(reference_fake_slider, 180)
  276.         ui_set(yaw_jitter_reference, "off")
  277.     else
  278.         ui_set(yaw_val_reference, 0)
  279.         ui_set(reference_fake, "static")
  280.         ui_set(reference_fake_slider, -57)
  281.         ui_set(yaw_jitter_reference, "off")
  282.     end
  283.    
  284.     ui_set(freestanding_reference, "")     
  285.    
  286.     if ui_get(syncaa) then
  287.         ui_set(yaw_base_reference, "At targets")
  288.     else
  289.         ui_set(yaw_base_reference, "Local view")
  290.     end
  291. elseif ui_get(ui_right_mode) == "Jitter" then
  292.     ui_set(yaw_reference, "180")   
  293.    
  294.     if ui_get(resetaa) then
  295.         ui_set(yaw_val_reference, 90)
  296.         ui_set(reference_fake, "jitter")
  297.         ui_set(reference_fake_slider, 180)
  298.         ui_set(yaw_jitter_reference, "off")
  299.     else
  300.         ui_set(yaw_val_reference, 0)
  301.         local jitter_offset
  302.         ui_set(reference_fake, "jitter")
  303.         if ui_get(ui_right_offset) == 0 then
  304.             jitter_offset = 144
  305.         elseif ui_get(ui_right_offset) == 1 then
  306.             jitter_offset = 167
  307.         end
  308.         ui_set(reference_fake_slider, jitter_offset)
  309.         ui_set(yaw_jitter_reference, "off")
  310.     end
  311.    
  312.     ui_set(freestanding_reference, "")     
  313.    
  314.     if ui_get(syncaa) then
  315.         ui_set(yaw_base_reference, "At targets")
  316.     else
  317.         ui_set(yaw_base_reference, "Local view")
  318.     end    
  319. end
  320. end
  321.  
  322.  
  323. -- sets the ui values for manual back
  324. local function setBack()
  325. if ui_get(ui_backwards_mode) == "Nervos" then
  326.     ui_set(yaw_reference, "180")
  327.     if ui_get(resetaa) then
  328.         ui_set(yaw_val_reference, 0)
  329.         ui_set(reference_fake, "jitter")
  330.         ui_set(yaw_jitter_reference, "off")
  331.     else
  332.         ui_set(yaw_val_reference, 0)
  333.         ui_set(reference_fake, "opposite")
  334.         ui_set(yaw_jitter_reference, "offset")
  335.         ui_set(yaw_jitter_val_reference, 0)
  336.     end
  337.    
  338.     ui_set(freestanding_reference, "")     
  339.    
  340.     if ui_get(syncaa) then
  341.         ui_set(yaw_base_reference, "At targets")
  342.     else
  343.         ui_set(yaw_base_reference, "Local view")
  344.     end
  345. end
  346. end
  347.  
  348. -- sets the ui values for freestanding
  349. local function setFreestanding()   
  350.     ui_set(yaw_reference, "180")
  351.     ui_set(yaw_base_reference, "local view")
  352.     ui_set(yaw_val_reference, 0)
  353.     ui_set(reference_fake, "opposite")
  354.     ui_set(yaw_jitter_reference, "offset")
  355.     ui_set(yaw_jitter_val_reference, 10)
  356.     ui_set(freestanding_reference, "Default")
  357.  
  358.  
  359. end
  360.  
  361. local function on_paint(c)
  362.  
  363.     if not ui_get(hotkey) then return end
  364.    
  365.     local vel_x = ent_get_prop(ent_get_local(), "m_vecVelocity[0]")
  366.     local vel_y = ent_get_prop(ent_get_local(), "m_vecVelocity[1]")
  367.     local vel_z = ent_get_prop(ent_get_local(), "m_vecVelocity[2]")
  368.     local vel = math.sqrt(vel_x * vel_x + vel_y * vel_y + vel_z * vel_z)
  369.    
  370.     local scrsize_x, scrsize_y = client_screensize()
  371.     local center_x, center_y = scrsize_x / 2, scrsize_y / 2
  372.    
  373.     local indicator = ui_get(ui_indicator_combobox)
  374.     local indicator_r, indicator_g, indicator_b, indicator_a = ui_get(ui_indicator_color_picker)
  375.  
  376.     if ui_get(resetaa) then
  377.         client_draw_text(ctx, center_x, center_y+40, 255, 0, 0, 255, nil, 0, "RESET YAW")
  378.     else
  379.         client_draw_text(ctx, center_x, center_y+40, 177, 151, 255, 255, nil, 0, "FAKE YAW")
  380.     end
  381.    
  382.     if ui_get(syncaa) then
  383.         client_draw_text(ctx, center_x, center_y+50, 209, 139, 230, 255, nil, 0, "DYNAMIC")
  384.     else
  385.         client_draw_text(ctx, center_x, center_y+50, 255, 0, 0, 255, nil, 0, "DEFAULT")
  386.     end
  387.    
  388.     ui_set(on_shot_ref, not ui_get(duck_peek_ref))
  389.  
  390.     get_antiaim_dir()
  391.  
  392.     if isFreestanding then
  393.         setFreestanding()
  394.         if indicator == "Zeus" then
  395.             client_draw_text(c, center_x, center_y + 45, 255, 255, 255, 255, "c+", 0, "V")
  396.             client_draw_text(c, center_x + 45, center_y, 255, 255, 255, 255, "c+", 0, ">")
  397.             client_draw_text(c, center_x - 45, center_y, 255, 255, 255, 255, "c+", 0, "<")
  398.         end
  399.     elseif isLeft then
  400.         setLeft()
  401.         if indicator == "Zeus" then
  402.             client_draw_text(c, center_x - 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "<")
  403.             client_draw_text(c, center_x, center_y + 45, 255, 255, 255, 255, "c+", 0, "V")
  404.             client_draw_text(c, center_x + 45, center_y, 255, 255, 255, 255, "c+", 0, ">")
  405.         end
  406.     elseif isRight then
  407.         setRight()
  408.         if indicator == "Zeus" then
  409.             client_draw_text(c, center_x + 45, center_y, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, ">")
  410.             client_draw_text(c, center_x, center_y + 45, 255, 255, 255, 255, "c+", 0, "V")
  411.             client_draw_text(c, center_x - 45, center_y, 255, 255, 255, 255, "c+", 0, "<")
  412.         end
  413.     elseif isBack then
  414.         setBack()
  415.         if indicator == "Zeus" then
  416.             client_draw_text(c, center_x, center_y + 45, indicator_r, indicator_g, indicator_b, indicator_a, "c+", 0, "V")
  417.             client_draw_text(c, center_x + 45, center_y, 255, 255, 255, 255, "c+", 0, ">")
  418.             client_draw_text(c, center_x - 45, center_y, 255, 255, 255, 255, "c+", 0, "<")
  419.         end
  420.     end
  421.    
  422. end
  423.  
  424.  
  425. client_set_event_callback("run_command", function ()
  426.     if not ui_get(chkbox_nervoswalk) then
  427.         return
  428.     end
  429.  
  430.     if not ui_get(hotkey_nervoswalk) then
  431.         setSpeed(450)
  432.     else
  433.         setSpeed(ui_get(slider_nervoswalk))
  434.     end
  435. end)
  436.  
  437.  
  438. -- error handling
  439. local err = client_set_event_callback('paint', on_paint)
  440.  
  441. -- log error to console
  442. if err then
  443.     client_log('set_event_callback failed: ', err)
  444. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top