354 lines
11 KiB
Lua
354 lines
11 KiB
Lua
-- include("main_menu.lua")
|
|
-- include("lua_viewer.lua")
|
|
gluesteak.include("code_editor.lua")
|
|
gluesteak.include("net_logger.lua")
|
|
gluesteak.include("net_message_box.lua")
|
|
gluesteak.include("browser.lua")
|
|
gluesteak.include("popup.lua")
|
|
surface.CreateFont( "questionMarkFont", {
|
|
font = "Arial", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
|
|
extended = false,
|
|
size = 17,
|
|
weight = 500,
|
|
blursize = 0,
|
|
scanlines = 0,
|
|
antialias = true,
|
|
underline = false,
|
|
italic = false,
|
|
strikeout = false,
|
|
symbol = false,
|
|
rotary = false,
|
|
shadow = false,
|
|
additive = false,
|
|
outline = false,
|
|
} )
|
|
|
|
|
|
-- if (string.len(file.Read( "exploits.txt", "DATA" )) < 5) then
|
|
-- default = {serversWithExploits = {}, exploits = {}, loggedServers = {}}
|
|
-- file.Write( "exploits.txt", util.TableToJSON(default) )
|
|
-- end
|
|
|
|
local net_message_table = {}
|
|
local PANEL = {
|
|
addToCatergory = function(self, netmsg, freq)
|
|
local name = mysplit(netmsg, "\n")[1]
|
|
if not net_message_table[name] then
|
|
local Category = self.CategoryList:Add(name)
|
|
Category:SetExpanded(false)
|
|
|
|
local countLabel = vgui.Create( "DLabel", Category )
|
|
countLabel:SetFont("customFont2")
|
|
countLabel:SetColor(Color(255,255,255))
|
|
countLabel:SetPos( 280, 0 )
|
|
countLabel:SetSize(200,16)
|
|
countLabel:SetText("COUNT: 1")
|
|
|
|
net_message_box = vgui.Create("netmessagebox")
|
|
net_message_box:Dock( TOP )
|
|
net_message_box:setTextAndCount(netmsg, 1)
|
|
|
|
|
|
DScrollPanel = vgui.Create( "DScrollPanel")
|
|
Category:SetContents(DScrollPanel)
|
|
|
|
DScrollPanel:Add(net_message_box)
|
|
DScrollPanel:Dock( FILL )
|
|
-- 51.38.95.230:27015
|
|
|
|
net_message_table[name] = {panel = Category, count = 1, countLabel = countLabel, DScrollPanel = DScrollPanel}
|
|
Category.Paint = function (s,w,h)
|
|
draw.RoundedBox(0, 0, 0, w, h, Color(70,69,65))
|
|
end
|
|
else
|
|
count = net_message_table[name].count + 1
|
|
countLabel = net_message_table[name]["countLabel"]
|
|
panel = net_message_table[name]["panel"]
|
|
DScrollPanel = net_message_table[name]["DScrollPanel"]
|
|
|
|
net_message_table[name] = { panel = panel, count = count, countLabel = countLabel, DScrollPanel = DScrollPanel}
|
|
|
|
panel:SetLabel(name)
|
|
|
|
countLabel:SetFont("customFont2")
|
|
countLabel:SetColor(Color(255,255,255))
|
|
countLabel:SetPos( 280, 0 )
|
|
countLabel:SetText("COUNT: " .. count)
|
|
|
|
net_message_box = vgui.Create("netmessagebox")
|
|
net_message_box:setTextAndCount(netmsg, count)
|
|
net_message_box:Dock( TOP )
|
|
DScrollPanel:Add(net_message_box)
|
|
DScrollPanel:Dock( FILL )
|
|
|
|
self.i = 0
|
|
|
|
end
|
|
end,
|
|
|
|
DrawRainbowRectOutline = function(self, frequency, x, y, w, h )
|
|
for i = x, x + w - 1 do
|
|
surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) )
|
|
surface.DrawLine( i, y, i + 1, y )
|
|
surface.DrawLine( i, y + h - 1, i + 1, y + h )
|
|
end
|
|
for i = y, y + h - 1 do
|
|
surface.SetDrawColor( HSVToColor( i * frequency % 360, 1, 1 ) )
|
|
surface.DrawLine( x, i, x, i + 1 )
|
|
surface.DrawLine( x + w - 1, i, x + w, i + 1 )
|
|
end
|
|
end,
|
|
|
|
Paint = function(self, w, h)
|
|
draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255))
|
|
self:DrawRainbowRectOutline(1,0,0, w-1,h-1, 2)
|
|
end,
|
|
|
|
Think = function(self, w, h)
|
|
self.W, self.H = self:GetSize()
|
|
if (self.isFrameOpen) then
|
|
self.openGmodWiki:SetVisible(true)
|
|
else
|
|
self.openGmodWiki:SetVisible(false)
|
|
end
|
|
self.W, self.H = w, h
|
|
end
|
|
}
|
|
|
|
function PANEL:IsOpen(b)
|
|
self.isFrameOpen = b
|
|
end
|
|
|
|
|
|
function PANEL:Init()
|
|
self.isFrameOpen = true
|
|
|
|
self.W, self.H = self:GetSize()
|
|
|
|
outside_self = self
|
|
self:SetSize(400, 400)
|
|
self:SetTitle("Riddle's menu")
|
|
self:Center()
|
|
self:SetVisible( true )
|
|
self:SetDeleteOnClose(false)
|
|
self.W, self.H = self:GetSize()
|
|
self:ShowCloseButton(false)
|
|
|
|
self.currentTab = "ExploitTab"
|
|
|
|
local closeBtn = vgui.Create( "DButton", self )
|
|
closeBtn:SetText( "X" )
|
|
closeBtn:SetPos( self.W * 0.93, 5 )
|
|
closeBtn:SetSize( 20, 20 )
|
|
closeBtn:SetTextColor(Color(255,255,255))
|
|
closeBtn.DoClick = function() self:Close() end
|
|
closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end
|
|
|
|
local infoBtn = vgui.Create( "DButton", self )
|
|
infoBtn:SetText( "?" )
|
|
infoBtn:SetFont("questionMarkFont")
|
|
infoBtn:SetPos( self.W * 0.87, 5 )
|
|
infoBtn:SetSize( 20, 20 )
|
|
infoBtn:SetTextColor(Color(255,255,255))
|
|
infoBtn.DoClick = function()
|
|
infoPopup = vgui.Create("infoPopup")
|
|
infoPopup:setInfoText(self.currentTab)
|
|
end
|
|
infoBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(37, 37, 170)) end
|
|
|
|
|
|
|
|
sheet = vgui.Create( "DPropertySheet", self )
|
|
sheet:SetPos(1, 20)
|
|
sheet:SetSize(697, 574)
|
|
|
|
local exploitsPanel = vgui.Create( "DPanel", sheet )
|
|
exploitsPanel:Dock(FILL)
|
|
|
|
|
|
self.NetLoggerPanel = vgui.Create( "DPanel", sheet )
|
|
self.NetLoggerPanel:Dock(FILL)
|
|
|
|
local repeaterPanel = vgui.Create( "DPanel", sheet )
|
|
repeaterPanel:Dock(FILL)
|
|
|
|
-- local luaViewerPanel = vgui.Create( "DPanel", sheet )
|
|
-- luaViewerPanel:Dock(FILL)
|
|
|
|
local luaEditorPanel = vgui.Create( "DPanel", sheet )
|
|
luaEditorPanel:Dock(FILL)
|
|
|
|
-- ExploitsTab = sheet:AddSheet( "Exploits", exploitsPanel, "icon16/world.png" )
|
|
NetLoggerTab = sheet:AddSheet( "Net Logger", self.NetLoggerPanel, "icon16/page_white_edit.png" )
|
|
repeaterTab = sheet:AddSheet( "Repeater", repeaterPanel, "icon16/arrow_rotate_anticlockwise.png" )
|
|
interceptorTab = sheet:AddSheet( "Intcepter", repeaterPanel, "icon16/lock_go.png" )
|
|
--luaViewerTab = sheet:AddSheet( "Lua Viewer", luaViewerPanel, "icon16/folder.png", false, false, "See server's clientside files" )
|
|
luaEditorTab = sheet:AddSheet( "Lua Editor", luaEditorPanel, "icon16/application_xp_terminal.png", false, false, "See server's clientside files" )
|
|
|
|
|
|
self.NetLoggerPanel.Paint = function(s,w,h)
|
|
draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
|
|
end
|
|
|
|
self.CategoryList = vgui.Create( "DCategoryList", self.NetLoggerPanel )
|
|
self.CategoryList.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34)) end
|
|
self.CategoryList:Dock( FILL )
|
|
|
|
-- adding stuff to net_logger
|
|
c = 0
|
|
hook.Add( "RecvNetMsg", "netlogger2", function( netmsg )
|
|
c = c + 1
|
|
self:addToCatergory(netmsg, c)
|
|
end )
|
|
|
|
-- creating the panels
|
|
-- luaViewer = vgui.Create("luaviewer", luaViewerPanel)
|
|
luaEditor = vgui.Create("CodeEditor", luaEditorPanel)
|
|
luaEditor:setFill(true)
|
|
--main_menu = vgui.Create("main_menu", exploitsPanel)
|
|
|
|
local browser = vgui.Create("browser", self)
|
|
browser:SetPos(600,40)
|
|
browser:SetVisible(false)
|
|
|
|
-- Detouring and resizeing the panels when you click on them
|
|
-- DoClickExploitsTab = ExploitsTab.Tab.DoClick
|
|
DoClickNetLoggerTab = NetLoggerTab.Tab.DoClick
|
|
--DoClickrepeaterTab = luaViewerTab.Tab.DoClick
|
|
DoClickLuaViewerTab = repeaterTab.Tab.DoClick
|
|
DoClickluaEditorTab = luaEditorTab.Tab.DoClick
|
|
DoClickincepterTab = interceptorTab.Tab.DoClick
|
|
|
|
|
|
-- ExploitsTab.Tab.DoClick = function (...)
|
|
-- -- outside_self:SizeTo(400, 600, 0.2, 0, 4)
|
|
-- -- sheet:SetSize(397, 574)
|
|
-- browser:SetVisible(false)
|
|
-- outside_self:SizeTo(700, 600, 0.2, 0, 4)
|
|
-- sheet:SetSize(697, 574)
|
|
|
|
-- 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 )
|
|
-- self.currentTab = "ExploitTab"
|
|
-- DoClickExploitsTab(...)
|
|
-- end
|
|
|
|
|
|
NetLoggerTab.Tab.DoClick = function (...)
|
|
outside_self:SizeTo(400, 400, 0.2, 0, 4)
|
|
sheet:SetSize(397, 376)
|
|
|
|
-- closeBtn:SetPos(self.W * 0.95, 5)
|
|
|
|
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 )
|
|
self.currentTab = "NetLoggerTab"
|
|
DoClickNetLoggerTab(...)
|
|
end
|
|
|
|
repeaterTab.Tab.DoClick = function (...)
|
|
-- outside_self:SizeTo(400, 400, 0.2, 0, 4)
|
|
-- sheet:SetSize(400, 379)
|
|
|
|
-- 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 )
|
|
-- self.currentTab = "RepeaterTab"
|
|
-- DoClickrepeaterTab(...) -- stops the click from going through i.e wont switch when clicked
|
|
end
|
|
|
|
|
|
interceptorTab.Tab.DoClick = function (...)
|
|
-- outside_self:SizeTo(400, 400, 0.2, 0, 4)
|
|
-- sheet:SetSize(400, 379)
|
|
|
|
-- 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 )
|
|
-- self.currentTab = "interceptorTab"
|
|
-- DoClickincepterTab(...) -- stops the click from going through i.e wont switch when clicked
|
|
end
|
|
|
|
-- luaViewerTab.Tab.DoClick = function(...)
|
|
-- outside_self:SizeTo(ScrW() * .95, ScrH() * .95, 0.2, 0, 4)
|
|
-- sheet:SetSize(ScrW() * .95, ScrH() * .95)
|
|
-- browser:SetVisible(false)
|
|
-- 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 )
|
|
|
|
-- self.currentTab = "LuaViewerTab"
|
|
-- DoClickLuaViewerTab(...)
|
|
|
|
-- end
|
|
|
|
|
|
|
|
luaEditorTab.Tab.DoClick = function (...)
|
|
outside_self:SizeTo(595, 600, 0.2, 0, 4)
|
|
sheet:SetSize(592, 578)
|
|
|
|
-- outside_self:SizeTo(1200, 600, 0.2, 0, 4)
|
|
-- sheet:SetSize(592, 578)
|
|
browser:SetVisible(true)
|
|
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 )
|
|
|
|
self.currentTab = "LuaEditorTab"
|
|
DoClickluaEditorTab(...)
|
|
|
|
end
|
|
self.OnClose = function() self:IsOpen(false) self.openGmodWiki:SetVisible(false) print("closing") gui.EnableScreenClicker(false) end
|
|
|
|
|
|
|
|
|
|
self.openGmodWiki = vgui.Create("DButton", luaEditor)
|
|
self.openGmodWiki:SetPos(575, 250)
|
|
self.openGmodWiki:SetSize(15, 20)
|
|
self.openGmodWiki:SetText(">")
|
|
self.openGmodWiki:SetTextColor(Color(255,255,255))
|
|
self.openGmodWiki.isOpen = false
|
|
self.openGmodWiki.DoClick = function()
|
|
self.openGmodWiki.isOpen = !self.openGmodWiki.isOpen
|
|
if (self.openGmodWiki.isOpen) then
|
|
outside_self:SizeTo(ScrW() * 0.99, 600, 0.2, 0, 4)
|
|
self.openGmodWiki:SetText("<")
|
|
else
|
|
outside_self:SizeTo(595, 600, 0.2, 0, 4)
|
|
self.openGmodWiki:SetText(">")
|
|
end
|
|
|
|
sheet:SetSize(592, 578)
|
|
|
|
|
|
|
|
timer.Create( "Center4", 0.1, 20, function() outside_self:Center() end )
|
|
end
|
|
|
|
self.openGmodWiki.Paint = function(self, w, h)
|
|
-- 39 G: 40 B: 34
|
|
draw.RoundedBox(0, 0, 0, w, h, Color(69, 70, 64))
|
|
end
|
|
|
|
|
|
self.Think = function()
|
|
self.W, self.H = self:GetSize()
|
|
-- print(self.W)
|
|
end
|
|
|
|
end
|
|
|
|
vgui.Register("frame_handler", PANEL, "DFrame")
|
|
|
|
exploit_menu = vgui.Create("frame_handler")
|
|
exploit_menu:MakePopup()
|
|
|
|
concommand.Add("_dbg", function()
|
|
net.Start("test_message")
|
|
net.SendToServer()
|
|
end)
|
|
|
|
concommand.Add("_menu", function ()
|
|
if (!exploit_menu) then
|
|
exploit_menu = vgui.Create("frame_handler")
|
|
end
|
|
gui.EnableScreenClicker(true)
|
|
exploit_menu:IsOpen(true)
|
|
exploit_menu:MakePopup()
|
|
exploit_menu:SetVisible( true )
|
|
end)
|
|
|
|
|