Advertisement
Guest User

MeepBot Build 31

a guest
Jun 1st, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 12.87 KB | None | 0 0
  1. --Build 31
  2.  
  3. --[[Tips:
  4.  
  5. Want to change colors for crosshairs? Find the MB.ch variables, change the numbers.
  6.  
  7. The MB.ch["1"] variables are the big crosshair. ["2"] is the smaller square
  8.  
  9. r = red (0-255)
  10. g = green (0-255)
  11. b = blue (0-255)
  12. a = alpha [transparency] (0-255) 255 = not transparent
  13.  
  14. ]]
  15. local MB = {}
  16.  
  17. if string.find(string.lower(GAMEMODE.Name),"terror") then MB.TTT = true else MB.TTT = false end
  18. if string.find(string.lower(GAMEMODE.Name),"darkrp") then MB.DRP = true else MB.DRP = false end
  19.  
  20. MB.lp = LocalPlayer
  21.  
  22. MB.ch = {}
  23. MB.ch["bool"] = true
  24.  
  25. MB.ch["1"] = {}
  26. MB.ch["1"]["r"] = 213
  27. MB.ch["1"]["g"] = 91
  28. MB.ch["1"]["b"] = 201
  29. MB.ch["1"]["a"] = 100
  30.  
  31. MB.ch["2"] = {}
  32. MB.ch["2"]["r"] = 169
  33. MB.ch["2"]["g"] = 10
  34. MB.ch["2"]["b"] = 153
  35. MB.ch["2"]["a"] = 185
  36.  
  37.  
  38. MB.hooks = {}
  39. MB.commands = {}
  40. MB.timers = {}
  41. MB.aim = false
  42. MB.aimnotify = true
  43. MB.meep = true
  44. MB.meepbot = false
  45. MB.targ = nil
  46.  
  47. MB.allwep = {}
  48. MB.traitorz = {}
  49. MB.witnesses = {}
  50. MB.deadpplz = {}
  51. MB.mat = CreateMaterial(math.random(1337,13370), "VertexLitGeneric", { ["$basetexture"] = "models/debug/debugwhite", ["$model"] = 1, ["$ignorez"] = 1 } )
  52. MB.donottrack = {"viewmodel", "weapon_ttt_wtester", "weapon_zm_improvised", "weapon_zm_magnetstick", "weapon_zm_carry", "weapon_ttt_unarmed", "env_fire", "ttt_flame", "ttt_knife_proj", "prop_ragdoll", "trace1", "rope", "func_physbox", "ttt_firegrenade_proj", "ttt_smokegrenade_proj", "ttt_confgrenade_proj"}
  53. for k, v in pairs(ents.GetAll()) do
  54.     v.isPartOfMap = true
  55.     if not table.HasValue(MB.allwep,v:GetClass()) and v:IsWeapon() and not table.HasValue(MB.donottrack,v:GetClass()) then
  56.         table.insert(MB.allwep,v:GetClass())
  57.     end
  58. end
  59.  
  60. function MB.CreateTimer(timerdesc,timername,timeamt,times,functiontimer)
  61.     timer.Create(timername,timeamt,times,functiontimer)
  62.     local avalue = {}
  63.     avalue["name"] = timername
  64.     avalue["desc"] = timerdesc
  65.     MB.timers[timername] = avalue
  66.    
  67. end
  68.  
  69. function MB.AddHook(Type,Function)
  70.     Name = Type.." | "..math.random(1,1297),math.random(1,2282),math.random(1,7236)
  71.     local avalue = {}
  72.     avalue["name"] = Name
  73.     avalue["type"] = Type
  74.     MB.hooks[Name] = avalue
  75.     hook.Add(Type,Name,Function)
  76. end
  77.  
  78. function MB.AddCommand(Number,Name,Function)
  79.     local avalue = {}
  80.     avalue["number"] = Number
  81.     avalue["name"] = Name
  82.     MB.commands[Name] = avalue
  83.     concommand.Add(Number,Function)
  84. end
  85.  
  86. MB.AddCommand(math.random(100000,10000000),"Wallhack.Toggle",function()
  87.     MB.meep = !MB.meep
  88. end)
  89.  
  90. MB.AddCommand(tostring(math.random(1,10000)),"TTT.Toggle.DEBUGUSEONLY",function()
  91.     MB.TTT = !MB.TTT
  92. end)
  93.  
  94. MB.AddCommand("meepbot","WikiAimbot(Modded).ToggleUntilDead",function()
  95.     MB.aim = not MB.aim
  96. end)
  97.  
  98. function MB.MESPCheck(v)
  99.     if MB.TTT then
  100.         if IsValid(v) and v:IsPlayer() and not v:IsNPC() and v:IsTerror() ~= nil and v:IsTerror() and not table.HasValue(MB.deadpplz,v) and v ~= MB.lp() then
  101.             return true
  102.         else
  103.             return false
  104.         end
  105.     else
  106.         if IsValid(v) and v:IsPlayer() and not v:IsNPC() and not table.HasValue(MB.deadpplz,v) and v ~= MB.lp() then
  107.             return true
  108.         else
  109.             return false
  110.         end
  111.     end
  112. end
  113.  
  114. function MB.coordinates(ent)
  115. local min, max = ent:OBBMins(), ent:OBBMaxs()
  116. local corners = {
  117.     Vector(min.x, min.y, min.z),
  118.     Vector(min.x, min.y, max.z),
  119.     Vector(min.x, max.y, min.z),
  120.     Vector(min.x, max.y, max.z),
  121.     Vector(max.x, min.y, min.z),
  122.     Vector(max.x, min.y, max.z),
  123.     Vector(max.x, max.y, min.z),
  124.     Vector(max.x, max.y, max.z)
  125. }
  126.  
  127. local minX, minY, maxX, maxY = ScrW() * 2, ScrH() * 2, 0, 0
  128. for _, corner in pairs(corners) do    
  129.     local onScreen = ent:LocalToWorld(corner):ToScreen()
  130.     minX, minY = math.min(minX, onScreen.x), math.min(minY, onScreen.y)
  131.     maxX, maxY = math.max(maxX, onScreen.x), math.max(maxY, onScreen.y)
  132. end
  133.  
  134. return minX, minY, maxX, maxY
  135. end
  136.  
  137.  
  138.  
  139. MB.AddHook("Think",function()
  140.     for _,v in pairs (player.GetAll()) do
  141.         if not v:Alive() and v:Health() < 1 and not v:IsNPC() and v:IsPlayer() then
  142.             if not table.HasValue(MB.deadpplz,v) then
  143.                 table.insert(MB.deadpplz,v)
  144.                 chat.AddText(v:Name().." died somehow!")
  145.             end
  146.         else
  147.             for k,v2 in pairs (MB.deadpplz) do
  148.                 if v2 == v then
  149.                     table.remove(MB.deadpplz,k)
  150.                 end
  151.             end
  152.         end
  153.     end
  154.    
  155.     local lp = MB.lp()
  156.     local trace = util.GetPlayerTrace(lp)
  157.     local traceRes = util.TraceLine(trace)
  158.     if traceRes.HitNonWorld then
  159.         local target = traceRes.Entity
  160.         if target:Health() > 0 and IsValid(target) and v ~= lp then
  161.             MB.temptarg = target
  162.         end
  163.     end
  164.     if MB.aim and IsValid(MB.targ) and MB.targ:Health() > 0 then
  165.         local targethead = MB.targ:LookupBone("ValveBiped.Bip01_Head1")
  166.         if targethead then
  167.             local targetheadpos,targetheadang = MB.targ:GetBonePosition(targethead)
  168.             if targetheadpos and targetheadang then
  169.                 lp:SetEyeAngles((targetheadpos - lp:GetShootPos()):Angle())
  170.             end
  171.         end
  172.     else
  173.         MB.aim = false
  174.         MB.targ = MB.temptarg
  175.     end
  176. end)
  177.  
  178.  
  179. MB.AddHook("HUDPaint", function()
  180.     if MB.aim and MB.aimnotify then
  181.         if IsValid(MB.targ) and MB.targ and MB.targ:Name() then
  182.             draw.DrawText(MB.targ:Name(), "BudgetLabel", 30, ScrH() / 2, Color(255, 255, 255, 255))
  183.         end
  184.     end
  185.     if MB.ch["bool"] then
  186.         surface.SetDrawColor(Color(MB.ch["1"]["r"], MB.ch["1"]["g"], MB.ch["1"]["b"], MB.ch["1"]["a"]))
  187.  
  188.         surface.DrawRect(ScrW() / 2 - 8, ScrH() / 2 - 8, 16, 16)
  189.        
  190.         surface.SetDrawColor(Color(MB.ch["2"]["r"], MB.ch["2"]["g"], MB.ch["2"]["b"], MB.ch["2"]["a"]))
  191.        
  192.         surface.DrawRect(ScrW() / 2 - 4, ScrH() / 2 - 4, 8, 8)
  193.     end
  194.     if MB.meep then
  195.         cam.Start2D()
  196.         for k,v in pairs (player.GetAll()) do
  197.             if MB.MESPCheck(v) then
  198.             --Name Draw start
  199.                 local Position = v:GetPos():ToScreen()
  200.                 local name = v:Name()
  201.                 if MB.TTT then
  202.                     if not table.HasValue(MB.traitorz,v) then
  203.                         if v:IsDetective() then
  204.                             draw.DrawText(name.."\n Detective", "BudgetLabel", Position.x, Position.y, Color(0, 0, 255, 250), 1)
  205.                         else
  206.                             draw.DrawText(name.."\n Innocent", "BudgetLabel", Position.x, Position.y, Color(0, 255, 0, 250), 1)
  207.                         end
  208.                     else
  209.                         if v:IsDetective() then
  210.                             draw.DrawText(name.."\n Detective", "BudgetLabel", Position.x, Position.y, Color(0, 0, 255, 250), 1)
  211.                         else
  212.                             draw.DrawText(name.."\n Traitor", "BudgetLabel", Position.x, Position.y, Color(255, 0, 0, 250), 1)
  213.                         end
  214.                     end
  215.                 elseif MB.DRP then
  216.                     draw.DrawText(name.."\n Health: "..tostring(v:Health()), "BudgetLabel", Position.x, Position.y, team.GetColor(v:Team()), 1)
  217.                 else
  218.                     draw.DrawText(name.."\n Health: "..tostring(v:Health()), "BudgetLabel", Position.x, Position.y, Color(102, 102, 255, 250 ), 1)
  219.                 end
  220.             --Name Draw finish
  221.             end
  222.         end
  223.         cam.End2D()
  224.     end
  225. end)
  226.  
  227. MB.AddHook("RenderScreenspaceEffects", function()
  228.     if MB.meep then
  229.         local lp = MB.lp()
  230.         cam.Start3D(lp:EyePos(), lp:EyeAngles())
  231.        
  232.         render.SuppressEngineLighting(true)
  233.         render.MaterialOverride(MB.mat)
  234.         for k,v in pairs(player.GetAll()) do
  235.             if MB.MESPCheck(v) then
  236.             --draw people start
  237.                 --part 1
  238.                 local h = v:Health()
  239.                 local green = (2.55 * h) / 255
  240.                 local red = (255 - 2.00 * h) / 255
  241.                 render.SetColorModulation(red, green, 0, 1)
  242.                 render.MaterialOverride(MB.mat)
  243.                 v:DrawModel()
  244.                
  245.                 --part 2
  246.                 render.MaterialOverride()
  247.                 render.SetModelLighting(4, 0.78, 0.19, 0.19)
  248.                 v:DrawModel()
  249.             --draw people finish
  250.            
  251.             --draw guns start
  252.                 if IsValid(v:GetActiveWeapon()) then
  253.                     render.SetColorModulation(0, 0, 0, 1)
  254.                     render.MaterialOverride(MB.mat)
  255.                     v:GetActiveWeapon():DrawModel()
  256.                    
  257.                     render.SetColorModulation(0, 0, 0, 1)
  258.                     render.MaterialOverride()
  259.                     v:GetActiveWeapon():DrawModel()
  260.                 end
  261.             --draw guns finish
  262.             end
  263.         end
  264.         render.SuppressEngineLighting(false)
  265.         cam.End3D()
  266.     end
  267. end)
  268.  
  269.  
  270.  
  271. if MB.TTT then
  272.     MB.AddHook("TTTPrepareRound",function()
  273.         traitorfinder = false
  274.         for k, v in pairs(MB.allwep) do
  275.             table.remove(MB.allwep, k)
  276.             MB.allwep = {}
  277.         end
  278.         MB.targ = nil
  279.         MB.temptarg = nil
  280.         for _,v in pairs(ents.GetAll()) do
  281.             v.isPartOfMap = true
  282.         end
  283.     end)
  284.  
  285.     MB.AddHook("TTTBeginRound",function()
  286.         traitorfinder = true
  287.         for k, v in pairs(ents.GetAll()) do
  288.             v.isPartOfMap = true
  289.             if not table.HasValue(MB.allwep,v:GetClass()) and v:IsWeapon() and not table.HasValue(MB.donottrack,v:GetClass()) then
  290.                 table.insert(MB.allwep,v:GetClass())
  291.             end
  292.         end
  293.         MB.traitorz = {}
  294.         MB.deadpplz = {}
  295.     end)
  296. end
  297.  
  298. MB.AddHook("PostDrawOpaqueRenderables", function()
  299.     if MB.TTT then
  300.         for k, v in pairs(ents.GetAll()) do
  301.             if v and MB.meep and traitorfinder and IsValid(v) then
  302.                 if not table.HasValue(MB.allwep,v:GetClass()) and v.CanBuy and not v.isPartOfMap and not v.wasESPTracked and not table.HasValue(MB.donottrack,v:GetClass()) then
  303.                     pl = v.Owner
  304.                     if MB.MESPCheck(pl) and IsValid(pl) and pl and not pl:IsDetective() then
  305.                         v.wasESPTracked = true
  306.                         table.insert(MB.traitorz,pl)
  307.                         chat.AddText(pl, Color(255,125,0), " has a ",Color(255,0,0),tostring(v:GetPrintName()).."!")
  308.                     end
  309.                 end
  310.             end
  311.         end
  312.     end
  313. end)
  314.  
  315. MB.AddCommand(math.random(1000,100000),"ShowWindow",function()
  316.     local rows = 2
  317.     local columns = 3
  318.     local extrah = 27
  319.     local extraw = 3
  320.     local totalwidth = 3 + 103 * (columns * 3)
  321.     local totalheight = 27 * (rows + 1)
  322.    
  323.     local Frame = vgui.Create("DFrame")
  324.     Frame:SetSize(209,totalheight)
  325.     Frame:SetPos(25,25)
  326.     Frame:SetText("MeepBot settings")
  327.     Frame:MakePopup()
  328.    
  329.     local vguiaimbotb = vgui.Create("DButton",Frame)
  330.     if MB.aimnotify then vguiaimbotb:SetText("Aim notify on") else vguiaimbotb:SetText("Aim notify off") end
  331.     vguiaimbotb:SetPos(extraw,extrah)
  332.     vguiaimbotb:SetWide(100)
  333.     function vguiaimbotb:DoClick()
  334.         MB.aimnotify = !MB.aimnotify
  335.         if MB.aimnotify then self:SetText("Aim notify on") else self:SetText("Aim notify off") end
  336.     end
  337.    
  338.     local vguimaintoggleb = vgui.Create("DButton",Frame)
  339.     if MB.meep then vguimaintoggleb:SetText("Wallhack on") else vguimaintoggleb:SetText("Wallhack off") end
  340.     vguimaintoggleb:SetPos(extraw,extrah * 2)
  341.     vguimaintoggleb:SetWide(100)
  342.     function vguimaintoggleb:DoClick()
  343.         MB.meep = !MB.meep
  344.         if MB.meep then self:SetText("Wallhack on") else self:SetText("Wallhack off") end
  345.     end
  346.    
  347.     local vguibindb = vgui.Create("DButton",Frame)
  348.     vguibindb:SetPos(extraw * 2 + 100,extrah * 2)
  349.     vguibindb:SetWide(100)
  350.     vguibindb:SetText("List binds in ~")
  351.     function vguibindb:DoClick()
  352.         for _,v in pairs(MB.commands) do
  353.             MsgN(v["name"].." is "..v["number"])
  354.         end
  355.     end
  356.    
  357.     local vguiselfdestructb = vgui.Create("DButton",Frame)
  358.     vguiselfdestructb:SetPos(extraw * 2 + 100,extrah)
  359.     vguiselfdestructb:SetWide(100)
  360.     vguiselfdestructb:SetText("Self Destruct")
  361.     function vguiselfdestructb:DoClick()
  362.         for _,v in pairs(MB.hooks) do
  363.             hook.Remove(v["type"],v["name"])
  364.             MsgN(v["name"].." was removed! ("..v["type"]..")")
  365.         end
  366.         for _,v in pairs (MB.timers) do
  367.             timer.Remove(v["name"])
  368.             MsgN(v["desc"].." was removed! ("..v["name"]..")")
  369.         end
  370.         for _,v in pairs (MB.commands) do
  371.             concommand.Remove(v["number"])
  372.             MsgN(v["name"].." was removed! ("..v["number"]..")")
  373.         end
  374.         Frame:SetVisible(false)
  375.     end
  376.    
  377. end)
  378.  
  379. chat.AddText("Bind a key to: "..MB.commands["ShowWindow"]["number"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement