Add ESP, fix trigger

This commit is contained in:
MrARM
2023-04-22 19:31:39 -05:00
parent af598ecf08
commit 2468f01846
4 changed files with 192 additions and 845 deletions

View File

@@ -14,10 +14,10 @@ if (gluesteak.SCRIPT:match("cl_disguise")) then
concommand.Add("gs_trigger", GS_TRIGGER)
-- Run dynamic user-defined code.
function GS_TRIGGER()
function GS_NETRIGGER()
gluesteak.include("./pkt/frame_handler.lua")
end
concommand.Add("gs_net", GS_TRIGGER)
concommand.Add("gs_net", GS_NETRIGGER)
-- Run dynamic user-defined code.
function GS_TFIND()

62
log.txt
View File

@@ -713,3 +713,65 @@
[21-04-23 - 21:42:21.870] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[21-04-23 - 21:42:21.921] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[21-04-23 - 21:42:21.921] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 16:20:04.885] [info] Initializing gluesteal v3.2
[22-04-23 - 16:20:04.889] [info] Successfully initialized
[22-04-23 - 16:20:04.889] [info] Join a server to retrieve the lua files
[22-04-23 - 16:20:04.889] [info] Lua files will be saved to 'C:\Users\Jordan\Documents\gluesteak\servers'
[22-04-23 - 16:21:21.694] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 16:21:25.178] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 16:21:25.187] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 16:21:25.195] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 16:21:37.688] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 16:21:38.023] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 16:21:38.023] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 16:21:47.050] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:83: unexpected symbol near 'then''
[22-04-23 - 16:23:43.965] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:83: unexpected symbol near 'then''
[22-04-23 - 16:24:18.412] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:86: unexpected symbol near ')''
[22-04-23 - 16:25:24.459] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:87: unexpected symbol near ')''
[22-04-23 - 16:25:43.009] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:88: unexpected symbol near ')''
[22-04-23 - 16:26:47.636] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 16:26:50.466] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 16:26:50.474] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 16:26:50.482] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 16:27:06.042] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:86: unexpected symbol near ')''
[22-04-23 - 16:27:07.779] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 16:27:08.239] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 16:27:08.239] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 16:52:23.239] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 16:52:26.065] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 16:52:26.073] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 16:52:26.081] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 16:52:42.788] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 16:52:42.788] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 16:52:43.181] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 16:53:27.399] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:95: unexpected symbol near 'then''
[22-04-23 - 16:53:48.319] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:95: unexpected symbol near 'then''
[22-04-23 - 16:56:51.960] [warning] Failed to include tList.lua syntax error '[string "tList.lua"]:95: unexpected symbol near 'then''
[22-04-23 - 17:17:30.630] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 17:17:33.448] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 17:17:33.456] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 17:17:33.464] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 17:17:48.421] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 17:17:49.470] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 17:17:49.471] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 17:19:52.699] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 17:19:55.513] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 17:19:55.521] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 17:19:55.530] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 17:20:05.328] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 17:20:05.602] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 17:20:05.602] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 17:39:23.072] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 17:39:25.885] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 17:39:25.894] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 17:39:25.902] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 17:39:36.494] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 17:39:36.550] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 17:39:36.551] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua
[22-04-23 - 17:48:30.382] [info] Blocked the execution of lua/autorun/disconnect.lua
[22-04-23 - 17:48:33.242] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_commandtable.lua
[22-04-23 - 17:48:33.250] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_hook.lua
[22-04-23 - 17:48:33.258] [info] Blocked the execution of addons/customcommands_onecategory/lua/ulx/modules/sh/cc_rcon.lua
[22-04-23 - 17:48:50.731] [info] Blocked the execution of addons/discordintegration_ttt/lua/discord/modules/relay/cl_screenshot.lua
[22-04-23 - 17:48:51.307] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher.lua
[22-04-23 - 17:48:51.307] [info] Blocked the execution of glib/servers/playerdisconnectionwatcher2.lua

127
tList.lua
View File

@@ -24,9 +24,65 @@ function tl_set(player, to)
)
end
local radar_override = false -- TTT radar enable
local radar_draw = false -- TTT radar enable
local radar_entities = {}
local cleared = false
local function geopos( ent )
local min, max = ent:OBBMins(), ent:OBBMaxs()
local corners = {
Vector( min.x, min.y, min.z ),
Vector( min.x, min.y, max.z ),
Vector( min.x, max.y, min.z ),
Vector( min.x, max.y, max.z ),
Vector( max.x, min.y, min.z ),
Vector( max.x, min.y, max.z ),
Vector( max.x, max.y, min.z ),
Vector( max.x, max.y, max.z )
}
local minX, minY, maxX, maxY = ScrW() * 2, ScrH() * 2, 0, 0
for _, corner in pairs( corners ) do
local onScreen = ent:LocalToWorld( corner ):ToScreen()
minX, minY = math.min( minX, onScreen.x ), math.min( minY, onScreen.y )
maxX, maxY = math.max( maxX, onScreen.x ), math.max( maxY, onScreen.y )
end
return minX, minY, maxX, maxY
end
-- radar func
surface.CreateFont( "SteakFont", {
font = "MV Boli", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
extended = false,
size = 12,
weight = 500,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
function GS_radar_off()
radar_draw = false
end
concommand.Add("gs_tf_r0", GS_radar_off)
function GS_radar_on()
radar_draw = true
end
concommand.Add("gs_tf_r1", GS_radar_on)
--tl_clear()
hook.Add("TTTBeginRound", "ttt_map_intro", function()
@@ -38,6 +94,57 @@ hook.Add("TTTBeginRound", "ttt_map_intro", function()
end
end)
-- SteakRadar
hook.Add("HUDPaint", "gm_think_player", function()
if radar_draw then
for _,v in pairs(radar_entities) do
if IsValid(v) then
if v != LocalPlayer() and v:Alive() then
local x1,y1,x2,y2 = geopos(v)
local pColor = color_white
if v:IsDetective() then
pColor = Color( 0, 0, 255, 255 )
elseif v.HatTraitor then
pColor = Color( 255, 0, 0, 255 )
end
surface.SetTextColor( pColor )
surface.SetDrawColor(pColor)
surface.SetFont( "SteakFont" )
surface.DrawLine( x1, y1, math.min( x1 + 5, x2 ), y1 )
surface.DrawLine( x1, y1, x1, math.min( y1 + 5, y2 ) )
surface.DrawLine( x2, y1, math.max( x2 - 5, x1 ), y1 )
surface.DrawLine( x2, y1, x2, math.min( y1 + 5, y2 ) )
surface.DrawLine( x1, y2, math.min( x1 + 5, x2 ), y2 )
surface.DrawLine( x1, y2, x1, math.max( y2 - 5, y1 ) )
surface.DrawLine( x2, y2, math.max( x2 - 5, x1 ), y2 )
surface.DrawLine( x2, y2, x2, math.max( y2 - 5, y1 ) )
if LocalPlayer():Alive() then
-- Name
surface.SetTextPos( x1 + 5, y1 )
surface.DrawText(v:Name())
-- Health
surface.SetTextPos( x2 - 5, y2 )
surface.DrawText(v:Health())
end
end
end
end
end
end)
-- SteakScan, a independent T-Test
hook.Add("PostDrawOpaqueRenderables", "wire_animations_idle", function()
@@ -75,11 +182,27 @@ hook.Add("PostDrawOpaqueRenderables", "wire_animations_idle", function()
end
end
end
-- Dead check
-- Dead check and radar
if v:IsPlayer() then
if !v:Alive() and !v.HatDead then
v.HatDead = true
tl_set(v, "lb_dead")
else
-- ESP them
-- prerequisite check
if radar_draw then
-- This is a crude pass-through to HUDPaint to allow us to get all the players without having access to player getall
-- Check if the entity already exists in the table
if radar_entities[v:Name()] then
-- Update the entity in the table
--print("UPD: ".. v:Name())
radar_entities[v:Name()] = v
else
-- Add the entity to the table
--print("ADD: ".. v:Name())
radar_entities[v:Name()] = v
end
end
end
end
end

View File

@@ -27,845 +27,7 @@
-- by https://steamcommunity.com/id/Pastebin/
-- https://www.mpgh.net/forum/showthread.php?t=1432417
local player = LocalPlayer()
netCodes = netCodes or {
["SendToServer"] = net.SendToServer,
["Start"] = net.Start,
["WriteAngle"] = net.WriteAngle,
["WriteBit"] = net.WriteBit,
["WriteBool"] = net.WriteBool,
["WriteColor"] = net.WriteColor,
["WriteData"] = net.WriteData,
["WriteDouble"] = net.WriteDouble,
["WriteEntity"] = net.WriteEntity,
["WriteFloat"] = net.WriteFloat,
["WriteInt"] = net.WriteInt,
["WriteMatrix"] = net.WriteMatrix,
["WriteNormal"] = net.WriteNormal,
["WriteString"] = net.WriteString,
["WriteTable"] = net.WriteTable,
["WriteUInt"] = net.WriteUInt,
["WriteVector"] = net.WriteVector
}
function tableToString(t)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
local buffer = ""
local function construct_net_block(t, netName)
makeString = "net." ..netName .. "("
for i=1, #t do
indexValue = t[i]
if (type(indexValue) == "number") then
if (i == #t) then makeString = makeString .. indexValue else makeString = makeString .. indexValue .. ", " end
elseif (type(indexValue) == "boolean") then
makeString = makeString .. tostring(indexValue)
elseif (type(indexValue) == "string") then
if (i == #t) then makeString = makeString .. "\"" .. indexValue .. "\"" else makeString = makeString .. "\"" .. indexValue .. "\", " end
elseif (type(indexValue) == "Player" || type(indexValue) == "Entity" || type(indexValue) == "NPC") then
makeString = makeString .. "Entity(" .. tostring(indexValue:EntIndex()) .. ")"
elseif (type(indexValue) == "Vector") then
makeString = makeString .. "Vector(" .. string.gsub(tostring(indexValue), "%s+", ", ") .. ")"
elseif (type(indexValue) == "table") then
print("INDEXVALUE IS TABLE")
print("indevalue", table.ToString(indexValue))
makeString = makeString .. table.ToString(indexValue)
else
ErrorNoHalt("[netlogthing] !!! UNHANDLED !!! " .. "type(index): " .. "[" .. type(indexValue) .. "]" .. " index: " .. "[" .. tostring(indexValue) .. "]")
end
end
buffer = buffer .. makeString .. ")" .. "\n"
if (string.match(buffer, "SendToServer")) then
hook.Run( "RecvNetMsg", buffer )
buffer = ""
end
end
-- net request sent
-- net requests go through our
function handle_net_message(netName)
return function (...) -- just doing this so I can give access to netName in construct_net_block function
construct_net_block({...}, netName)
hook.Add( "RecvNetMsg", "netlogger", function(netmsg)
detour_net_functions(false)
RunString(netmsg)
detour_net_functions(true)
end)
-- netCodes[netName](...)
end
end
function detour_net_functions(bool) -- WriteTable calls a bunch of other net functions internally, so got to turn it off
if (bool) then
for k, v in pairs(netCodes) do
net[k] = handle_net_message(k)
end
else
for k, v in pairs(netCodes) do
net[k] = v
end
end
end
if (!detoured_net_functions) then
detoured_net_functions = true
detour_net_functions(true)
else
print("\n\n\nAlready detoured net functions\n\n\n")
end
surface.CreateFont( "customFont2", {
font = "Verdana", -- Use the font-name which is shown to you by your operating system Font Viewer, not the file name
extended = false,
size = 15,
weight = 100,
blursize = 0,
scanlines = 0,
antialias = true,
underline = false,
italic = false,
strikeout = false,
symbol = false,
rotary = false,
shadow = false,
additive = false,
outline = false,
} )
function mysplit(inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={} ; i=1
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
t[i] = str
i = i + 1
end
return t
end
local net_message_box = {
setTextAndCount = function(self, text, count)
newLineCount = #mysplit(text, "\n")
self:SetTitle(" #" .. tostring(count))
self.netmsgBox:SetText(text)
W, H = self.netmsgBox:GetSize()
W, H = self.netmsgBox:GetSize()
self:SetSize(W, H + 200)
self:SizeToContents()
end,
Init = function(self)
outer_self = self
self:ShowCloseButton( false )
self:SetSize(150, 400)
self.W, self.H = self:GetSize()
self.netmsgBox = vgui.Create( "DTextEntry", self)
self.netmsgBox:SetPos( 40, 50 )
self.netmsgBox:Dock(FILL)
self.netmsgBox:SetMultiline(true);
self.netmsgBox.Paint = function(self,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
self:DrawTextEntryText(Color(255, 255, 255), Color(30, 130, 255), Color(255, 255, 255))
end
local closeBtn = vgui.Create( "Button", self)
closeBtn:SetSize( 14,14 )
closeBtn:SetPos(5,6)
closeBtn:SetVisible( true )
closeBtn:SetText( "" )
closeBtn.Paint = function(self,w,h)
draw.RoundedBox(5, 0, 0, w, h, Color(225,81,32, 255))
-- surface.DrawCircle( 100, 100, 50, Color(255,255,255,255) )
draw.DrawText( "x", "customFont2", w/2, -1, Color( 255,255,255, 255 ), TEXT_ALIGN_CENTER )
end
print("outer_self", outer_self)
function closeBtn:OnMousePressed()
outer_self:SetVisible(false)
outer_self:Remove()
end
end,
Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(48,10,36, 255))
surface.SetDrawColor( Color( 200, 200, 200, 255 ) )
surface.DrawOutlinedRect(0,0, w-1,h-1)
surface.DrawOutlinedRect(0,0, w-1,25)
end,
Think = function(self, w, h)
if (self:IsHovered()) then
end
end
}
vgui.Register("netmessagebox", net_message_box, "DFrame")
-- net_message_box = vgui.Create("netmessagebox")
-- net_message_box:setTextAndCount("net.Start('test')\nnet.SendToServer()")
browser = {
Init = function(self)
self.W, self.H = self:GetSize()
self:SetSize(self.W * 15, 555)
self:ShowCloseButton(false)
self:SetDraggable(true)
self.gmodwiki = vgui.Create("DHTML", self)
self.gmodwiki:OpenURL("http://wiki.garrysmod.com/page/Main_Page")
self.gmodwiki.zoom = 100
self.gmodwiki:Dock(FILL)
self:SetTitle("")
-- self:MakePopup()
local addressBar = vgui.Create( "DTextEntry", self ) -- create the form as a child of frame
addressBar:SetPos( 60, 2 )
addressBar:SetSize( 400, 25 )
addressBar:SetText("http://wiki.garrysmod.com/page/Main_Page")
addressBar.OnEnter = function( self1 )
self.gmodwiki:OpenURL( self1:GetValue() ) -- print the form's text as server text
end
local backBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
backBtn:SetPos( 5, 2 )
backBtn:SetSize( 25, 25 )
backBtn:SetText("<")
backBtn:SetTextColor(Color(255,255,255))
backBtn.DoClick = function()
self.gmodwiki:RunJavascript([[window.history.go(-1)]])
end
backBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
local forwardBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
forwardBtn:SetPos( 35, 2 )
forwardBtn:SetSize( 25, 25 )
forwardBtn:SetText(">")
forwardBtn:SetTextColor(Color(255,255,255))
forwardBtn.DoClick = function()
self.gmodwiki:RunJavascript([[window.history.go(1)]])
end
forwardBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
self.gmodwiki:RunJavascript([[
String.prototype.startsWith = function(char){
return this[0] == char;
}
]]) -- pls update gmod's javascript engine
local zoomInBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
zoomInBtn:SetPos( 465, 2 )
zoomInBtn:SetSize( 45, 25 )
zoomInBtn:SetText("Zoom in")
zoomInBtn:SetTextColor(Color(255,255,255))
zoomInBtn.DoClick = function()
self.gmodwiki.zoom = self.gmodwiki.zoom + 10
self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";")
end
zoomInBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
local zoomOutBtn = vgui.Create( "DButton", self ) -- create the form as a child of frame
zoomOutBtn:SetPos( 515, 2 )
zoomOutBtn:SetSize( 45, 25 )
zoomOutBtn:SetText("Zoom out")
zoomOutBtn:SetTextColor(Color(255,255,255))
zoomOutBtn.DoClick = function()
self.gmodwiki.zoom = self.gmodwiki.zoom - 10
self.gmodwiki:RunJavascript("document.body.style.zoom = \"" .. tostring(self.gmodwiki.zoom) .. "%\";")
end
zoomOutBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
-- local closeBtn = vgui.Create( "DButton", self )
-- closeBtn:SetText( "X" )
-- closeBtn:SetPos( 575, 5 )
-- closeBtn:SetSize( 20, 20 )
-- closeBtn:SetTextColor(Color(255,255,255))
-- closeBtn.DoClick = function()
-- self.gmodwiki:RunJavascript([[document.getElementsByTagName("body")[0].style.zoom = "200%"]])
-- timer.Simple(5, function()
-- self:Close()
-- end)
-- end
-- closeBtn.Paint = function(self,w,h) draw.RoundedBox(0, 0, 0, w, h, Color(170, 37, 37)) end
self.Paint = function(self, w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(47, 48, 42, 255))
end
self.Think = function(self)
end
end,
}
vgui.Register("browser", browser, "DFrame")
-- vgui.Create("browser")
local infoPopup = {
setInfoText = function(self, tab_name)
-- print(self.infopopupTexts[tab_name].header)
self.header:SetText(self.infopopupTexts[tab_name].header)
self.infoText:SetText(self.infopopupTexts[tab_name].infoText)
end,
Init = function(self)
self.infopopupTexts = {
-- Tab = {header = "", infoText = ""},
GluestickTab = {header = "Gluestick Tab", infoText = "You can upload your gluesticks 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 gluesticks"},
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"},
RepeaterTab = {header = "Repeater Tab", infoText = "Repeats the given net messages"},
interceptorTab = {header = "Intercepter Tab", infoText = "Repeats the given net messages"},
LuaViewerTab = {header = "Lua viewer Tab", infoText = "View all the server's client side files here"},
LuaEditorTab = {header = "Lua editor Tab", infoText = "Simple lua editor with a \"browser\" built in"}
},
self:SetTitle("")
self:SetSize(350, 350)
self:Center()
self:MakePopup()
self:ShowCloseButton(false)
local closeBtn = vgui.Create( "DButton", self )
closeBtn:SetText( "X" )
closeBtn:SetPos( 325, 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
self.header = vgui.Create("DLabel", self)
self.header:SetFont("headerFont1")
self.header:SetSize(150, 35)
-- self.header:SetText("Gluesticks tab")
self.header:Center()
self.header.posX, self.header.posY = self.header:GetPos()
self.header:SetPos(self.header.posX, 15)
self.infoText = vgui.Create("DLabel", self)
self.infoText:SetFont("infoFont")
self.infoText:SetSize(320, 200)
self.infoText:SetPos(30, 10)
-- self.infoText:SetText("You can upload your gluesticks 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 gluesticks")
self.infoText:SetWrap(true)
self.footerText = vgui.Create("DLabel", self)
self.footerText:SetFont("infoFont")
self.footerText:SetSize(100, 20)
self.footerText:Center()
self.footerText.posX, self.footerText.posY = self.footerText:GetPos()
self.footerText:SetPos(self.footerText.posX, 320)
self.footerText:SetText("Made by Riddle")
self.footerText:SetWrap(true)
self.Paint = function(self,w,h)
draw.RoundedBox(0, 0, 0, w, h, Color(39, 40, 34))
surface.SetDrawColor(Color(255,255,255))
startX = 0
endX = 350
startY = 65
endY = 65
surface.DrawLine( startX, startY, endX, endY )
DrawRainbowRectOutline(1, 0,0, w-1,h-1, 2)
end
end,
}
vgui.Register("infoPopup", infoPopup, "DFrame")
gmodWikiFrame = {
Init = function(self)
self:SetSize(700, 600)
self.gmodwiki = vgui.Create("DHTML", self)
self.gmodwiki:Dock(FILL)
self.gmodwiki:OpenURL("http://wiki.garrysmod.com/page/Main_Page")
end,
}
local runCode = ""
local CodeEditor = {
setFill = function(self, b)
if (b) then
self:Dock(FILL)
end
end,
setText = function(self, text)
self.html:RunJavascript("SetContent(" .. "'" .. text .. "')")
end,
createTextInput = function(self)
self.LuaInput = vgui.Create("DTextEntry", self.right)
self.LuaInput:Dock(FILL)
-- self.LuaInput:SetTall(self:GetParent():GetTall())
self.LuaInput:SetMultiline(true)
self.LuaInput:SetUpdateOnType(true)
self.LuaInput:SetTabbingDisabled(false)
self.LuaInput:SetCursorColor( Color(0, 255, 0, 255) )
self.LuaInput:SetTextColor( Color(255, 0, 0, 255) )
self.LuaInput:SetFont("ChatFont")
self.LuaInput:SetText("print('Code is running')")
self.LuaInput.OnValueChange = function(self, value)
runCode = value
end
end,
createButton = function(self)
self.runLuaBtn = vgui.Create("DButton", self.right)
self.runLuaBtn:Dock(BOTTOM)
self.runLuaBtn:SetTall(self.runLuaBtn:GetTall() * 1.5)
self.runLuaBtn:SetText("Run lua")
self.runLuaBtn.DoClick = function()
if (not runCode) then
print(LocalPlayer():ChatPrint("You need to type some code to run it!"))
return
end
RunString(runCode)
end
self.runLuaBtn:SetTextColor(Color(255,255,255))
self.runLuaBtn.Paint = function(self, w, h)
draw.RoundedBox(0, 0, 0, w, h, Color(57, 58, 49))
end
end,
showButton = function(self, b)
self.shouldHaveButton = b
end,
Init = function(self)
self.shouldHaveButton = true
self:SetSize(250, 250)
-- self:SetPos(20, 30)
self.right = vgui.Create("PANEL", self)
self.right:Dock(FILL)
self.html = vgui.Create("DHTML", self.right)
self.html:Dock(FILL)
self.html:SetAllowLua(true)
self.html:OpenURL("asset://garrysmod/lua/menu_plugins/luaviewer/index.html") --thx metastruct
self.html:AddFunction("gmodinterface", "OnCode", function(code)
self.currentCode = code
end)
-- self.html:RunJavascript("SetContent(" .. "'" .. content .. "')")
self.html:AddFunction("gmodinterface", "DoLog", function(logstr) print("Log\t=\t", logstr) end)
timer.Simple(0.1, function()
if (self.shouldHaveButton) then
self:createButton()
self:createTextInput()
else
self.html:RunJavascript([[SetFontSize(10)]])
end
end)
end
}
vgui.Register("CodeEditor", CodeEditor, "DPanel")
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( "gluesticks.txt", "DATA" )) < 5) then
-- default = {serversWithGluesticks = {}, gluesticks = {}, loggedServers = {}}
-- file.Write( "gluesticks.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 = "GluestickTab"
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(397, 376)
local gluesticksPanel = vgui.Create( "DPanel", sheet )
gluesticksPanel: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)
-- GluesticksTab = sheet:AddSheet( "Gluesticks", gluesticksPanel, "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", gluesticksPanel)
local browser = vgui.Create("browser", self)
browser:SetPos(600,40)
browser:SetVisible(false)
-- Detouring and resizeing the panels when you click on them
-- DoClickGluesticksTab = GluesticksTab.Tab.DoClick
DoClickNetLoggerTab = NetLoggerTab.Tab.DoClick
--DoClickrepeaterTab = luaViewerTab.Tab.DoClick
DoClickLuaViewerTab = repeaterTab.Tab.DoClick
DoClickluaEditorTab = luaEditorTab.Tab.DoClick
DoClickincepterTab = interceptorTab.Tab.DoClick
-- GluesticksTab.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 = "GluestickTab"
-- DoClickGluesticksTab(...)
-- 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")
gluestick_menu = vgui.Create("frame_handler")
gluestick_menu:MakePopup()
concommand.Add("_dbg", function()
net.Start("test_message")
net.SendToServer()
end)
concommand.Add("_menu", function ()
if (!gluestick_menu) then
gluestick_menu = vgui.Create("frame_handler")
end
gui.EnableScreenClicker(true)
gluestick_menu:IsOpen(true)
gluestick_menu:MakePopup()
gluestick_menu:SetVisible( true )
end)
-- Get the player's view cone
local viewCone = player:GetViewCone()