Advertisement
Guest User

MeepBot Build 42

a guest
Jun 2nd, 2013
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.17 KB | None | 0 0
  1. --Build 42
  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. MB.debug = {}
  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.     local lp = MB.lp()
  238.     local trace = util.GetPlayerTrace(lp)
  239.     local traceRes = util.TraceLine(trace)
  240.     if traceRes.HitNonWorld then
  241.         local target = traceRes.Entity
  242.         draw.DrawText(target:GetClass(),"BudgetLabel", 30, ScrH() / 2 + 10,Color(255,255,255,255))
  243.     end
  244.    
  245.     if MB.aim and MB.aimnotify and then
  246.         if IsValid(MB.targ) and MB.targ then
  247.             draw.DrawText(MB.targ:Nick(), "BudgetLabel", 30, ScrH() / 2, Color(255, 255, 255, 255))
  248.         end
  249.     end
  250.     if MB.ch["bool"] then
  251.         surface.SetDrawColor(Color(MB.ch["1"]["r"], MB.ch["1"]["g"], MB.ch["1"]["b"], MB.ch["1"]["a"]))
  252.  
  253.         surface.DrawRect(ScrW() / 2 - 8, ScrH() / 2 - 8, 16, 16)
  254.        
  255.         surface.SetDrawColor(Color(MB.ch["2"]["r"], MB.ch["2"]["g"], MB.ch["2"]["b"], MB.ch["2"]["a"]))
  256.        
  257.         surface.DrawRect(ScrW() / 2 - 4, ScrH() / 2 - 4, 8, 8)
  258.     end
  259.     if MB.meep then
  260.         cam.Start2D()
  261.         for k,v in pairs (ents.GetAll()) do
  262.             if string.find(string.lower(v:GetClass()),"money") and MB.DRP then
  263.                 local pos = v:GetPos():ToScreen()
  264.                 local x, y = pos.x, pos.y
  265.                 draw.DrawText(tostring(v:GetClass()),"BudgetLabel",x,y,Color(100,150,125,255),TEXT_ALIGN_CENTER)
  266.             elseif string.find(string.lower(tostring(v:GetClass())),"shipment") and MB.DRP then
  267.                 local pos = v:GetPos():ToScreen()
  268.                 local x, y = pos.x, pos.y
  269.                 local ct = v:Getcontents() or ""
  270.                 local cts = CustomShipments[ct] or ""
  271.                 local ctsn = cts.name
  272.                 draw.DrawText(tostring(v:GetClass()..(": "..ctsn.."; Amount: "..v:Getcount() or "")),"BudgetLabel",x,y,Color(100,150,125,255),TEXT_ALIGN_CENTER)
  273.             end
  274.         end
  275.         for k,v in pairs (player.GetAll()) do
  276.             if MB.MESPCheck(v) then
  277.             --Name Draw start
  278.                 local Position = v:GetPos():ToScreen()
  279.                 local name = v:Name()
  280.                 if MB.TTT then
  281.                     if not table.HasValue(MB.traitorz,v) then
  282.                         if v:IsDetective() then
  283.                             draw.DrawText(name.."\n Detective", "BudgetLabel", Position.x, Position.y, Color(0, 0, 255, 250), 1)
  284.                         else
  285.                             draw.DrawText(name.."\n Innocent", "BudgetLabel", Position.x, Position.y, Color(0, 255, 0, 250), 1)
  286.                         end
  287.                     else
  288.                         if v:IsDetective() then
  289.                             draw.DrawText(name.."\n Detective", "BudgetLabel", Position.x, Position.y, Color(0, 0, 255, 250), 1)
  290.                         else
  291.                             draw.DrawText(name.."\n Traitor", "BudgetLabel", Position.x, Position.y, Color(255, 0, 0, 250), 1)
  292.                         end
  293.                     end
  294.                 elseif MB.DRP then
  295.                     draw.DrawText(name.."\n Health: "..tostring(v:Health()), "BudgetLabel", Position.x, Position.y, team.GetColor(v:Team()), 1)
  296.                 else
  297.                     draw.DrawText(name.."\n Health: "..tostring(v:Health()), "BudgetLabel", Position.x, Position.y, Color(102, 102, 255, 250 ), 1)
  298.                 end
  299.             --Name Draw finish
  300.             end
  301.         end
  302.         cam.End2D()
  303.     end
  304. end)
  305.  
  306. MB.AddHook("RenderScreenspaceEffects", function()
  307.     if MB.meep then
  308.         local lp = MB.lp()
  309.         cam.Start3D(lp:EyePos(), lp:EyeAngles())
  310.        
  311.         render.SuppressEngineLighting(true)
  312.         render.MaterialOverride(MB.mat)
  313.        
  314.        
  315.         for k,v in pairs(player.GetAll()) do
  316.             if MB.MESPCheck(v) then
  317.             --draw people start
  318.                 --part 1
  319.                 local h = v:Health()
  320.                 local green = (2.55 * h) / 255
  321.                 local red = (255 - 2.00 * h) / 255
  322.                 render.SetColorModulation(red, green, 0, 1)
  323.                 render.MaterialOverride(MB.mat)
  324.                 v:DrawModel()
  325.                
  326.                 --part 2
  327.                 render.MaterialOverride()
  328.                 render.SetModelLighting(4, 0.78, 0.19, 0.19)
  329.                 v:DrawModel()
  330.             --draw people finish
  331.            
  332.             --draw guns start
  333.                 if IsValid(v:GetActiveWeapon()) then
  334.                     render.SetColorModulation(0, 0, 0, 1)
  335.                     render.MaterialOverride(MB.mat)
  336.                     v:GetActiveWeapon():DrawModel()
  337.                    
  338.                     render.SetColorModulation(0, 0, 0, 1)
  339.                     render.MaterialOverride()
  340.                     v:GetActiveWeapon():DrawModel()
  341.                 end
  342.             --draw guns finish
  343.             end
  344.         end
  345.         render.SuppressEngineLighting(false)
  346.         cam.End3D()
  347.     end
  348. end)
  349.  
  350.  
  351.  
  352. if MB.TTT then
  353.     MB.AddHook("TTTPrepareRound",function()
  354.         traitorfinder = false
  355.         for k, v in pairs(MB.allwep) do
  356.             table.remove(MB.allwep, k)
  357.             MB.allwep = {}
  358.         end
  359.         MB.targ = nil
  360.         MB.temptarg = nil
  361.         for _,v in pairs(ents.GetAll()) do
  362.             v.isPartOfMap = true
  363.         end
  364.     end)
  365.  
  366.     MB.AddHook("TTTBeginRound",function()
  367.         traitorfinder = true
  368.         for k, v in pairs(ents.GetAll()) do
  369.             v.isPartOfMap = true
  370.             if not table.HasValue(MB.allwep,v:GetClass()) and v:IsWeapon() and not table.HasValue(MB.donottrack,v:GetClass()) then
  371.                 table.insert(MB.allwep,v:GetClass())
  372.             end
  373.         end
  374.         MB.traitorz = {}
  375.         MB.deadpplz = {}
  376.     end)
  377. end
  378.  
  379. MB.AddHook("PostDrawOpaqueRenderables", function()
  380.     if MB.TTT then
  381.         for k, v in pairs(ents.GetAll()) do
  382.             if v and MB.meep and traitorfinder and IsValid(v) then
  383.                 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
  384.                     pl = v.Owner
  385.                     if MB.MESPCheck(pl) and IsValid(pl) and pl and not pl:IsDetective() then
  386.                         v.wasESPTracked = true
  387.                         table.insert(MB.traitorz,pl)
  388.                         chat.AddText(pl, Color(255,125,0), " has a ",Color(255,0,0),tostring(v:GetPrintName()).."!")
  389.                     end
  390.                 end
  391.             end
  392.         end
  393.     end
  394. end)
  395.  
  396. MB.AddCommand(math.random(1000,100000),"ShowWindow",function()
  397.     local rows = 2
  398.     local columns = 3
  399.     local extrah = 27
  400.     local extraw = 3
  401.     local totalwidth = 3 + 103 * (columns * 3)
  402.     local totalheight = 27 * (rows + 1)
  403.    
  404.     local Frame = vgui.Create("DFrame")
  405.     Frame:SetSize(209,totalheight)
  406.     Frame:SetPos(25,25)
  407.     Frame:SetText("MeepBot settings")
  408.     Frame:MakePopup()
  409.    
  410.     local vguiaimbotb = vgui.Create("DButton",Frame)
  411.     if MB.aimnotify then vguiaimbotb:SetText("Aim notify on") else vguiaimbotb:SetText("Aim notify off") end
  412.     vguiaimbotb:SetPos(extraw,extrah)
  413.     vguiaimbotb:SetWide(100)
  414.     function vguiaimbotb:DoClick()
  415.         MB.aimnotify = !MB.aimnotify
  416.         if MB.aimnotify then self:SetText("Aim notify on") else self:SetText("Aim notify off") end
  417.     end
  418.    
  419.     local vguimaintoggleb = vgui.Create("DButton",Frame)
  420.     if MB.meep then vguimaintoggleb:SetText("Wallhack on") else vguimaintoggleb:SetText("Wallhack off") end
  421.     vguimaintoggleb:SetPos(extraw,extrah * 2)
  422.     vguimaintoggleb:SetWide(100)
  423.     function vguimaintoggleb:DoClick()
  424.         MB.meep = !MB.meep
  425.         if MB.meep then self:SetText("Wallhack on") else self:SetText("Wallhack off") end
  426.     end
  427.    
  428.     local vguibindb = vgui.Create("DButton",Frame)
  429.     vguibindb:SetPos(extraw * 2 + 100,extrah * 2)
  430.     vguibindb:SetWide(100)
  431.     vguibindb:SetText("List binds in ~")
  432.     function vguibindb:DoClick()
  433.         for _,v in pairs(MB.commands) do
  434.             MsgN(v["name"].." is "..v["number"])
  435.         end
  436.     end
  437.    
  438.     local vguiselfdestructb = vgui.Create("DButton",Frame)
  439.     vguiselfdestructb:SetPos(extraw * 2 + 100,extrah)
  440.     vguiselfdestructb:SetWide(100)
  441.     vguiselfdestructb:SetText("Self Destruct")
  442.     function vguiselfdestructb:DoClick()
  443.         for _,v in pairs(MB.hooks) do
  444.             hook.Remove(v["type"],v["name"])
  445.             MsgN(v["name"].." was removed! ("..v["type"]..")")
  446.         end
  447.         for _,v in pairs (MB.timers) do
  448.             timer.Remove(v["name"])
  449.             MsgN(v["desc"].." was removed! ("..v["name"]..")")
  450.         end
  451.         for _,v in pairs (MB.commands) do
  452.             concommand.Remove(v["number"])
  453.             MsgN(v["name"].." was removed! ("..v["number"]..")")
  454.         end
  455.         Frame:SetVisible(false)
  456.     end
  457.    
  458. end)
  459.  
  460. chat.AddText("Bind a key to: "..MB.commands["ShowWindow"]["number"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement