Advertisement
Guest User

project entropy

a guest
Dec 15th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 28.78 KB | None | 0 0
  1. local luaName = "Project Entropy";
  2. local luaKey = 'lynx_' .. luaName:lower():gsub(" ", "_") .. '_';
  3. local mx, my;
  4. local curTab = 1;
  5. local ui = {};
  6. local windowInfo;
  7. local settingsLoaded = false;
  8. local caches = {
  9.     vis_view_fov = gui.GetValue("vis_view_fov"),
  10.     clr_chams_ghost_client = { gui.GetValue('clr_chams_ghost_client') },
  11.     clr_chams_ghost_server = { gui.GetValue('clr_chams_ghost_server') },
  12.     rbot_delayshot = gui.GetValue('rbot_delayshot');
  13.     msc_fakelatency_enable = gui.GetValue('msc_fakelatency_enable');
  14.     msc_fakelag_enable = gui.GetValue('msc_fakelag_enable'),
  15.     msc_fakelag_mode = gui.GetValue('msc_fakelag_mode'),
  16.     msc_fakelag_key = gui.GetValue('msc_fakelag_key'),
  17.     msc_fakelag_attack = gui.GetValue('msc_fakelag_attack')
  18. }
  19. --[==========================[Utils]==========================]
  20. local function drawRectFill(r, g, b, a, x, y, w, h)
  21.     draw.Color(r, g, b, a);
  22.     draw.RoundedRectFill(x, y, x + w, y + h);
  23. end
  24.  
  25. local function drawOutline(r, g, b, x, y, w, h)
  26.     for i = 1, 15 do
  27.         local a = 255 / i * h;
  28.         draw.Color(r, g, b, a);
  29.         draw.OutlinedRect(x - i, y - i, x + w + i, y + h + i)
  30.     end
  31. end
  32.  
  33. local function drawText(r, g, b, a, x, y, text, font)
  34.     draw.SetTexture(r, g, b, a);
  35.     if (font ~= nil) then
  36.         draw.SetFont(font);
  37.     end
  38.     draw.Color(r, g, b, a);
  39.     if (text ~= nil) then
  40.         draw.Text(x, y, text);
  41.         return draw.GetTextSize(text);
  42.     end
  43.     return 0, 0;
  44. end
  45.  
  46. local references = {
  47.     aimware = gui.Reference("MENU"),
  48.     miscGeneral = gui.Reference("SETTINGS", string.char(77, 105, 115, 99, 101, 108, 108, 97, 110, 101, 111, 117, 115));
  49. };
  50. local fonts = {
  51.     ['tab'] = draw.CreateFont("Segoe UI", 16, 600);
  52. }
  53.  
  54. --[==========================[Start Lynx API]==========================]
  55. local function inBounds(x, y, x1, y1)
  56.     return mx >= x and mx <= x1 and my >= y and my <= y1;
  57. end
  58.  
  59. local function unpack(t, i)
  60.     i = i or 1
  61.     if t[i] ~= nil then
  62.         return t[i], unpack(t, i + 1)
  63.     end
  64. end
  65.  
  66. local function addGuiComp(key, comp, group, ...)
  67.     ui[#ui + 1] = { luaKey .. key, _G['gui'][comp](group, luaKey .. key, ...) };
  68. end
  69.  
  70. local function getUIVar(key)
  71.     for i = 1, #ui do
  72.         local v = ui[i];
  73.         if (v[1] == luaKey .. key) then
  74.             return v[2]:GetValue();
  75.         end
  76.     end
  77. end
  78. --[==========================[End Lynx API]==========================]
  79. local showMenu = gui.Checkbox(references.miscGeneral, luaKey .. "showmenu", "[Lynx] " .. luaName, false);
  80. local mainWindow = gui.Window("test_window", "Project Entropy by Lamarr and Clairnet - Presented by Lamarr", 100, 100, 800, 70);
  81.  
  82. local subWindows = {
  83.     gui.Window("lynx_etropy_rage_tab", "", 0, 0, 800, 530);
  84.     gui.Window("lynx_etropy_legit_tab", "", 0, 0, 800, 530);
  85.     gui.Window("lynx_etropy_visuals_tab", "", 0, 0, 800, 530);
  86. }
  87.  
  88. -- Rage Window
  89. local groupW = 240;
  90. local groupH = 430;
  91. local rageWindow = subWindows[1];
  92.  
  93. -- Anti Aim Preset
  94. local antiAimPresetH = 120;
  95. local antiAim = gui.Groupbox(rageWindow, "Anti-Aim-Presets", 20, 15, groupW, antiAimPresetH);
  96. local presets = { "Custom", "Standard", "Special", "God Spin" };
  97. addGuiComp("standing_anti_aim", "Combobox", antiAim, "Standing AA Preset", unpack(presets));
  98. addGuiComp("moving_anti_aim", "Combobox", antiAim, "Moving AA Preset", unpack(presets));
  99.  
  100. -- Fake Lag
  101. local slowWalkH = 120;
  102. local slowWalk = gui.Groupbox(rageWindow, "Slow Walk", 20, 15 * 2 + slowWalkH, groupW, 160);
  103. addGuiComp("slowwalk_fakelag", "Checkbox", slowWalk, "Slow Walk Fake Lag", true);
  104. addGuiComp("slowwalk_shuffle_mode", "Combobox", slowWalk, "Slow Walk Fakelag Mode", "Factor", "Switch", "Adaptive", "Random", "Peek", "Rapid Peek");
  105. addGuiComp("slowwalk_shuffle_ws", "Checkbox", slowWalk, "Slow Walk Fake Lag While Shooting", false);
  106.  
  107. -- Resolver
  108. local resolver = gui.Groupbox(rageWindow, "Resolver", 20, 15 * 3 + slowWalkH * 2 + 40, groupW, 120);
  109. addGuiComp("scout_resolver_key", "Keybox", resolver, "Scout Resolver", 4);
  110. local resolverCustomizations = gui.Multibox(resolver, "Scout Resolver Customization");
  111. addGuiComp("scout_resolver_fakelatency", "Checkbox", resolverCustomizations, "Disable Fake latency", false);
  112. addGuiComp("scout_resolver_delayshot", "Checkbox", resolverCustomizations, "Accurate Unlag", false);
  113.  
  114. -- Anti Aim Standing
  115. local antiAimStanding = gui.Groupbox(rageWindow, "Standing Anti-Aim", 20 * 2 + groupW, 15, groupW, groupH);
  116.  
  117. -- Anti Aim Moving
  118. local antiAimMoving = gui.Groupbox(rageWindow, "Moving Anti-Aim", 20 * 3 + groupW * 2, 15, groupW, groupH);
  119.  
  120. -- Anti Aim Settings
  121. local antiAimComps = {
  122.     { "desync_cycle_speed", "Combobox", { "Desync Cycle Speed", "Off", "Low", "Medium", "High", "Very High", "Extreme" } },
  123.     { "real_cycle_speed", "Combobox", { "Yaw Cycle Speed", "Off", "Low", "Medium", "High", "Very High", "Extreme" } },
  124.     { "real_swap_speed", "Combobox", { "Angle Swap Speed", "Off", "Low", "Medium", "High", "Very High", "Extreme" } },
  125.     { "desync_inverse", "Combobox", { "Inverse on Desync", "Off", "Match", "Reverse", "Wide Match", "Wide Reverse", "Half Match", "Half Reverse" } },
  126.     { "desync_1", "Combobox", { "Desync 1", "Off", "Still", "Balance", "Stretch", "Jitter" } },
  127.     { "desync_2", "Combobox", { "Desync 2", "Off", "Still", "Balance", "Stretch", "Jitter" } },
  128.     { "desync_3", "Combobox", { "Desync 3", "Off", "Still", "Balance", "Stretch", "Jitter" } },
  129.     { "real_1", "Combobox", { "Real 1", "Off", "Static", "Spinbot", "Jitter", "Zero", "Switch", "Shift" } },
  130.     { "real_2", "Combobox", { "Real 2", "Off", "Static", "Spinbot", "Jitter", "Zero", "Switch", "Shift" } },
  131.     { "real_3", "Combobox", { "Real 3", "Off", "Static", "Spinbot", "Jitter", "Zero", "Switch", "Shift" } },
  132.     { "angle_1", "Slider", { "Custom Angle (Default: -90)", -90, -180, 180 } },
  133.     { "angle_2", "Slider", { "Custom Angle (Default: 90)", 90, -180, 180 } }
  134. }
  135.  
  136. for i = 1, #antiAimComps do
  137.     local antiAimComp = antiAimComps[i];
  138.     addGuiComp(antiAimComp[1], antiAimComp[2], antiAimStanding, unpack(antiAimComp[3]));
  139.     addGuiComp(antiAimComp[1] .. '_moving', antiAimComp[2], antiAimMoving, unpack(antiAimComp[3]));
  140. end
  141.  
  142. -- Legit Window
  143. local groupW = 240;
  144. local groupH = 430;
  145. local legitWindow = subWindows[2];
  146.  
  147. -- Curve
  148. local curve = gui.Groupbox(legitWindow, "Curve", 20, 15, groupW, groupH);
  149.  
  150. -- smoothing
  151. local smoothing = gui.Groupbox(legitWindow, "Smoothing", 20 * 2 + groupW, 15, groupW, groupH);
  152.  
  153. local legitWeapons = { "Pistol", "SMG", "Rifle", "Shotgun", "Sniper" }
  154. for i = 1, #legitWeapons do
  155.     local legitWeapon = legitWeapons[i];
  156.     local var = legitWeapon:lower();
  157.     addGuiComp('lbot_' .. var .. '_curve', 'Checkbox', curve, legitWeapon .. ' Random Curve', false)
  158.     addGuiComp('lbot_' .. var .. '_curve_min', 'Slider', curve, legitWeapon .. ' Random Curve Min', 0.2, 0, 2)
  159.     addGuiComp('lbot_' .. var .. '_curve_max', 'Slider', curve, legitWeapon .. ' Random Curve Max', 0.4, 0, 2)
  160.     addGuiComp('lbot_' .. var .. '_smooth', 'Checkbox', smoothing, legitWeapon .. ' Random Smooth', false)
  161.     addGuiComp('lbot_' .. var .. '_smooth_min', 'Slider', smoothing, legitWeapon .. ' Random Smooth Min', 5, 1, 30)
  162.     addGuiComp('lbot_' .. var .. '_smooth_max', 'Slider', smoothing, legitWeapon .. ' Random Smooth Max', 6, 1, 30)
  163. end
  164.  
  165. -- Anti Aim Moving
  166. local legitMisc = gui.Groupbox(legitWindow, "Miscellaneous", 20 * 3 + groupW * 2, 15, groupW, groupH);
  167. addGuiComp('lbot_triggerbot', 'Checkbox', legitMisc, "Randomize Triggerbot", false);
  168. addGuiComp('lbot_triggerbot_min', 'Slider', legitMisc, "Minimum Triggerbot Delay", 0.03, 0.00, 1.00);
  169. addGuiComp('lbot_triggerbot_max', 'Slider', legitMisc, "Maximum Triggerbot Delay", 0.03, 0.00, 1.00);
  170. addGuiComp('lbot_backtrack', 'Checkbox', legitMisc, "Randomize Backtrack", false);
  171. addGuiComp('lbot_backtrack_min', 'Slider', legitMisc, "Minimum Backtrack Ticks", 0.001, 0, 0.2);
  172. addGuiComp('lbot_backtrack_max', 'Slider', legitMisc, "Maximum Backtrack Ticks", 0.001, 0, 0.2);
  173.  
  174. -- Visuals Window
  175. local visualsWindow = subWindows[3];
  176. local main = gui.Groupbox(visualsWindow, "Main", 20, 15, groupW, groupH);
  177. addGuiComp('custom_hit_sound', 'Combobox', main, "Hitsound", "Off", "Entropy", "Skeet", "Chicken", "Casino");
  178. addGuiComp('kill_effect', 'Combobox', main, "Kill Effect", "Off", "Red", "Green", "Blue");
  179. addGuiComp('full_bright', 'Checkbox', main, "Fullbright", false);
  180. addGuiComp('watermark', 'Checkbox', main, "Watermark", false);
  181. addGuiComp('engine_radar', 'Checkbox', main, "Engine Radar", false);
  182. addGuiComp('disable_postprocess', 'Checkbox', main, "Disable Post-Processing", false);
  183. addGuiComp('sniper_crosshair', 'Checkbox', main, "Force Crosshair on Sniper", false);
  184. addGuiComp('double_scope', 'Checkbox', main, "Zoom on Double Scope", false);
  185. addGuiComp('transparent_on_scope', 'Checkbox', main, "Transparent on Scope", false);
  186. addGuiComp('spread_tracers', 'Checkbox', main, "Spread Tracers", false);
  187. addGuiComp('spread_tracers_duration', 'Slider', main, "Spread Tracer Duration", 2, 1, 10);
  188. local RGBChams = gui.Multibox(main, "RGB Chams");
  189. local RGBVars = { "clr_vis_glow_ct", "clr_vis_glow_t", "clr_vis_glow_other", "clr_vis_glow_local", "clr_chams_ct_vis", "clr_chams_ct_invis", "clr_chams_t_vis", "clr_chams_t_invis", "clr_chams_other_vis", "clr_chams_other_invis", "clr_chams_weapon_primary", "clr_chams_weapon_secondary", "clr_chams_ghost_client", "clr_chams_ghost_server", "clr_chams_historyticks", "clr_esp_box_ct_vis", "clr_esp_box_ct_invis", "clr_esp_box_t_vis", "clr_esp_box_t_invis", "clr_esp_box_other_vis", "clr_esp_box_other_invis", "clr_esp_crosshair_recoil" }
  190. -- Too Lazy To Do this rn
  191. local RGBNames = {}
  192. for i = 1, #RGBVars do
  193.     local RGBVar = RGBVars[i];
  194.     -- TODO: Take from RGBNames instead of setting var as name
  195.     addGuiComp(luaKey .. RGBVar .. '_rgb', 'Checkbox', RGBChams, RGBVar, false);
  196. end
  197.  
  198. -- Tab
  199. gui.Custom(mainWindow, "lynx_entropy_tab", 155, 5, 0, 0, function(x, y)
  200.     local tabs = { 'RAGE', 'LEGIT', "VISUALS" };
  201.     local dpiscale = gui.GetValue("dpi_Scale");
  202.     for i, v in ipairs(tabs) do
  203.         local w, h = 101 * dpiscale, 30 * dpiscale;
  204.         local x = x + (w * i);
  205.         local inBound = inBounds(x, y, x + w, y + h);
  206.         curTab = (inBound and input.IsButtonPressed(1)) and i or curTab;
  207.  
  208.         -- Render Tab Background
  209.         draw.Color(gui.GetValue('clr_gui_tablist' .. ((i == curTab or inBound) and '2' or '1')));
  210.         draw.FilledRect(x, y, x + w, y + h);
  211.  
  212.         -- Render Tab Text
  213.         draw.SetFont(fonts['tab']);
  214.         local tw, th = draw.GetTextSize(v);
  215.         draw.Color(gui.GetValue('clr_gui_tablist4'));
  216.         draw.Text(x + (w - tw) / 2, y + (h - th) / 2, v);
  217.     end
  218. end);
  219.  
  220. local function getSmoothRandom(min, max, mult)
  221.     return (getUIVar(min) + mult + math.random() * (getUIVar(max) - getUIVar(min)));
  222. end
  223.  
  224. local function makeLegitSmooth(var, var2, min, max, mult)
  225.     if (getUIVar(var)) then
  226.         gui.SetValue(var2, getSmoothRandom(min, max, mult));
  227.     end
  228. end
  229.  
  230. --[==========================[START Anti Aim Functions]==========================]
  231. local function doCycle(var, ui1, ui2, ui3, speed)
  232.     local cache = caches[var];
  233.     if (cache == nil) then
  234.         caches[var] = { ['ticks'] = 0, ['change'] = false, ['swap'] = false };
  235.         cache = caches[var];
  236.     end
  237.     local ticks, change, swap = cache['ticks'], cache['change'], cache['swap'];
  238.  
  239.     local speed = getUIVar(speed);
  240.     if (ticks > 25) then
  241.         if (change) then
  242.             gui.SetValue(var, swap and getUIVar(ui1) or getUIVar(ui2));
  243.             cache['swap'] = not cache['swap'];
  244.             cache['change'] = false;
  245.         else
  246.             gui.SetValue(var, getUIVar(ui3));
  247.             cache['change'] = true;
  248.         end
  249.         ticks = 0;
  250.     end
  251.     cache['ticks'] = speed > 0 and (ticks + speed) or 0;
  252. end
  253.  
  254. local function doYawSwap(var, speedVar, angle1, angle2)
  255.     local cache = caches[var];
  256.     if (cache == nil) then
  257.         caches[var] = { ['ticks'] = 0 };
  258.         cache = caches[var];
  259.     end
  260.     local speed, ticks = getUIVar(speedVar), cache['ticks'];
  261.     if (speed) then
  262.         if ticks > 20 then
  263.             if ticks > 40 then
  264.                 gui.SetValue(var, getUIVar(angle1));
  265.                 cache['ticks'] = 0;
  266.                 return
  267.             end
  268.         end
  269.         gui.SetValue(var, getUIVar(angle2));
  270.         cache['ticks'] = ticks + speed;
  271.     end
  272. end
  273.  
  274. local function inverseDesync(var, var2, var3, var4)
  275.     local inverseDesync = getUIVar(var);
  276.     if (inverseDesync > 0) then
  277.         gui.SetValue(var2, 0);
  278.         --ui[var2]:SetValue(0);
  279.         local values = { 58, -58, 116, -116, 29, -29 };
  280.         local curValue = values[inverseDesync];
  281.         local desync = gui.GetValue(var3);
  282.         if (desync == 2 or desync == 3) then
  283.             gui.SetValue(var4, desync == 2 and curValue or (0 - curValue));
  284.         end
  285.     end
  286. end
  287.  
  288. local function handleSimpleAA(var, settings)
  289.  
  290.     if (getUIVar(var) == nil or getUIVar(var) == 0) then
  291.         return
  292.     end
  293.  
  294.     local curSettings = settings[getUIVar(var)];
  295.     for i = 1, #curSettings do
  296.         local sVar, sValue = curSettings[i][1], curSettings[i][2];
  297.         gui.SetValue(sVar, sValue);
  298.     end
  299. end
  300.  
  301. local function handlePresets()
  302.     -- Standing
  303.     local settings = {
  304.         {
  305.             { luaKey .. 'desync_cycle_speed', 1 },
  306.             { luaKey .. 'real_cycle_speed', 0 },
  307.             { luaKey .. 'real_swap_speed', 0 },
  308.             { luaKey .. 'desync_inverse', 5 },
  309.             { luaKey .. 'desync_1', 2 },
  310.             { luaKey .. 'desync_2', 2 },
  311.             { luaKey .. 'desync_3', 3 },
  312.             { "rbot_antiaim_stand_real", 1 },
  313.         },
  314.         {
  315.             { luaKey .. 'desync_cycle_speed', 1 },
  316.             { luaKey .. 'real_cycle_speed', 0 },
  317.             { luaKey .. 'real_swap_speed', 0 },
  318.             { luaKey .. 'desync_inverse', 0 },
  319.             { luaKey .. 'desync_1', 2 },
  320.             { luaKey .. 'desync_2', 3 },
  321.             { luaKey .. 'desync_3', 1 },
  322.             { "rbot_antiaim_stand_real", 1 },
  323.             { "rbot_antiaim_stand_switch_speed", .15 },
  324.             { "rbot_antiaim_stand_switch_range", 26 },
  325.             { "rbot_antiaim_stand_real_add", 16 },
  326.         },
  327.         {
  328.             { luaKey .. 'desync_cycle_speed', 1 },
  329.             { luaKey .. 'real_cycle_speed', 0 },
  330.             { luaKey .. 'real_swap_speed', 0 },
  331.             { luaKey .. 'desync_inverse', 0 },
  332.             { luaKey .. 'desync_1', 2 },
  333.             { luaKey .. 'desync_2', 3 },
  334.             { luaKey .. 'desync_3', 1 },
  335.             { "rbot_antiaim_stand_real", 2 },
  336.             { "rbot_antiaim_stand_spinbot_speed", -0.8 },
  337.         }
  338.     }
  339.     handleSimpleAA('standing_anti_aim', settings);
  340.  
  341.     -- Moving
  342.     local settings = {
  343.         {
  344.             { luaKey .. 'desync_cycle_speed_moving', 1 },
  345.             { luaKey .. 'real_cycle_speed_moving', 0 },
  346.             { luaKey .. 'real_swap_speed_moving', 0 },
  347.             { luaKey .. 'desync_inverse_moving', 5 },
  348.             { luaKey .. 'desync_1_moving', 2 },
  349.             { luaKey .. 'desync_2_moving', 2 },
  350.             { luaKey .. 'desync_3_moving', 3 },
  351.             { "rbot_antiaim_move_real", 1 },
  352.         },
  353.         {
  354.             { luaKey .. 'desync_cycle_speed_moving', 1 },
  355.             { luaKey .. 'real_cycle_speed_moving', 0 },
  356.             { luaKey .. 'real_swap_speed_moving', 0 },
  357.             { luaKey .. 'desync_inverse_moving', 0 },
  358.             { luaKey .. 'desync_1_moving', 2 },
  359.             { luaKey .. 'desync_2_moving', 3 },
  360.             { luaKey .. 'desync_3_moving', 1 },
  361.             { "rbot_antiaim_move_real", 1 },
  362.             { "rbot_antiaim_move_switch_speed", .15 },
  363.             { "rbot_antiaim_move_switch_range", 26 },
  364.             { "rbot_antiaim_move_real_add", 16 },
  365.         },
  366.         {
  367.             { luaKey .. 'desync_cycle_speed_moving', 1 },
  368.             { luaKey .. 'real_cycle_speed_moving', 0 },
  369.             { luaKey .. 'real_swap_speed_moving', 0 },
  370.             { luaKey .. 'desync_inverse_moving', 0 },
  371.             { luaKey .. 'desync_1_moving', 2 },
  372.             { luaKey .. 'desync_2_moving', 3 },
  373.             { luaKey .. 'desync_3_moving', 1 },
  374.             { "rbot_antiaim_move_real", 2 },
  375.             { "rbot_antiaim_move_spinbot_speed", -0.8 },
  376.         }
  377.     };
  378.     handleSimpleAA('moving_anti_aim', settings);
  379. end
  380.  
  381. --[==========================[END Anti Aim Functions]==========================]
  382.  
  383.  
  384. --[==========================[Handlers]==========================]
  385.  
  386. local function handleAntiAim()
  387.  
  388.     -- Standing
  389.     doCycle('rbot_antiaim_stand_desync', 'desync_1', 'desync_2', 'desync_3', 'desync_cycle_speed');
  390.     doCycle('rbot_antiaim_stand_real', 'real_1', 'real_2', 'real_3', 'real_cycle_speed');
  391.     doYawSwap('rbot_antiaim_stand_real_add', 'real_swap_speed', 'angle_1', 'angle_2');
  392.     inverseDesync('desync_inverse', luaKey .. 'real_swap_speed', 'rbot_antiaim_stand_desync', 'rbot_antiaim_stand_real_add');
  393.  
  394.     -- Moving
  395.     doCycle('rbot_antiaim_move_desync', 'desync_1_moving', 'desync_2_moving', 'desync_3_moving', 'desync_cycle_speed_moving');
  396.     doCycle('rbot_antiaim_move_real', 'real_1_moving', 'real_2_moving', 'real_3_moving', 'real_cycle_speed_moving');
  397.     doYawSwap('rbot_antiaim_move_real_add', 'real_swap_speed_moving', 'angle_1_moving', 'angle_2_moving');
  398.     inverseDesync('desync_inverse_moving', luaKey .. 'real_swap_speed_moving', 'rbot_antiaim_move_desync', 'rbot_antiaim_move_real_add');
  399. end
  400.  
  401. local function handleResolver()
  402.     -- Scout Resolver
  403.     local scoutResolverKey = getUIVar('scout_resolver_key');
  404.     if (scoutResolverKey > 0 and input.IsButtonDown(scoutResolverKey)) then
  405.         local msc_fakelatency_enable, rbot_delayshot = caches['msc_fakelatency_enable'], caches['rbot_delayshot'];
  406.         local scoutFakeLag, scoutDelayshot = getUIVar('scout_resolver_fakelatency'), getUIVar('scout_resolver_delayshot');
  407.         gui.SetValue('msc_fakelatency_enable', scoutFakeLag and false or msc_fakelatency_enable);
  408.         gui.SetValue('rbot_delayshot', scoutDelayshot and 1 or rbot_delayshot);
  409.     end
  410. end
  411.  
  412. local function handleSlowwalk()
  413.     -- Slow-Walk Shuffle
  414.     local slowwalkShuffle = getUIVar('slowwalk_fakelag');
  415.     local slowwalkKey = gui.GetValue("msc_slowwalk");
  416.     if (slowwalkShuffle) then
  417.         local isSlowwalking = slowwalkKey > 0 and input.IsButtonDown(slowwalkKey);
  418.         local fakeLagVars = { 'msc_fakelag_attack', 'msc_fakelag_mode', 'msc_fakelag_enable', 'msc_fakelag_key' };
  419.         local override = { getUIVar('slowwalk_shuffle_ws'), getUIVar('slowwalk_shuffle_mode'), true, slowwalkKey }
  420.         for i = 1, #fakeLagVars do
  421.             local var = fakeLagVars[i];
  422.             gui.SetValue(var, isSlowwalking and override[i] or caches[var]);
  423.         end
  424.     end
  425. end
  426.  
  427. local function handleLegitbot()
  428.     -- Curve
  429.     makeLegitSmooth('lbot_pistol_curve', 'lbot_pistol_curve', 'lbot_pistol_curve_min', 'lbot_pistol_curve_max', 0.1);
  430.     makeLegitSmooth('lbot_smg_curve', 'lbot_smg_curve', 'lbot_smg_curve_min', 'lbot_smg_curve_max', 0.1);
  431.     makeLegitSmooth('lbot_shotgun_curve', 'lbot_shotgun_curve', 'lbot_shotgun_curve_min', 'lbot_shotgun_curve_max', 0.1);
  432.     makeLegitSmooth('lbot_rifle_curve', 'lbot_rifle_curve', 'lbot_rifle_curve_min', 'lbot_rifle_curve_max', 0.1);
  433.     makeLegitSmooth('lbot_sniper_curve', 'lbot_sniper_curve', 'lbot_sniper_curve_min', 'lbot_sniper_curve_max', 0.1);
  434.  
  435.     -- Smoothing
  436.     makeLegitSmooth('lbot_pistol_smooth', 'lbot_pistol_smooth', 'lbot_pistol_smooth_min', 'lbot_pistol_smooth_max', 0.1);
  437.     makeLegitSmooth('lbot_smg_smooth', 'lbot_smg_smooth', 'lbot_smg_smooth_min', 'lbot_smg_smooth_max', 0.1);
  438.     makeLegitSmooth('lbot_rifle_smooth', 'lbot_rifle_smooth', 'lbot_rifle_smooth_min', 'lbot_rifle_smooth_max', 0.1);
  439.     makeLegitSmooth('lbot_sniper_smooth', 'lbot_sniper_smooth', 'lbot_sniper_smooth_min', 'lbot_sniper_smooth_max', 0.1);
  440.     makeLegitSmooth('lbot_shotgun_smooth', 'lbot_shotgun_smooth', 'lbot_shotgun_smooth_min', 'lbot_shotgun_smooth_max', 0.1);
  441.  
  442.     -- Triggerbot
  443.     makeLegitSmooth('lbot_triggerbot', 'lbot_trg_delay', 'lbot_triggerbot_min', 'lbot_triggerbot_max', 0.01);
  444.  
  445.     -- Bcaktrack
  446.     local backtrackTicks = caches['backtrack_ticks'];
  447.     if (backtrackTicks == nil) then
  448.         caches['backtrack_ticks'] = 0;
  449.         backtrackTicks = caches['backtrack_ticks'];
  450.     end
  451.     if (getUIVar('lbot_backtrack')) then
  452.         if (backtrackTicks > 20) then
  453.             caches['backtrack_ticks'] = 0;
  454.             gui.SetValue('lbot_positionadjustment', getSmoothRandom('lbot_backtrack_min', 'lbot_backtrack_max', 0.001))
  455.         else
  456.             caches['backtrack_ticks'] = backtrackTicks + 0.05;
  457.         end
  458.     end
  459. end
  460.  
  461. local function handleVisuals()
  462.     local lp = entities.GetLocalPlayer();
  463.     if (lp == nil) then
  464.         return
  465.     end ;
  466.     -- Kill Feed
  467.     local kill_effect = getUIVar('kill_effect');
  468.     if (caches['kill_effect'] and kill_effect > 0) then
  469.         local timer = caches['kill_effect_timer'];
  470.         local mats = { 'mat_ambient_light_r', 'mat_ambient_light_g', 'mat_ambient_light_b' };
  471.         if (timer == nil) then
  472.             -- Set this to 20 and not 0 to make kill effect show on first kill ;)
  473.             caches['kill_effect_timer'] = 40;
  474.             timer = caches['kill_effect_timer'];
  475.         end
  476.         if (timer < 2) then
  477.             caches['kill_effect'] = false;
  478.             caches['kill_effect_timer'] = 40;
  479.             for i = 1, #mats do
  480.                 client.SetConVar(mats[i], 0, true);
  481.             end
  482.         else
  483.             client.SetConVar(mats[kill_effect], timer * 0.01, true);
  484.             caches['kill_effect_timer'] = timer - 1;
  485.         end
  486.     end
  487.  
  488.     -- Full Bright
  489.     client.SetConVar("mat_fullbright", getUIVar('full_bright') and 1 or 0, true);
  490.  
  491.     -- Watermark, Design by Rab
  492.     if (getUIVar('watermark')) then
  493.         if (caches['watermark'] == nil) then
  494.             caches['watermark'] = { x = 50, y = 50, w = 200, h = 50, mouseX = 0, mouseY = 0, dx = 0, dy = 0, shouldDrag = false, fontTiny = draw.CreateFont("Tahoma", 11), fontSmall = draw.CreateFont("Tahoma", 13); }
  495.         end
  496.         local watermark = caches['watermark'];
  497.         local time = string.gsub(os.date("%X"), ":", " : ");
  498.         drawRectFill(8, 8, 8, 255, watermark.x, watermark.y, watermark.w, watermark.h);
  499.         drawOutline(8, 8, 8, watermark.x, watermark.y, watermark.w, watermark.h);
  500.         draw.SetFont(watermark.fontSmall);
  501.         local msg = 'Welcome #RabisARetardChargeback'
  502.         local tw, th = draw.GetTextSize(msg);
  503.         local y = watermark.y + 5;
  504.         drawText(128, 128, 128, 255, watermark.x + (watermark.w - tw) / 2, y, msg, watermark.fontSmall);
  505.         y = y + th + 2;
  506.         draw.SetFont(watermark.fontTiny);
  507.         msg = 'Project Entropy'
  508.         tw, th = draw.GetTextSize(msg)
  509.         drawText(128, 128, 128, 255, watermark.x + (watermark.w - tw) / 2, y, msg, watermark.fontTiny);
  510.         y = y + th + 3;
  511.         draw.SetFont(watermark.fontTiny);
  512.         msg = time;
  513.         tw, th = draw.GetTextSize(msg)
  514.         drawText(128, 128, 128, 255, watermark.x + (watermark.w - tw) / 2, y, msg, watermark.fontTiny);
  515.         y = y + th + 2;
  516.         -- Drag
  517.         if (input.IsButtonDown(1)) then
  518.             watermark. mouseX, watermark.mouseY = input.GetMousePos();
  519.             if watermark.shouldDrag then
  520.                 watermark.x = watermark.mouseX - watermark.dx;
  521.                 watermark.y = watermark.mouseY - watermark.dy;
  522.             end
  523.             if watermark.mouseX >= watermark.x - 15 and watermark.mouseX <= watermark.x + watermark.w + 15 and watermark.mouseY >= watermark.y - 15 and watermark.mouseY <= watermark.y + watermark.h + 15 then
  524.                 watermark. shouldDrag = true;
  525.                 watermark.dx = watermark.mouseX - watermark.x;
  526.                 watermark.dy = watermark.mouseY - watermark.y;
  527.             end
  528.         else
  529.             watermark. shouldDrag = false;
  530.         end
  531.     end
  532.  
  533.     -- Engine Radar
  534.     local engine_radar = getUIVar('engine_radar');
  535.     local CCSPlayer = entities.FindByClass("CCSPlayer");
  536.     if engine_radar then
  537.         caches['engine_radar_spotted'] = true
  538.         for _, p in pairs(CCSPlayer) do
  539.             p:SetProp("m_bSpotted", 1);
  540.         end
  541.     elseif not engine_radar and caches['engine_radar_spotted'] then
  542.         caches['engine_radar_spotted'] = false
  543.         for _, p in pairs(CCSPlayer) do
  544.             p:SetProp("m_bSpotted", 0);
  545.         end
  546.     end
  547.  
  548.     -- Disable Post Processing
  549.     client.SetConVar("mat_postprocess_enable", getUIVar('disable_postprocess') and 0 or 1, true);
  550.  
  551.     -- Sniper crosshair
  552.     if (getUIVar('sniper_crosshair')) then
  553.         local shouldShowCrosshair = lp ~= nil and lp:IsAlive() and gui.GetValue("vis_thirdperson_dist") == 0 and lp:GetProp("m_bIsScoped") == 0;
  554.         client.SetConVar("weapon_debug_spread_show", shouldShowCrosshair and 3 or 0, true);
  555.     end
  556.  
  557.     -- Double scope
  558.     if (getUIVar('double_scope')) then
  559.         gui.SetValue("vis_view_fov", lp ~= nil and lp:GetProp("m_bIsScoped") ~= 0 and 0 or caches['vis_view_fov']);
  560.     end
  561.  
  562.     -- Transparent On Scope
  563.     if (getUIVar('transparent_on_scope')) then
  564.         local sR, sG, sB, sA = unpack(caches['clr_chams_ghost_server']);
  565.         local cR, cG, cB, cA = unpack(caches['clr_chams_ghost_client']);
  566.         if (lp ~= nil and lp:GetProp("m_bIsScoped") == 1) then
  567.             sA, cA = 10, 10;
  568.         end
  569.         gui.SetValue("clr_chams_ghost_client", sR, sG, sB, sA);
  570.         gui.SetValue("clr_chams_ghost_server", cR, cG, cB, cA);
  571.     end
  572.  
  573.     -- Spread Tracers
  574.     if (getUIVar('spread_tracers')) then
  575.         client.SetConVar("cl_weapon_debug_show_accuracy", 1, true);
  576.         client.SetConVar("cl_weapon_debug_show_accuracy_duration", getUIVar('spread_tracers_duration'), true);
  577.     else
  578.         client.SetConVar("cl_weapon_debug_show_accuracy", 0, true);
  579.     end
  580.  
  581.     -- RGB Chams
  582.     for i = 1, #RGBVars do
  583.         local RGBVar = RGBVars[i];
  584.         if (getUIVar(luaKey .. RGBVar .. '_rgb')) then
  585.             local r = math.floor(math.sin((globals.RealTime()) * 2) * 127 + 128)
  586.             local g = math.floor(math.sin((globals.RealTime()) * 2 + 2) * 127 + 128)
  587.             local b = math.floor(math.sin((globals.RealTime()) * 2 + 4) * 127 + 128)
  588.             gui.SetValue(RGBVar, r, g, b);
  589.         end
  590.     end
  591. end
  592.  
  593. --[==========================[Callbacks]==========================]
  594. callbacks.Register("FireGameEvent", function(event)
  595.     if (event == nil) then
  596.         return
  597.     end ;
  598.     local en = event:GetName();
  599.     local lp = entities.GetLocalPlayer();
  600.     if (lp == nil) then
  601.         return
  602.     end ;
  603.     local lpIndex = lp:GetIndex();
  604.     local user, aent = entities.GetByUserID(event:GetInt("userid")), entities.GetByUserID(event:GetInt("attacker"))
  605.     local uid, attacker = 0, 0;
  606.     if (user ~= nil) then
  607.         uid = user:GetIndex();
  608.     end
  609.     if (aent ~= nil) then
  610.         attacker = aent:GetIndex()
  611.     end
  612.     if (en == 'player_hurt') then
  613.         -- Handle Hitsound
  614.         local hitsound = getUIVar('custom_hit_sound');
  615.         if (hitsound > 0) then
  616.             -- Silence aimwares hitmarker, peasant.
  617.             if (gui.GetValue('msc_hitmarker_volume') ~= 0) then
  618.                 gui.SetValue("msc_hitmarker_volume", 0);
  619.             end
  620.             if (attacker == lpIndex and uid ~= lpIndex) then
  621.                 local hitsoundPaths = { 'weapons\\scar20\\scar20_boltback', 'buttons\\arena_switch_press_02.wav', 'ambient\\creatures\\chicken_death_01', 'training\\pointscored' };
  622.                 local hitsoundPath = hitsoundPaths[hitsound];
  623.                 client.Command('play ' .. hitsoundPath, true);
  624.             end
  625.         end
  626.     elseif (en == 'player_death') then
  627.         -- Kill Effect
  628.         if (attacker == lpIndex and uid ~= lpIndex) then
  629.             if getUIVar('kill_effect') > 0 then
  630.                 caches['kill_effect'] = true
  631.             end
  632.         end
  633.     end
  634. end);
  635.  
  636. local function urlEncode(url)
  637.     if url ~= nil then
  638.         url = url:gsub("\n", "\r\n")
  639.         url = url:gsub("([^%w ])", function(c)
  640.             string.format("%%%02X", string.byte(c))
  641.         end)
  642.         url = url:gsub(" ", "+")
  643.     end
  644.     return url
  645. end
  646.  
  647. callbacks.Register("Draw", function()
  648.     mainWindow:SetActive(showMenu:GetValue() and references.aimware:IsActive());
  649.  
  650.     -- Update mouse x, y;
  651.     mx, my = input.GetMousePos();
  652.     local mainx, mainy = mainWindow:GetValue();
  653.  
  654.     -- Manage Tabs
  655.     local dpiscale = gui.GetValue("dpi_Scale");
  656.     for i = 1, #subWindows do
  657.         local subWindow = subWindows[i];
  658.         subWindow:SetValue(mainx, mainy + math.floor(70 * dpiscale));
  659.         subWindow:SetActive(mainWindow:IsActive() and i == curTab);
  660.     end
  661.     -- P Clean Code
  662.     handleAntiAim();
  663.     handlePresets();
  664.     handleResolver();
  665.     handleSlowwalk();
  666.     handleLegitbot();
  667.     handleVisuals();
  668. end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement