Advertisement
Guest User

MeepBot Build 34

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