Advertisement
Mister_Stefan

aaotv4js

Jun 24th, 2021
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var flipper = 1;
  2. function doFlip() {
  3.     flipper *= -1;
  4. }
  5.  
  6. var font = false;
  7. function drawAALine(angle, len, color, text) {
  8.     var origin = Entity.GetProp(Entity.GetLocalPlayer(), "DT_BaseEntity", "m_vecOrigin");
  9.    
  10.     var angleRad = angle * (Math.PI / 180);
  11.     var endPos = [origin[0], origin[1], origin[2]];
  12.     endPos[0] += Math.cos(angleRad) * len;
  13.     endPos[1] += Math.sin(angleRad) * len;
  14.    
  15.     var originScreen = Render.WorldToScreen(origin);
  16.     var endScreen = Render.WorldToScreen(endPos);
  17.    
  18.     Render.Line(originScreen[0], originScreen[1], endScreen[0], endScreen[1], color);
  19.     Render.String(endScreen[0]+1, endScreen[1]+1, 1, text, [0,0,0,255], font);
  20.     Render.String(endScreen[0], endScreen[1], 1, text, color, font);
  21. }
  22.  
  23. function render() {
  24.     font = Render.GetFont("Arial.ttf", 12, true);
  25.    
  26.     // Draw Antiaim Lines
  27.     if (Entity.IsValid(Entity.GetLocalPlayer())) {
  28.         drawAALine(Local.GetFakeYaw(), 40, [0, 150, 255, 255], "FAKE");
  29.         drawAALine(Local.GetRealYaw(), 45, [255, 0, 0, 255], "REAL");
  30.        
  31.         var delta = Math.abs(Math.round(Local.GetFakeYaw() - Local.GetRealYaw()));
  32.         if (delta > 180) { // Angle normalize
  33.             delta -= 360;
  34.         }
  35.  
  36.         drawAALine(Local.GetRealYaw(), 0, [255, 255, 255, 255], "DELTA: " + Math.abs(delta));
  37.     }
  38. }
  39.  
  40. var lastMove = false; // If we were moving last tick
  41. var low = false; // Low delta
  42. var ticker = 0; // Ticker for timing
  43. function run() {
  44.     ticker++;
  45.     var v = Entity.GetProp(Entity.GetLocalPlayer(), "DT_CSPlayer", "m_vecVelocity[0]");
  46.     var speed = Math.sqrt(v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
  47.     var shouldSwitch = (speed > 1) != lastMove;
  48.     var crouch = Entity.GetProp(Entity.GetLocalPlayer(), "CCSPlayer", "m_flDuckAmount") > 0.4;
  49.    
  50.     var deviator = Math.round(Globals.Realtime()*300) % 100;
  51.     deviator /= 1000;
  52.     var mult = flipper;
  53.  
  54.     // Helps prevent side logging
  55.     if (shouldSwitch && deviator > 0.4) {
  56.         flipper *= -1;
  57.         if (deviator > 0.6) {
  58.             low = !low;
  59.         }
  60.     }
  61.    
  62.     AntiAim.SetOverride(1);
  63.     if (speed < 1) { // Standing AA
  64.         AntiAim.SetLBYOffset(-60 * mult + deviator*6*mult);
  65.         AntiAim.SetRealOffset(-14 * mult);
  66.         AntiAim.SetFakeOffset(5 * mult * deviator);
  67.     } else { // Moving AA
  68.         var delta = 51 * flipper; // Don't use maxdelta to prevent resolver logging
  69.        
  70.         // Low delta
  71.         if (low) {
  72.             delta /= 5;
  73.            
  74.             // Trick (some) resolvers into thinking we are high-delta
  75.             // by occasionally flicking to max delta
  76.             if (ticker % 20 == 0) {
  77.                 delta *= 8; // This should trigger animlayer check (not sure tho)
  78.             }
  79.         }
  80.        
  81.         AntiAim.SetRealOffset(delta);
  82.         AntiAim.SetFakeOffset(-delta/2);
  83.     }
  84.    
  85.     lastMove = speed > 1; // Set move for next tick
  86. }
  87.  
  88. Cheat.RegisterCallback("bullet_impact", "doFlip");
  89. Cheat.RegisterCallback("CreateMove", "run");
  90.  
  91. // Comment out this line if you don't want the REAL and FAKE lines.
  92. Cheat.RegisterCallback("Draw", "render");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement