Guest User

Untitled

a guest
Aug 15th, 2021
1,381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.01 KB | None | 0 0
  1. -- by https://steamcommunity.com/id/Pastebin/
  2. -- https://www.mpgh.net/forum/showthread.php?t=1432417
  3.  
  4.  
  5. netCodes = netCodes or {
  6. ["SendToServer"] = net.SendToServer,
  7. ["Start"] = net.Start,
  8. ["WriteAngle"] = net.WriteAngle,
  9. ["WriteBit"] = net.WriteBit,
  10. ["WriteBool"] = net.WriteBool,
  11. ["WriteColor"] = net.WriteColor,
  12. ["WriteData"] = net.WriteData,
  13. ["WriteDouble"] = net.WriteDouble,
  14. ["WriteEntity"] = net.WriteEntity,
  15. ["WriteFloat"] = net.WriteFloat,
  16. ["WriteInt"] = net.WriteInt,
  17. ["WriteMatrix"] = net.WriteMatrix,
  18. ["WriteNormal"] = net.WriteNormal,
  19. ["WriteString"] = net.WriteString,
  20. ["WriteTable"] = net.WriteTable,
  21. ["WriteUInt"] = net.WriteUInt,
  22. ["WriteVector"] = net.WriteVector
  23. }
  24.  
  25. function tableToString(t)
  26. if type(o) == 'table' then
  27. local s = '{ '
  28. for k,v in pairs(o) do
  29. if type(k) ~= 'number' then k = '"'..k..'"' end
  30. s = s .. '['..k..'] = ' .. dump(v) .. ','
  31. end
  32. return s .. '} '
  33. else
  34. return tostring(o)
  35. end
  36. end
  37.  
  38.  
  39. local buffer = ""
  40.  
  41. local function construct_net_block(t, netName)
  42. makeString = "net." ..netName .. "("
  43. for i=1, #t do
  44. indexValue = t[i]
  45. if (type(indexValue) == "number") then
  46. if (i == #t) then makeString = makeString .. indexValue else makeString = makeString .. indexValue .. ", " end
  47. elseif (type(indexValue) == "boolean") then
  48. makeString = makeString .. tostring(indexValue)
  49. elseif (type(indexValue) == "string") then
  50. if (i == #t) then makeString = makeString .. "\"" .. indexValue .. "\"" else makeString = makeString .. "\"" .. indexValue .. "\", " end
  51. elseif (type(indexValue) == "Player" || type(indexValue) == "Entity" || type(indexValue) == "NPC") then
  52. makeString = makeString .. "Entity(" .. tostring(indexValue:EntIndex()) .. ")"
  53. elseif (type(indexValue) == "Vector") then
  54. makeString = makeString .. "Vector(" .. string.gsub(tostring(indexValue), "%s+", ", ") .. ")"
  55. elseif (type(indexValue) == "table") then
  56. print("INDEXVALUE IS TABLE")
  57. print("indevalue", table.ToString(indexValue))
  58. makeString = makeString .. table.ToString(indexValue)
  59. else
  60. ErrorNoHalt("[netlogthing] !!! UNHANDLED !!! " .. "type(index): " .. "[" .. type(indexValue) .. "]" .. " index: " .. "[" .. tostring(indexValue) .. "]")
  61. end
  62. end
  63.  
  64. buffer = buffer .. makeString .. ")" .. "\n"
  65. if (string.match(buffer, "SendToServer")) then
  66. hook.Run( "RecvNetMsg", buffer )
  67. buffer = ""
  68. end
  69. end
  70.  
  71.  
  72.  
  73. -- net request sent
  74. -- net requests go through our
  75.  
  76.  
  77.  
  78. function handle_net_message(netName)
  79. return function (...) -- just doing this so I can give access to netName in construct_net_block function
  80. construct_net_block({...}, netName)
  81. hook.Add( "RecvNetMsg", "netlogger", function(netmsg)
  82. detour_net_functions(false)
  83. RunString(netmsg)
  84. detour_net_functions(true)
  85. end)
  86.  
  87. -- netCodes[netName](...)
  88. end
  89. end
  90.  
  91.  
  92. function detour_net_functions(bool) -- WriteTable calls a bunch of other net functions internally, so got to turn it off
  93. if (bool) then
  94. for k, v in pairs(netCodes) do
  95. net[k] = handle_net_message(k)
  96. end
  97. else
  98. for k, v in pairs(netCodes) do
  99. net[k] = v
  100. end
  101. end
  102.  
  103. end
  104.  
  105.  
  106. if (!detoured_net_functions) then
  107. detoured_net_functions = true
  108. detour_net_functions(true)
  109. else
  110. print("\n\n\nAlready detoured net functions\n\n\n")
  111. end
  112.  
  113.  
  114.  
  115.  
  116. surface.CreateFont( "customFont2", {
  117. font = "Verdana", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  118. extended = false,
  119. size = 15,
  120. weight = 100,
  121. blursize = 0,
  122. scanlines = 0,
  123. antialias = true,
  124. underline = false,
  125. italic = false,
  126. strikeout = false,
  127. symbol = false,
  128. rotary = false,
  129. shadow = false,
  130. additive = false,
  131. outline = false,
  132. } )
  133.  
  134. function mysplit(inputstr, sep)
  135. if sep == nil then
  136. sep = "%s"
  137. end
  138. local t={} ; i=1
  139. for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
  140. t[i] = str
  141. i = i + 1
  142. end
  143. return t
  144. end
  145.  
  146. local net_message_box = {
  147. setTextAndCount = function(self, text, count)
  148. newLineCount = #mysplit(text, "\n")
  149. self:SetTitle(" #" .. tostring(count))
  150. self.netmsgBox:SetText(text)
  151. W, H = self.netmsgBox:GetSize()
  152. W, H = self.netmsgBox:GetSize()
  153. self:SetSize(W, H + 200)
  154. self:SizeToContents()
  155.  
  156. end,
  157. Init = function(self)
  158. outer_self = self
  159. self:ShowCloseButton( false )
  160. self:SetSize(150, 400)
  161. self.W, self.H = self:GetSize()
  162. self.netmsgBox = vgui.Create( "DTextEntry", self)
  163. self.netmsgBox:SetPos( 40, 50 )
  164. self.netmsgBox:Dock(FILL)
  165. self.netmsgBox:SetMultiline(true);
  166. self.netmsgBox.Paint = function(self,w,h)
  167. draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
  168. self:DrawTextEntryText(Color(255, 255, 255), Color(30, 130, 255), Color(255, 255, 255))
  169. end
  170.  
  171. local closeBtn = vgui.Create( "Button", self)
  172. closeBtn:SetSize( 14,14 )
  173. closeBtn:SetPos(5,6)
  174. closeBtn:SetVisible( true )
  175. closeBtn:SetText( "" )
  176. closeBtn.Paint = function(self,w,h)
  177. draw.RoundedBox(5, 0, 0, w, h, Color(225,81,32, 255))
  178. -- surface.DrawCircle( 100, 100, 50, Color(255,255,255,255) )
  179. draw.DrawText( "x", "customFont2", w/2, -1, Color( 255,255,255, 255 ), TEXT_ALIGN_CENTER )
  180. end
  181. print("outer_self", outer_self)
  182. function closeBtn:OnMousePressed()
  183. outer_self:SetVisible(false)
  184. outer_self:Remove()
  185. end
  186.  
  187. end,
  188.  
  189. Paint = function(self, w, h)
  190. draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
  191. surface.SetDrawColor( Color( 200, 200, 200, 255 ) )
  192. surface.DrawOutlinedRect(0,0, w-1,h-1)
  193. surface.DrawOutlinedRect(0,0, w-1,25)
  194. end,
  195. Think = function(self, w, h)
  196. if (self:IsHovered()) then
  197.  
  198. end
  199. end
  200. }
  201.  
  202. vgui.Register("netmessagebox", net_message_box, "DFrame")
  203. -- net_message_box = vgui.Create("netmessagebox")
  204. -- net_message_box:setTextAndCount("net.Start('test')\nnet.SendToServer()")
  205.  
  206.  
  207.  
  208.  
  209. browser = {
  210. Init = function(self)
  211. self.W, self.H = self:GetSize()
  212. self:SetSize(self.W * 15, 555)
  213. self:ShowCloseButton(false)
  214. self:SetDraggable(true)
  215. self.gmodwiki = vgui.Create("DHTML", self)
  216. self.gmodwiki:OpenURL("http://wiki.garrysmod.com/page/Main_Page")
  217. self.gmodwiki.zoom = 100
  218. self.gmodwiki:Dock(FILL)
  219. self:SetTitle("")
  220. -- self:MakePopup()
  221.  
  222. local addressBar = vgui.Create( "DTextEntry", self ) -- create the form as a child of frame
  223. addressBar:SetPos( 60, 2 )
  224. addressBar:SetSize( 400, 25 )
  225. addressBar:SetText("http://wiki.garrysmod.com/page/Main_Page")
  226. addressBar.OnEnter = function( self1 )
  227. self.gmodwiki:OpenURL( self1:GetValue() ) -- print the form's text as server text
  228. end
  229.  
  230. local backBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
  231. backBtn:SetPos( 5, 2 )
  232. backBtn:SetSize( 25, 25 )
  233. backBtn:SetText("<")
  234. backBtn:SetTextColor(Color(255,255,255))
  235. backBtn.DoClick = function()
  236. self.gmodwiki:RunJavascript([[window.history.go(-1)]])
  237. end
  238.  
  239. backBtn.Paint = function(self, w, h)
  240. draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
  241. end
  242.  
  243. local forwardBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
  244. forwardBtn:SetPos( 35, 2 )
  245. forwardBtn:SetSize( 25, 25 )
  246. forwardBtn:SetText(">")
  247. forwardBtn:SetTextColor(Color(255,255,255))
  248. forwardBtn.DoClick = function()
  249. self.gmodwiki:RunJavascript([[window.history.go(1)]])
  250. end
  251. forwardBtn.Paint = function(self, w, h)
  252. draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
  253. end
  254.  
  255.  
  256. self.gmodwiki:RunJavascript([[
  257. String.prototype.startsWith = function(char){
  258. return this[0] == char;
  259. }
  260. ]]) -- pls update gmod's javascript engine
  261.  
  262.  
  263.  
  264. local zoomInBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
  265. zoomInBtn:SetPos( 465, 2 )
  266. zoomInBtn:SetSize( 45, 25 )
  267. zoomInBtn:SetText("Zoom in")
  268. zoomInBtn:SetTextColor(Color(255,255,255))
  269. zoomInBtn.DoClick = function()
  270. self.gmodwiki.zoom = self.gmodwiki.zoom + 10
  271. self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";")
  272. end
  273. zoomInBtn.Paint = function(self, w, h)
  274. draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
  275. end
  276.  
  277. local zoomOutBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
  278. zoomOutBtn:SetPos( 515, 2 )
  279. zoomOutBtn:SetSize( 45, 25 )
  280. zoomOutBtn:SetText("Zoom out")
  281. zoomOutBtn:SetTextColor(Color(255,255,255))
  282. zoomOutBtn.DoClick = function()
  283. self.gmodwiki.zoom = self.gmodwiki.zoom - 10
  284. self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";")
  285. end
  286. zoomOutBtn.Paint = function(self, w, h)
  287. draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
  288. end
  289.  
  290.  
  291. -- local closeBtn = vgui.Create( "DButton", self )
  292. -- closeBtn:SetText( "X" )
  293. -- closeBtn:SetPos( 575, 5 )
  294. -- closeBtn:SetSize( 20, 20 )
  295. -- closeBtn:SetTextColor(Color(255,255,255))
  296. -- closeBtn.DoClick = function()
  297. -- self.gmodwiki:RunJavascript([[document.getElementsByTagName("body")[0].style.zoom = "200%"]])
  298. -- timer.Simple(5, function()
  299. -- self:Close()
  300. -- end)
  301. -- end
  302. -- closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end
  303.  
  304. self.Paint = function(self, w,h)
  305. draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255))
  306. end
  307. self.Think = function(self)
  308.  
  309. end
  310. end,
  311. }
  312. vgui.Register("browser", browser, "DFrame")
  313.  
  314. -- vgui.Create("browser")
  315.  
  316.  
  317.  
  318. local infoPopup = {
  319.  
  320. setInfoText = function(self, tab_name)
  321. -- print(self.infopopupTexts[tab_name].header)
  322. self.header:SetText(self.infopopupTexts[tab_name].header)
  323. self.infoText:SetText(self.infopopupTexts[tab_name].infoText)
  324. end,
  325.  
  326. Init = function(self)
  327.  
  328. self.infopopupTexts = {
  329. -- Tab = {header = "", infoText = ""},
  330. ExploitTab = {header = "Exploit Tab", infoText = "You can upload your exploits locally or to the web here. This tab is also responsible for finding every single net message name on the server you load this menu on and saves it locally so we can tell if other servers have common exploits"},
  331. NetLoggerTab = {header = "Net logger Tab", infoText = "Logs all the net messages that come through. Useful for things that you can easily interact with that sends net messages i.e NPCs"},
  332. RepeaterTab = {header = "Repeater Tab", infoText = "Repeats the given net messages"},
  333. interceptorTab = {header = "Intercepter Tab", infoText = "Repeats the given net messages"},
  334. LuaViewerTab = {header = "Lua viewer Tab", infoText = "View all the server's client side files here"},
  335. LuaEditorTab = {header = "Lua editor Tab", infoText = "Simple lua editor with a \"browser\" built in"}
  336. },
  337.  
  338.  
  339. self:SetTitle("")
  340. self:SetSize(350, 350)
  341. self:Center()
  342. self:MakePopup()
  343. self:ShowCloseButton(false)
  344.  
  345.  
  346. local closeBtn = vgui.Create( "DButton", self )
  347. closeBtn:SetText( "X" )
  348. closeBtn:SetPos( 325, 5 )
  349. closeBtn:SetSize( 20, 20 )
  350. closeBtn:SetTextColor(Color(255,255,255))
  351. closeBtn.DoClick = function() self:Close() end
  352. closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end
  353.  
  354. self.header = vgui.Create("DLabel", self)
  355. self.header:SetFont("headerFont1")
  356. self.header:SetSize(150, 35)
  357. -- self.header:SetText("Exploits tab")
  358. self.header:Center()
  359. self.header.posX, self.header.posY = self.header:GetPos()
  360. self.header:SetPos(self.header.posX, 15)
  361.  
  362.  
  363. self.infoText = vgui.Create("DLabel", self)
  364. self.infoText:SetFont("infoFont")
  365. self.infoText:SetSize(320, 200)
  366. self.infoText:SetPos(30, 10)
  367.  
  368. -- self.infoText:SetText("You can upload your exploits locally or to the web here. This tab is also responsible for finding every single net message name on the server you load this menu on and saves it locally so we can tell if other servers have common exploits")
  369. self.infoText:SetWrap(true)
  370.  
  371.  
  372. self.footerText = vgui.Create("DLabel", self)
  373. self.footerText:SetFont("infoFont")
  374. self.footerText:SetSize(100, 20)
  375. self.footerText:Center()
  376. self.footerText.posX, self.footerText.posY = self.footerText:GetPos()
  377. self.footerText:SetPos(self.footerText.posX, 320)
  378.  
  379. self.footerText:SetText("Made by Riddle")
  380. self.footerText:SetWrap(true)
  381.  
  382. self.Paint = function(self,w,h)
  383. draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
  384.  
  385. surface.SetDrawColor(Color(255,255,255))
  386. startX = 0
  387. endX = 350
  388. startY = 65
  389. endY = 65
  390. surface.DrawLine( startX, startY, endX, endY )
  391. DrawRainbowRectOutline(1, 0,0, w-1,h-1, 2)
  392. end
  393.  
  394. end,
  395.  
  396. }
  397.  
  398. vgui.Register("infoPopup", infoPopup, "DFrame")
  399.  
  400.  
  401. gmodWikiFrame = {
  402. Init = function(self)
  403. self:SetSize(700, 600)
  404.  
  405. self.gmodwiki = vgui.Create("DHTML", self)
  406. self.gmodwiki:Dock(FILL)
  407. self.gmodwiki:OpenURL("http://wiki.garrysmod.com/page/Main_Page")
  408.  
  409. end,
  410. }
  411.  
  412.  
  413. local runCode = ""
  414. local CodeEditor = {
  415. setFill = function(self, b)
  416. if (b) then
  417. self:Dock(FILL)
  418. end
  419. end,
  420.  
  421. setText = function(self, text)
  422. self.html:RunJavascript("SetContent(" .. "'" .. text .. "')")
  423. end,
  424.  
  425. createTextInput = function(self)
  426. self.LuaInput = vgui.Create("DTextEntry", self.right)
  427. self.LuaInput:Dock(FILL)
  428. -- self.LuaInput:SetTall(self:GetParent():GetTall())
  429. self.LuaInput:SetMultiline(true)
  430. self.LuaInput:SetUpdateOnType(true)
  431. self.LuaInput:SetTabbingDisabled(false)
  432. self.LuaInput:SetCursorColor( Color(0, 255, 0, 255) )
  433. self.LuaInput:SetTextColor( Color(255, 0, 0, 255) )
  434. self.LuaInput:SetFont("ChatFont")
  435. self.LuaInput:SetText("print('Code is running')")
  436. self.LuaInput.OnValueChange = function(self, value)
  437. runCode = value
  438. end
  439. end,
  440.  
  441. createButton = function(self)
  442. self.runLuaBtn = vgui.Create("DButton", self.right)
  443. self.runLuaBtn:Dock(BOTTOM)
  444. self.runLuaBtn:SetTall(self.runLuaBtn:GetTall() * 1.5)
  445. self.runLuaBtn:SetText("Run lua")
  446. self.runLuaBtn.DoClick = function()
  447.  
  448. if (not runCode) then
  449. print(LocalPlayer():ChatPrint("You need to type some code to run it!"))
  450. return
  451. end
  452. RunString(runCode)
  453. end
  454. self.runLuaBtn:SetTextColor(Color(255,255,255))
  455. self.runLuaBtn.Paint = function(self, w, h)
  456. draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
  457. end
  458.  
  459. end,
  460.  
  461. showButton = function(self, b)
  462. self.shouldHaveButton = b
  463. end,
  464.  
  465. Init = function(self)
  466. self.shouldHaveButton = true
  467. self:SetSize(250, 250)
  468.  
  469. -- self:SetPos(20, 30)
  470.  
  471.  
  472. self.right = vgui.Create("PANEL", self)
  473. self.right:Dock(FILL)
  474.  
  475. self.html = vgui.Create("DHTML", self.right)
  476. self.html:Dock(FILL)
  477. self.html:SetAllowLua(true)
  478. self.html:OpenURL("asset://garrysmod/lua/menu_plugins/luaviewer/index.html") --thx metastruct
  479. self.html:AddFunction("gmodinterface", "OnCode", function(code)
  480. self.currentCode = code
  481. end)
  482.  
  483. -- self.html:RunJavascript("SetContent(" .. "'" .. content .. "')")
  484.  
  485.  
  486.  
  487. self.html:AddFunction("gmodinterface", "DoLog", function(logstr) print("Log\t=\t", logstr) end)
  488. timer.Simple(0.1, function()
  489. if (self.shouldHaveButton) then
  490. self:createButton()
  491. self:createTextInput()
  492. else
  493. self.html:RunJavascript([[SetFontSize(10)]])
  494. end
  495. end)
  496. end
  497.  
  498. }
  499. vgui.Register("CodeEditor", CodeEditor, "DPanel")
  500.  
  501.  
  502. surface.CreateFont( "questionMarkFont", {
  503. font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
  504. extended = false,
  505. size = 17,
  506. weight = 500,
  507. blursize = 0,
  508. scanlines = 0,
  509. antialias = true,
  510. underline = false,
  511. italic = false,
  512. strikeout = false,
  513. symbol = false,
  514. rotary = false,
  515. shadow = false,
  516. additive = false,
  517. outline = false,
  518. } )
  519.  
  520.  
  521. -- if (string.len(file.Read( "exploits.txt", "DATA" )) < 5) then
  522. -- default = {serversWithExploits = {}, exploits = {}, loggedServers = {}}
  523. -- file.Write( "exploits.txt", util.TableToJSON(default) )
  524. -- end
  525.  
  526. local net_message_table = {}
  527. local PANEL = {
  528. addToCatergory = function(self, netmsg, freq)
  529. local name = mysplit(netmsg, "\n")[1]
  530. if not net_message_table[name] then
  531. local Category = self.CategoryList:Add(name)
  532. Category:SetExpanded(false)
  533.  
  534. local countLabel = vgui.Create( "DLabel", Category )
  535. countLabel:SetFont("customFont2")
  536. countLabel:SetColor(Color(255,255,255))
  537. countLabel:SetPos( 280, 0 )
  538. countLabel:SetSize(200,16)
  539. countLabel:SetText("COUNT: 1")
  540.  
  541. net_message_box = vgui.Create("netmessagebox")
  542. net_message_box:Dock( TOP )
  543. net_message_box:setTextAndCount(netmsg, 1)
  544.  
  545.  
  546. DScrollPanel = vgui.Create( "DScrollPanel")
  547. Category:SetContents(DScrollPanel)
  548.  
  549. DScrollPanel:Add(net_message_box)
  550. DScrollPanel:Dock( FILL )
  551. -- 51.38.95.230:27015
  552.  
  553. net_message_table[name] = {panel = Category, count = 1, countLabel = countLabel, DScrollPanel = DScrollPanel}
  554. Category.Paint = function (s,w,h)
  555. draw.RoundedBox(0, 0, 0, w, h, Color(70,69,65))
  556. end
  557. else
  558. count = net_message_table[name].count + 1
  559. countLabel = net_message_table[name]["countLabel"]
  560. panel = net_message_table[name]["panel"]
  561. DScrollPanel = net_message_table[name]["DScrollPanel"]
  562.  
  563. net_message_table[name] = { panel = panel, count = count, countLabel = countLabel, DScrollPanel = DScrollPanel}
  564.  
  565. panel:SetLabel(name)
  566.  
  567. countLabel:SetFont("customFont2")
  568. countLabel:SetColor(Color(255,255,255))
  569. countLabel:SetPos( 280, 0 )
  570. countLabel:SetText("COUNT: " .. count)
  571.  
  572. net_message_box = vgui.Create("netmessagebox")
  573. net_message_box:setTextAndCount(netmsg, count)
  574. net_message_box:Dock( TOP )
  575. DScrollPanel:Add(net_message_box)
  576. DScrollPanel:Dock( FILL )
  577.  
  578. self.i = 0
  579.  
  580. end
  581. end,
  582.  
  583. DrawRainbowRectOutline = function(self, frequency, x, y, w, h )
  584. for i = x, x + w - 1 do
  585. surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) )
  586. surface.DrawLine( i, y, i + 1, y )
  587. surface.DrawLine( i, y + h - 1, i + 1, y + h )
  588. end
  589. for i = y, y + h - 1 do
  590. surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) )
  591. surface.DrawLine( x, i, x, i + 1 )
  592. surface.DrawLine( x + w - 1, i, x + w, i + 1 )
  593. end
  594. end,
  595.  
  596. Paint = function(self, w, h)
  597. draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255))
  598. self:DrawRainbowRectOutline(1,0,0, w-1,h-1, 2)
  599. end,
  600.  
  601. Think = function(self, w, h)
  602. self.W, self.H = self:GetSize()
  603. if (self.isFrameOpen) then
  604. self.openGmodWiki:SetVisible(true)
  605. else
  606. self.openGmodWiki:SetVisible(false)
  607. end
  608. self.W, self.H = w, h
  609. end
  610. }
  611.  
  612. function PANEL:IsOpen(b)
  613. self.isFrameOpen = b
  614. end
  615.  
  616.  
  617. function PANEL:Init()
  618. self.isFrameOpen = true
  619.  
  620. self.W, self.H = self:GetSize()
  621.  
  622. outside_self = self
  623. self:SetSize(400, 400)
  624. self:SetTitle("Riddle's menu")
  625. self:Center()
  626. self:SetVisible( true )
  627. self:SetDeleteOnClose(false)
  628. self.W, self.H = self:GetSize()
  629. self:ShowCloseButton(false)
  630.  
  631. self.currentTab = "ExploitTab"
  632.  
  633. local closeBtn = vgui.Create( "DButton", self )
  634. closeBtn:SetText( "X" )
  635. closeBtn:SetPos( self.W * 0.93, 5 )
  636. closeBtn:SetSize( 20, 20 )
  637. closeBtn:SetTextColor(Color(255,255,255))
  638. closeBtn.DoClick = function() self:Close() end
  639. closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end
  640.  
  641. local infoBtn = vgui.Create( "DButton", self )
  642. infoBtn:SetText( "?" )
  643. infoBtn:SetFont("questionMarkFont")
  644. infoBtn:SetPos( self.W * 0.87, 5 )
  645. infoBtn:SetSize( 20, 20 )
  646. infoBtn:SetTextColor(Color(255,255,255))
  647. infoBtn.DoClick = function()
  648. infoPopup = vgui.Create("infoPopup")
  649. infoPopup:setInfoText(self.currentTab)
  650. end
  651. infoBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(37, 37, 170)) end
  652.  
  653.  
  654.  
  655. sheet = vgui.Create( "DPropertySheet", self )
  656. sheet:SetPos(1, 20)
  657. sheet:SetSize(397, 376)
  658.  
  659. local exploitsPanel = vgui.Create( "DPanel", sheet )
  660. exploitsPanel:Dock(FILL)
  661.  
  662.  
  663. self.NetLoggerPanel = vgui.Create( "DPanel", sheet )
  664. self.NetLoggerPanel:Dock(FILL)
  665.  
  666. local repeaterPanel = vgui.Create( "DPanel", sheet )
  667. repeaterPanel:Dock(FILL)
  668.  
  669. -- local luaViewerPanel = vgui.Create( "DPanel", sheet )
  670. -- luaViewerPanel:Dock(FILL)
  671.  
  672. local luaEditorPanel = vgui.Create( "DPanel", sheet )
  673. luaEditorPanel:Dock(FILL)
  674.  
  675. -- ExploitsTab = sheet:AddSheet( "Exploits", exploitsPanel, "icon16/world.png" )
  676. NetLoggerTab = sheet:AddSheet( "Net Logger", self.NetLoggerPanel, "icon16/page_white_edit.png" )
  677. repeaterTab = sheet:AddSheet( "Repeater", repeaterPanel, "icon16/arrow_rotate_anticlockwise.png" )
  678. interceptorTab = sheet:AddSheet( "Intcepter", repeaterPanel, "icon16/lock_go.png" )
  679. --luaViewerTab = sheet:AddSheet( "Lua Viewer", luaViewerPanel, "icon16/folder.png", false, false, "See server's clientside files" )
  680. luaEditorTab = sheet:AddSheet( "Lua Editor", luaEditorPanel, "icon16/application_xp_terminal.png", false, false, "See server's clientside files" )
  681.  
  682.  
  683. self.NetLoggerPanel.Paint = function(s,w,h)
  684. draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
  685. end
  686.  
  687. self.CategoryList = vgui.Create( "DCategoryList", self.NetLoggerPanel )
  688. self.CategoryList.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34)) end
  689. self.CategoryList:Dock( FILL )
  690.  
  691. -- adding stuff to net_logger
  692. c = 0
  693. hook.Add( "RecvNetMsg", "netlogger2", function( netmsg )
  694. c = c + 1
  695. self:addToCatergory(netmsg, c)
  696. end )
  697.  
  698. -- creating the panels
  699. -- luaViewer = vgui.Create("luaviewer", luaViewerPanel)
  700. luaEditor = vgui.Create("CodeEditor", luaEditorPanel)
  701. luaEditor:setFill(true)
  702. --main_menu = vgui.Create("main_menu", exploitsPanel)
  703.  
  704. local browser = vgui.Create("browser", self)
  705. browser:SetPos(600,40)
  706. browser:SetVisible(false)
  707.  
  708. -- Detouring and resizeing the panels when you click on them
  709. -- DoClickExploitsTab = ExploitsTab.Tab.DoClick
  710. DoClickNetLoggerTab = NetLoggerTab.Tab.DoClick
  711. --DoClickrepeaterTab = luaViewerTab.Tab.DoClick
  712. DoClickLuaViewerTab = repeaterTab.Tab.DoClick
  713. DoClickluaEditorTab = luaEditorTab.Tab.DoClick
  714. DoClickincepterTab = interceptorTab.Tab.DoClick
  715.  
  716.  
  717. -- ExploitsTab.Tab.DoClick = function (...)
  718. -- -- outside_self:SizeTo(400, 600, 0.2, 0, 4)
  719. -- -- sheet:SetSize(397, 574)
  720. -- browser:SetVisible(false)
  721. -- outside_self:SizeTo(700, 600, 0.2, 0, 4)
  722. -- sheet:SetSize(697, 574)
  723.  
  724. -- timer.Create( "Center2", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.92, 5 ) closeBtn:SetPos(self.W * 0.96, 5) end )
  725. -- self.currentTab = "ExploitTab"
  726. -- DoClickExploitsTab(...)
  727. -- end
  728.  
  729.  
  730. NetLoggerTab.Tab.DoClick = function (...)
  731. outside_self:SizeTo(400, 400, 0.2, 0, 4)
  732. sheet:SetSize(397, 376)
  733.  
  734. -- closeBtn:SetPos(self.W * 0.95, 5)
  735.  
  736. timer.Create( "Center3", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.87, 2 ) closeBtn:SetPos(self.W * 0.93, 2) end )
  737. self.currentTab = "NetLoggerTab"
  738. DoClickNetLoggerTab(...)
  739. end
  740.  
  741. repeaterTab.Tab.DoClick = function (...)
  742. -- outside_self:SizeTo(400, 400, 0.2, 0, 4)
  743. -- sheet:SetSize(400, 379)
  744.  
  745. -- timer.Create( "Center2", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.87, 2 ) closeBtn:SetPos(self.W * 0.93, 2) end )
  746. -- self.currentTab = "RepeaterTab"
  747. -- DoClickrepeaterTab(...) -- stops the click from going through i.e wont switch when clicked
  748. end
  749.  
  750.  
  751. interceptorTab.Tab.DoClick = function (...)
  752. -- outside_self:SizeTo(400, 400, 0.2, 0, 4)
  753. -- sheet:SetSize(400, 379)
  754.  
  755. -- timer.Create( "Center2", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.87, 2 ) closeBtn:SetPos(self.W * 0.93, 2) end )
  756. -- self.currentTab = "interceptorTab"
  757. -- DoClickincepterTab(...) -- stops the click from going through i.e wont switch when clicked
  758. end
  759.  
  760. -- luaViewerTab.Tab.DoClick = function(...)
  761. -- outside_self:SizeTo(ScrW() * .95, ScrH() * .95, 0.2, 0, 4)
  762. -- sheet:SetSize(ScrW() * .95, ScrH() * .95)
  763. -- browser:SetVisible(false)
  764. -- timer.Create( "Center1", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.94, 5 ) closeBtn:SetPos(self.W * 0.97, 5) end )
  765.  
  766. -- self.currentTab = "LuaViewerTab"
  767. -- DoClickLuaViewerTab(...)
  768.  
  769. -- end
  770.  
  771.  
  772.  
  773. luaEditorTab.Tab.DoClick = function (...)
  774. outside_self:SizeTo(595, 600, 0.2, 0, 4)
  775. sheet:SetSize(592, 578)
  776.  
  777. -- outside_self:SizeTo(1200, 600, 0.2, 0, 4)
  778. -- sheet:SetSize(592, 578)
  779. browser:SetVisible(true)
  780. timer.Create( "Center4", 0.1, 5, function() outside_self:Center() infoBtn:SetPos( self.W * 0.90, 5 ) closeBtn:SetPos(self.W * 0.95, 5) end )
  781.  
  782. self.currentTab = "LuaEditorTab"
  783. DoClickluaEditorTab(...)
  784.  
  785. end
  786. self.OnClose = function() self:IsOpen(false) self.openGmodWiki:SetVisible(false) print("closing") gui.EnableScreenClicker(false) end
  787.  
  788.  
  789.  
  790.  
  791. self.openGmodWiki = vgui.Create("DButton", luaEditor)
  792. self.openGmodWiki:SetPos(575, 250)
  793. self.openGmodWiki:SetSize(15, 20)
  794. self.openGmodWiki:SetText(">")
  795. self.openGmodWiki:SetTextColor(Color(255,255,255))
  796. self.openGmodWiki.isOpen = false
  797. self.openGmodWiki.DoClick = function()
  798. self.openGmodWiki.isOpen = !self.openGmodWiki.isOpen
  799. if (self.openGmodWiki.isOpen) then
  800. outside_self:SizeTo(ScrW() * 0.99, 600, 0.2, 0, 4)
  801. self.openGmodWiki:SetText("<")
  802. else
  803. outside_self:SizeTo(595, 600, 0.2, 0, 4)
  804. self.openGmodWiki:SetText(">")
  805. end
  806.  
  807. sheet:SetSize(592, 578)
  808.  
  809.  
  810.  
  811. timer.Create( "Center4", 0.1, 20, function() outside_self:Center() end )
  812. end
  813.  
  814. self.openGmodWiki.Paint = function(self, w, h)
  815. -- 39 G: 40 B: 34
  816. draw.RoundedBox(0, 0, 0, w, h, Color(69, 70, 64))
  817. end
  818.  
  819.  
  820. self.Think = function()
  821. self.W, self.H = self:GetSize()
  822. -- print(self.W)
  823. end
  824.  
  825. end
  826.  
  827. vgui.Register("frame_handler", PANEL, "DFrame")
  828.  
  829. exploit_menu = vgui.Create("frame_handler")
  830. exploit_menu:MakePopup()
  831.  
  832. concommand.Add("_dbg", function()
  833. net.Start("test_message")
  834. net.SendToServer()
  835. end)
  836.  
  837. concommand.Add("_menu", function ()
  838. if (!exploit_menu) then
  839. exploit_menu = vgui.Create("frame_handler")
  840. end
  841. gui.EnableScreenClicker(true)
  842. exploit_menu:IsOpen(true)
  843. exploit_menu:MakePopup()
  844. exploit_menu:SetVisible( true )
  845. end)
Add Comment
Please, Sign In to add comment