Advertisement
Guest User

Menu ;)

a guest
Sep 4th, 2015
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.25 KB | None | 0 0
  1. /*
  2. MENU
  3. */
  4.  
  5. local options = {
  6.     ["AIM"] =
  7.     {
  8.         ["Active"] = {"Checkbox", 1, false, "Active"},
  9.         ["OnKey"] = {"Checkbox", 2, true, "On Key"},
  10.         ["AutoShoot"] = {"Checkbox", 3, true, "Auto Shoot"},
  11.         ["AutoPistol"] = {"Checkbox", 4, true, "Auto Pistol"},
  12.         ["BulletTime"] = {"Checkbox", 5, false, "Bullet Time"},
  13.         ["AutoAim"] = {"Checkbox", 6, false, "Auto Aim"},
  14.         ["AutoDuck"] = {"Checkbox", 7, false, "Auto Duck"},
  15.         ["IgnoreTeam"] = {"Checkbox", 8, false, "Ignore Team"}
  16.     },
  17.    
  18.     ["TRIG"] =
  19.     {
  20.         ["Active"] = {"Checkbox", 1, false, "Active"}
  21.     },
  22.    
  23.     ["VIS"] =
  24.     {
  25.         ["Active"] = {"Checkbox", 1, true, "Active"},
  26.         ["Box"] = {"Checkbox", 2, true, "Box"},
  27.         ["FilledBox"] = {"Checkbox", 3, true, "Filled Box"},
  28.         ["Snapline"] = {"Checkbox", 4, true, "Snapline"},
  29.         ["HealthBar"] = {"Checkbox", 5, true, "Healthbar"},
  30.         ["ArmourBar"] = {"Checkbox", 6, true, "Armourbar"},
  31.         ["Barrel"] = {"Checkbox", 7, true, "Barrel"},
  32.         ["AimPos"] = {"Checkbox", 8, true, "Aim Pos"},
  33.         ["Skeleton"] = {"Checkbox", 9, true, "Skeleton"},
  34.         ["Chams"] = {"Checkbox", 10, true, "Chams"},
  35.         ["Health"] = {"Checkbox", 11, true, "Health"},
  36.         ["Name"] = {"Checkbox", 12, true, "Name"},
  37.         ["Weapon"] = {"Checkbox", 13, true, "Weapon"},
  38.         ["Distance"] = {"Checkbox", 14, true, "Distance"},
  39.         ["Money"] = {"Checkbox", 15, true, "Money"},
  40.         ["Rank"] = {"Checkbox", 16, true, "Rank"},
  41.         ["SteamID"] = {"Checkbox", 17, true, "SteamID"},
  42.         ["Points"] = {"Checkbox", 18, true, "Points"},
  43.         ["Armour"] = {"Checkbox", 19, true, "Armour"},
  44.         ["HitBox"] = {"Checkbox", 20, false, "HitBox"},
  45.         ["FilledHitBox"] = {"Checkbox", 21, false, "Filled HitBox"},
  46.         ["Beacon"] = {"Checkbox", 22, false, "Beacon"},
  47.         ["AsusWalls"] = {"Checkbox", 23, false, "ASUS Walls"},
  48.         ["BoxType"] = {"Selection", 1, "2D", "Box Type", {"2D", "3D"}},
  49.         ["BoxStyle"] = {"Selection", 2, "IWebz", "Box Style", {"Default", "IWebz"}},
  50.         ["SnapLineType"] = {"Selection", 3, "Center", "SnapLine Type", {"Bottom", "Center"}},
  51.         ["HealthBarStyle"] = {"Selection", 4, "Fami", "HealthBar Style", {"Aria", "Default", "Fami", "Naisho"}},
  52.         ["ArmourBarStyle"] = {"Selection", 5, "Fami", "ArmourBar Style", {"Aria", "Default", "Fami"}},
  53.         ["ChamsType"] = {"Selection", 6, "XQZ", "Chams Type", {"Solid", "Wireframe", "XQZ"}},
  54.         ["DistanceType"] = {"Selection", 7, "Metres", "Distance Type", {"Feet", "Metres", "Units"}},
  55.         ["AsusWallsInt"] = {"Slider", 8, 0.95, "ASUS Walls Int", {0.5, 0.99, 2}}
  56.     },
  57.    
  58.     ["RAD"] =
  59.     {
  60.         ["Active"] = {"Checkbox", 1, false, "Active"}
  61.     },
  62.    
  63.     ["REM"] =
  64.     {
  65.         ["Active"] = {"Checkbox", 1, true, "Active"},
  66.         ["NoSpread"] = {"Checkbox", 2, false, "No Spread"},
  67.         ["NoRecoil"] = {"Checkbox", 3, true, "No Recoil"},
  68.         ["NoVisRecoil"] = {"Checkbox", 4, true, "No Visual Recoil"}
  69.     },
  70.    
  71.     ["HVH"] =
  72.     {
  73.         ["Active"] = {"Checkbox", 1, false, "Active"}
  74.     },
  75.    
  76.     ["MISC"] =
  77.     {
  78.         ["Active"] = {"Checkbox", 1, true, "Active"},
  79.         ["BunnyHop"] = {"Checkbox", 2, true, "Bunny Hop"},
  80.         ["AutoStrafer"] = {"Checkbox", 3, true, "Auto Strafer"},
  81.         ["NameStealer"] = {"Checkbox", 4, false, "Name Stealer"},
  82.         ["AutoPistol"] = {"Checkbox", 5, true, "Auto Pistol"},
  83.         ["Fov"] = {"Checkbox", 6, true, "FoV"},
  84.         ["ThirdPerson"] = {"Checkbox", 7, false, "Third Person"},
  85.         ["EdgeJump"] = {"Checkbox", 8, true, "Edge Jump"},
  86.         ["AutoStraferType"] = {"Selection", 1, "Forwards", "Auto-Strafer Type", {"Forwards", "Sideways", "W-Hop"}},
  87.         ["NameStealerType"] = {"Selection", 2, "Steam", "Name Stealer Type", {"Steam", "DarkRP"}},
  88.         ["NameStealerInt"] = {"Slider", 3, 5, "Name Stealer Int", {1, 30, 0}},
  89.         ["FovInt"] = {"Slider", 4, 120, "FoV Int", {90, 150, 0}},
  90.         ["ThirdPersonInt"] = {"Slider", 5, 20, "ThirdPerson Int", {10, 20, 0}}
  91.     },
  92.    
  93.     ["COL"] =
  94.     {
  95.         ["Active"] = {"Checkbox", 1, false, "Active"}
  96.     }
  97. };
  98.  
  99. local function gBool(k, _k)
  100.     return options[k][_k][3];
  101. end
  102.  
  103. local function gOption(k, _k)
  104.     return tostring(options[k][_k][3]);
  105. end
  106.  
  107. local function gInt(k, _k)
  108.     return options[k][_k][3];
  109. end
  110.  
  111. local function Menu()
  112.     surface.SetFont("Trebuchet18");
  113.     local Menu = vgui.Create("DFrame")
  114.     Menu:SetSize(600, 400)
  115.     Menu:ShowCloseButton(true)
  116.     Menu:SetTitle("")
  117.     Menu:MakePopup()
  118.     Menu:Center()
  119.     function Menu.Paint(self)
  120.         draw.RoundedBox(0, 0, 0, self:GetWide(), self:GetTall(), Color(60, 60, 60))
  121.         draw.RoundedBox(0, 0, 0, self:GetWide(), 22, Color(255, 100, 100))
  122.         draw.SimpleText("GenericBot", "ChatFont", self:GetWide()*0.5 - 30, 4, color_white)
  123.     end
  124.    
  125.     local PSheet = vgui.Create("DPropertySheet", Menu)
  126.     PSheet:Dock(FILL)
  127.    
  128.     local AimBot = vgui.Create("DPanel")
  129.         PSheet:AddSheet(" Aimbot ", AimBot, false, false, false)
  130.    
  131.     local TriggerBot = vgui.Create("DPanel")
  132.         PSheet:AddSheet(" Triggerbot ", TriggerBot, false, false, false)
  133.        
  134.     local Visuals = vgui.Create("DPanel")
  135.         PSheet:AddSheet(" Visuals ", Visuals, false, false, false)
  136.    
  137.     local Radar = vgui.Create("DPanel")
  138.         PSheet:AddSheet(" Radar ", Radar, false, false, false)
  139.    
  140.     local Removals = vgui.Create("DPanel")
  141.         PSheet:AddSheet(" Removals ", Removals, false, false, false)
  142.        
  143.     local HvH = vgui.Create("DPanel")
  144.         PSheet:AddSheet(" HvH ", HvH, false, false, false)
  145.        
  146.     local Misc = vgui.Create("DPanel")
  147.         PSheet:AddSheet(" Miscellaneous ", Misc, false, false, false)
  148.  
  149.     local Configs = vgui.Create("DPanel")
  150.         PSheet:AddSheet(" Configs ", Configs, false, false, false)
  151.        
  152.     local Colors = vgui.Create("DPanel")
  153.         PSheet:AddSheet(" Colors ", Colors, false, false, false)
  154.        
  155.     local Credits = vgui.Create("DPanel")
  156.         PSheet:AddSheet(" Credits ", Credits, false, false, false)
  157.        
  158.     local Sheets =
  159.     {
  160.         ["AIM"] = AimBot;
  161.         ["TRIG"] = TriggerBot;
  162.         ["VIS"] = Visuals;
  163.         ["RAD"] = Radar;
  164.         ["REM"] = Removals;
  165.         ["MISC"] = Misc;
  166.         ["HVH"] = HvH;
  167.         ["COL"] = Colors;
  168.     };
  169.  
  170.     local function AddCheckBox(k, _k)
  171.         local x = 10 + math.floor(options[k][_k][2]/11.5) * 100;
  172.         local y = 10 - math.floor(options[k][_k][2]/11.5) * 330 + (options[k][_k][2]-1) * 30;
  173.        
  174.         local checkbox = vgui.Create("DCheckBoxLabel", Sheets[k]);
  175.             checkbox:SetPos(x, y);
  176.             checkbox:SetText(options[k][_k][4]);
  177.             checkbox:SetValue(options[k][_k][3])
  178.             checkbox.OnChange = function()
  179.                 options[k][_k][3] = !options[k][_k][3];
  180.             end
  181.             checkbox:SetTextColor(Color(5,5,5))
  182.             checkbox:SizeToContents()
  183.     end
  184.    
  185.     local function AddSelectionBox(k, _k)
  186.         local selectionx = 0;
  187.        
  188.         for _, text in next, options[k][_k][5] do
  189.             local textx = select(1, surface.GetTextSize(tostring(text)))
  190.             selectionx = math.max(selectionx, textx);
  191.         end
  192.        
  193.         local titlex = select(1, surface.GetTextSize(tostring(options[k][_k][4] .. ":"))) - 5;
  194.  
  195.         local y = 5 + (options[k][_k][2]-1) * 30;
  196.        
  197.         local _selectbox = vgui.Create( "DLabel", Sheets[k])
  198.             _selectbox:SetPos(510 - selectionx - titlex,y + 2)
  199.             _selectbox:SetSize(titlex,14)
  200.             _selectbox:SetColor(Color(5,5,5))
  201.             _selectbox:SetText(options[k][_k][4] .. ":")
  202.            
  203.         local selectbox = vgui.Create("DComboBox", Sheets[k])
  204.             selectbox:SetPos(510 - selectionx, y)
  205.             selectbox:SetSize(selectionx + 60, 20)
  206.             selectbox:SetValue(options[k][_k][3])
  207.             for __k, __v in next, options[k][_k][5] do
  208.                 selectbox:AddChoice(__v);
  209.             end
  210.             selectbox.OnSelect = function()
  211.                 options[k][_k][3] = selectbox:GetSelected();
  212.             end
  213.     end
  214.    
  215.     local function AddSlider(k, _k)
  216.         local titlex = select(1, surface.GetTextSize(tostring(options[k][_k][4] .. ":"))) - 5;
  217.  
  218.         local y = 5 + (options[k][_k][2]-1) * 30;
  219.        
  220.         local _slider = vgui.Create( "DLabel", Sheets[k])
  221.             _slider:SetPos(420 - titlex, y + 2)
  222.             _slider:SetSize(titlex,14)
  223.             _slider:SetColor(Color(5,5,5))
  224.             _slider:SetText(options[k][_k][4] .. ":")
  225.            
  226.         local slider = vgui.Create("DNumSlider", Sheets[k])
  227.             slider:SetPos(290, y)
  228.             slider:SetSize(300, 20)
  229.             slider:SetMin(options[k][_k][5][1])
  230.             slider:SetMax(options[k][_k][5][2])
  231.             slider:SetDecimals(options[k][_k][5][3])
  232.             slider:SetValue(options[k][_k][3])
  233.             slider.OnValueChanged = function()
  234.                 options[k][_k][3] = slider:GetValue();
  235.             end
  236.     end
  237.    
  238.     for k,v in next, options do
  239.         for _k,_v in next, options[k] do
  240.             if (options[k][_k][1] == "Checkbox") then
  241.                 AddCheckBox(k,_k);
  242.             elseif (options[k][_k][1] == "Selection") then
  243.                 AddSelectionBox(k, _k);
  244.             elseif (options[k][_k][1] == "Slider") then
  245.                 AddSlider(k, _k);
  246.             end
  247.         end
  248.     end
  249. end
  250.  
  251. concommand.Add("Menu", Menu)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement