Advertisement
Guest User

MeepBot Build 27

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