From 6f48e7f58479fd3cd3c7470067e68ec31e69a001 Mon Sep 17 00:00:00 2001 From: Lewin Kelly Date: Wed, 20 Mar 2024 01:43:01 +0000 Subject: [PATCH] Add esc+r/l hotkeys in settings menu, remove unused corescripts, other corescript formatting improvements --- defs.d.lua | 2 - luau/157877000.luau | 1035 ------------------------------------------- luau/38037565.luau | 272 ------------ luau/46295863.luau | 169 +++---- luau/48488398.luau | 48 +- luau/97188756.luau | 328 ++++---------- luau/studio.luau | 1 + luau/visit.luau | 19 +- 8 files changed, 195 insertions(+), 1679 deletions(-) delete mode 100644 luau/157877000.luau delete mode 100644 luau/38037565.luau diff --git a/defs.d.lua b/defs.d.lua index 9599ea5..c0db1c2 100644 --- a/defs.d.lua +++ b/defs.d.lua @@ -7309,7 +7309,6 @@ declare class ServiceProvider extends Instance LoadingGuiService: any ScriptInformationProvider: ScriptInformationProvider JointsService: JointsService - LogService: any ThumbnailGenerator: ThumbnailGenerator function FindService(self, className: string): Instance @@ -7487,7 +7486,6 @@ declare class ServiceProvider extends Instance function GetService(self, service: "LoadingGuiService"): any function GetService(self, service: "PersonalServerService"): PersonalServerService function GetService(self, service: "Terrain"): Terrain - function GetService(self, service: "LogService"): any function GetService(self, service: "ThumbnailGenerator"): ThumbnailGenerator end diff --git a/luau/157877000.luau b/luau/157877000.luau deleted file mode 100644 index 21d6195..0000000 --- a/luau/157877000.luau +++ /dev/null @@ -1,1035 +0,0 @@ --- Unused by Mercury -print "[Mercury]: Loaded corescript 157877000" -for _ = 1, 8 do - print "IF YOU SEE THIS MESSAGE, PLEASE REPORT IT TO THE MERCURY DEVELOPERS" -end - ---Include -local New = (require "../Modules/New").New - --- A Few Script Globals -local gui -if script.Parent and script.Parent:FindFirstChild "ControlFrame" then - gui = script.Parent:FindFirstChild "ControlFrame" -else - gui = script.Parent -end - --- Dev-Console Root - -local Dev_Container = New "Frame" { - Name = "DevConsoleContainer", - Parent = gui, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.9, - Position = UDim2.new(0, 100, 0, 10), - Size = UDim2.new(0.5, 20, 0.5, 20), - Visible = false, -} - -local ToggleConsole = New "BindableFunction" { - Name = "ToggleDevConsole", - Parent = gui, -} - -local devConsoleInitialized = false -function initializeDeveloperConsole() - if devConsoleInitialized then - return - end - devConsoleInitialized = true - - -- Dev-Console Variables - local LOCAL_CONSOLE = 1 - local SERVER_CONSOLE = 2 - - local MAX_LIST_SIZE = 1000 - - local minimumSize = Vector2.new(245, 180) - local currentConsole = LOCAL_CONSOLE - - local localMessageList = {} - local serverMessageList = {} - - local localOffset = 0 - local serverOffset = 0 - - local errorToggleOn = true - local warningToggleOn = true - local infoToggleOn = true - local outputToggleOn = true - local wordWrapToggleOn = false - - local textHolderSize = 0 - - local frameNumber = 0 - - -- Create Dev-Console - - local Dev_Body = New "Frame" { - Name = "Body", - Parent = Dev_Container, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 0, 21), - Size = UDim2.new(1, 0, 1, -25), - New "TextButton" { - Name = "LocalConsole", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.6, - Position = UDim2.new(0, 7, 0, 5), - Size = UDim2.new(0, 90, 0, 20), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "Local Console", - TextColor3 = Color3.new(1, 1, 1), - TextYAlignment = Enum.TextYAlignment.Center, - }, - New "TextButton" { - Name = "ServerConsole", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.8, - Position = UDim2.new(0, 102, 0, 5), - Size = UDim2.new(0, 90, 0, 17), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "Server Console", - TextColor3 = Color3.new(1, 1, 1), - TextYAlignment = Enum.TextYAlignment.Center, - }, - New "ImageButton" { - Name = "ResizeButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(1, -20, 1, -20), - Size = UDim2.new(0, 20, 0, 20), - New "ImageLabel" { - Name = "ImageLabel", - BackgroundTransparency = 1, - Position = UDim2.new(0, 6, 0, 6), - Size = UDim2.new(0.8, 0, 0.8, 0), - Rotation = 135, - Image = "http://banland.xyz/Asset?id=151205813", - }, - }, - } - - local Dev_OptionsHolder = New "Frame" { - Name = "OptionsHolder", - Parent = Dev_Body, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - Position = UDim2.new(0, 220, 0, 0), - Size = UDim2.new(1, -255, 0, 24), - ClipsDescendants = true, - } - - local Dev_OptionsBar = New "Frame" { - Name = "OptionsBar", - Parent = Dev_OptionsHolder, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - Position = UDim2.new(0, -250, 0, 4), - Size = UDim2.new(0, 234, 0, 18), - New "TextButton" { - Name = "ErrorToggleButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 0, 0), - Position = UDim2.new(0, 115, 0, 0), - Size = UDim2.new(0, 18, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "", - TextColor3 = Color3.new(1, 0, 0), - New "Frame" { - Name = "CheckFrame", - BackgroundColor3 = Color3.new(1, 0, 0), - BorderColor3 = Color3.new(1, 0, 0), - Position = UDim2.new(0, 4, 0, 4), - Size = UDim2.new(0, 10, 0, 10), - }, - }, - New "TextButton" { - Name = "InfoToggleButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(0.4, 0.5, 1.0), - Position = UDim2.new(0, 65, 0, 0), - Size = UDim2.new(0, 18, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "", - TextColor3 = Color3.new(0.4, 0.5, 1.0), - New "Frame" { - Name = "CheckFrame", - BackgroundColor3 = Color3.new(0.4, 0.5, 1.0), - BorderColor3 = Color3.new(0.4, 0.5, 1.0), - Position = UDim2.new(0, 4, 0, 4), - Size = UDim2.new(0, 10, 0, 10), - }, - }, - New "TextButton" { - Name = "OutputToggleButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 1, 1.0), - Position = UDim2.new(0, 40, 0, 0), - Size = UDim2.new(0, 18, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "", - TextColor3 = Color3.new(1, 1, 1.0), - New "Frame" { - Name = "CheckFrame", - BackgroundColor3 = Color3.new(1, 1, 1.0), - BorderColor3 = Color3.new(1, 1, 1.0), - Position = UDim2.new(0, 4, 0, 4), - Size = UDim2.new(0, 10, 0, 10), - }, - }, - New "TextButton" { - Name = "WarningToggleButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(1, 0.6, 0.4), - Position = UDim2.new(0, 90, 0, 0), - Size = UDim2.new(0, 18, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "", - TextColor3 = Color3.new(1, 0.6, 0.4), - New "Frame" { - Name = "CheckFrame", - BackgroundColor3 = Color3.new(1, 0.6, 0.4), - BorderColor3 = Color3.new(1, 0.6, 0.4), - Position = UDim2.new(0, 4, 0, 4), - Size = UDim2.new(0, 10, 0, 10), - }, - }, - New "TextButton" { - Name = "WordWrapToggleButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BorderColor3 = Color3.new(0.8, 0.8, 0.8), - Position = UDim2.new(0, 215, 0, 0), - Size = UDim2.new(0, 18, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "", - TextColor3 = Color3.new(0.8, 0.8, 0.8), - New "Frame" { - Name = "CheckFrame", - BackgroundColor3 = Color3.new(0.8, 0.8, 0.8), - BorderColor3 = Color3.new(0.8, 0.8, 0.8), - Position = UDim2.new(0, 4, 0, 4), - Size = UDim2.new(0, 10, 0, 10), - Visible = false, - }, - }, - New "TextLabel" { - Name = "Filter", - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 40, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "Filter", - TextColor3 = Color3.new(1, 1, 1), - }, - New "TextLabel" { - Name = "WordWrap", - BackgroundTransparency = 1, - Position = UDim2.new(0, 150, 0, 0), - Size = UDim2.new(0, 50, 0, 18), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size14, - Text = "Word Wrap", - TextColor3 = Color3.new(1, 1, 1), - }, - } - - local Dev_ScrollBar = New "Frame" { - Name = "ScrollBar", - Parent = Dev_Body, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.9, - Position = UDim2.new(1, -20, 0, 26), - Size = UDim2.new(0, 20, 1, -50), - Visible = false, - New "ImageButton" { - Name = "Down", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 1, -20), - Size = UDim2.new(0, 20, 0, 20), - New "ImageLabel" { - Name = "ImageLabel", - BackgroundTransparency = 1, - Position = UDim2.new(0, 3, 0, 3), - Size = UDim2.new(0, 14, 0, 14), - Rotation = 180, - Image = "http://banland.xyz/Asset?id=151205813", - }, - }, - New "ImageButton" { - Name = "Up", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 20, 0, 20), - New "ImageLabel" { - Name = "ImageLabel", - BackgroundTransparency = 1, - Position = UDim2.new(0, 3, 0, 3), - Size = UDim2.new(0, 14, 0, 14), - Image = "http://banland.xyz/Asset?id=151205813", - }, - }, - } - - local Dev_ScrollArea = New "Frame" { - Name = "ScrollArea", - Parent = Dev_ScrollBar, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 23), - Size = UDim2.new(1, 0, 1, -46), - New "ImageButton" { - Name = "Handle", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 0.2, 0), - Size = UDim2.new(0, 20, 0, 40), - New "ImageLabel" { - Name = "ImageLabel", - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0.5, -8), - Rotation = 180, - Size = UDim2.new(1, 0, 0, 16), - Image = "http://banland.xyz/Asset?id=151205881", - }, - }, - } - - local Dev_TextBox = New "Frame" { - Name = "TextBox", - Parent = Dev_Body, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.6, - Position = UDim2.new(0, 2, 0, 26), - Size = UDim2.new(1, -4, 1, -28), - ClipsDescendants = true, - } - - local Dev_TextHolder = New "Frame" { - Name = "TextHolder", - Parent = Dev_TextBox, - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - } - - local Dev_OptionsButton = New "ImageButton" { - Name = "OptionsButton", - Parent = Dev_Body, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - Position = UDim2.new(0, 200, 0, 2), - Size = UDim2.new(0, 20, 0, 20), - New "ImageLabel" { - Name = "ImageLabel", - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 1, 0), - Rotation = 0, - Image = "http://banland.xyz/Asset?id=152093917", - }, - } - - local Dev_TitleBar = New "Frame" { - Name = "TitleBar", - Parent = Dev_Container, - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, 0, 0, 20), - New "ImageButton" { - Name = "CloseButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(1, -20, 0, 0), - Size = UDim2.new(0, 20, 0, 20), - New "ImageLabel" { - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 1, - Position = UDim2.new(0, 3, 0, 3), - Size = UDim2.new(0, 14, 0, 14), - Image = "http://banland.xyz/Asset?id=151205852", - }, - }, - New "TextButton" { - Name = "TextButton", - BackgroundColor3 = Color3.new(0, 0, 0), - BackgroundTransparency = 0.5, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(1, -23, 1, 0), - Text = "", - }, - New "TextLabel" { - Name = "TitleText", - BackgroundTransparency = 1, - Position = UDim2.new(0, 0, 0, 0), - Size = UDim2.new(0, 185, 0, 20), - Font = "SourceSansBold", - FontSize = Enum.FontSize.Size18, - -- Text = "Server Console", - TextColor3 = Color3.new(1, 1, 1), - Text = "Roblox Developer Console", - TextYAlignment = Enum.TextYAlignment.Top, - }, - } - - ---Saved Mouse Information - local previousMousePos - local pPos - - local previousMousePosResize - local pSize - - local previousMousePosScroll - - -- local pScrollHandle - - local pOffset - - local scrollUpIsDown = false - local scrollDownIsDown = false - - local function clean() - previousMousePos = nil - pPos = nil - previousMousePosResize = nil - pSize = nil - previousMousePosScroll = nil - -- pScrollHandle = nil - pOffset = nil - scrollUpIsDown = false - scrollDownIsDown = false - end - - ---Handle Dev-Console Position - local function refreshConsolePosition(x, y) - if not previousMousePos then - return - end - - local delta = Vector2.new(x, y) - previousMousePos - Dev_Container.Position = - UDim2.new(0, pPos.X + delta.X, 0, pPos.Y + delta.Y) - end - - Dev_TitleBar.TextButton.MouseButton1Down:connect(function(x, y) - previousMousePos = Vector2.new(x, y) - pPos = Dev_Container.AbsolutePosition - end) - - Dev_TitleBar.TextButton.MouseButton1Up:connect(function(_, _) - clean() - end) - - ---Handle Dev-Console Size - local function refreshConsoleSize(x, y) - if not previousMousePosResize then - return - end - - local delta = Vector2.new(x, y) - previousMousePosResize - Dev_Container.Size = UDim2.new( - 0, - math.max(pSize.X + delta.X, minimumSize.X), - 0, - math.max(pSize.Y + delta.Y, minimumSize.Y) - ) - end - Dev_Container.Body.ResizeButton.MouseButton1Down:connect(function(x, y) - previousMousePosResize = Vector2.new(x, y) - pSize = Dev_Container.AbsoluteSize - end) - - Dev_Container.Body.ResizeButton.MouseButton1Up:connect(function(_, _) - clean() - end) - - ---Handle Dev-Console Close Button - Dev_TitleBar.CloseButton.MouseButton1Down:connect(function(_, _) - Dev_Container.Visible = false - end) - - Dev_Container.TitleBar.CloseButton.MouseButton1Up:connect(function() - clean() - end) - - local optionsHidden = true - local animating = false - --Options - local function startAnimation() - if animating then - return - end - animating = true - - repeat - if optionsHidden then - frameNumber -= 1 - else - frameNumber += 1 - end - - local x = frameNumber / 5 - local smoothStep = x * x * (3 - (2 * x)) - Dev_OptionsButton.ImageLabel.Rotation = smoothStep * 5 * 9 - Dev_OptionsBar.Position = - UDim2.new(0, (smoothStep * 5 * 50) - 250, 0, 4) - - wait() - if - (frameNumber <= 0 and optionsHidden) - or (frameNumber >= 5 and not optionsHidden) - then - animating = false - end - until not animating - end - - Dev_OptionsButton.MouseButton1Down:connect(function(_, _) - optionsHidden = not optionsHidden - startAnimation() - end) - - --Refresh Dev-Console Message Positions - local function repositionList() - if currentConsole == LOCAL_CONSOLE then - localOffset = math.min( - math.max(localOffset, 0), - textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y - ) - Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) - elseif currentConsole == SERVER_CONSOLE then - serverOffset = math.min( - math.max(serverOffset, 0), - textHolderSize - Dev_Container.Body.TextBox.AbsoluteSize.Y - ) - Dev_TextHolder.Size = UDim2.new(1, 0, 0, textHolderSize) - end - - local ratio = Dev_Container.Body.TextBox.AbsoluteSize.Y - / Dev_TextHolder.AbsoluteSize.Y - - if ratio >= 1 then - Dev_Container.Body.ScrollBar.Visible = false - Dev_Container.Body.TextBox.Size = UDim2.new(1, -4, 1, -28) - - if - currentConsole == LOCAL_CONSOLE - or currentConsole == SERVER_CONSOLE - then - Dev_TextHolder.Position = UDim2.new(0, 0, 1, 0 - textHolderSize) - end - else - Dev_Container.Body.ScrollBar.Visible = true - Dev_Container.Body.TextBox.Size = UDim2.new(1, -25, 1, -28) - - local backRatio = 1 - ratio - local offsetRatio - - if currentConsole == LOCAL_CONSOLE then - offsetRatio = localOffset / Dev_TextHolder.AbsoluteSize.Y - elseif currentConsole == SERVER_CONSOLE then - offsetRatio = serverOffset / Dev_TextHolder.AbsoluteSize.Y - end - - local topRatio = math.max(0, backRatio - offsetRatio) - - local scrollHandleSize = - math.max(Dev_ScrollArea.AbsoluteSize.Y * ratio, 21) - - local scrollRatio = scrollHandleSize / Dev_ScrollArea.AbsoluteSize.Y - local ratioConversion = (1 - scrollRatio) / (1 - ratio) - - local topScrollRatio = topRatio * ratioConversion - - local sPos = math.min( - Dev_ScrollArea.AbsoluteSize.Y * topScrollRatio, - Dev_ScrollArea.AbsoluteSize.Y - scrollHandleSize - ) - - Dev_ScrollArea.Handle.Size = UDim2.new(1, 0, 0, scrollHandleSize) - Dev_ScrollArea.Handle.Position = UDim2.new(0, 0, 0, sPos) - - if currentConsole == LOCAL_CONSOLE then - Dev_TextHolder.Position = - UDim2.new(0, 0, 1, 0 - textHolderSize + localOffset) - elseif currentConsole == SERVER_CONSOLE then - Dev_TextHolder.Position = - UDim2.new(0, 0, 1, 0 - textHolderSize + serverOffset) - end - end - end - - --Scroll Position - - local function changeOffset(value) - if currentConsole == LOCAL_CONSOLE then - localOffset += value - elseif currentConsole == SERVER_CONSOLE then - serverOffset += value - end - - repositionList() - end - - --Refresh Dev-Console Text - local function refreshTextHolderForReal() - local childMessages = Dev_TextHolder:GetChildren() - - local messageList - - if currentConsole == LOCAL_CONSOLE then - messageList = localMessageList - elseif currentConsole == SERVER_CONSOLE then - messageList = serverMessageList - end - - local posOffset = 0 - - for i = 1, #childMessages do - childMessages[i].Visible = false - end - - for i = 1, #messageList do - local message - - local movePosition = false - - if i > #childMessages then - message = New "TextLabel" { - Name = "Message", - Parent = Dev_TextHolder, - BackgroundTransparency = 1, - TextXAlignment = "Left", - Size = UDim2.new(1, 0, 0, 14), - FontSize = "Size10", - ZIndex = 1, - } - movePosition = true - else - message = childMessages[i] - end - - if - ( - outputToggleOn - or messageList[i].Type ~= Enum.MessageType.MessageOutput - ) - and (infoToggleOn or messageList[i].Type ~= Enum.MessageType.MessageInfo) - and (warningToggleOn or messageList[i].Type ~= Enum.MessageType.MessageWarning) - and ( - errorToggleOn - or messageList[i].Type ~= Enum.MessageType.MessageError - ) - then - message.TextWrapped = wordWrapToggleOn - message.Size = UDim2.new(0.98, 0, 0, 2000) - message.Parent = Dev_Container - message.Text = - `{messageList[i].Time} -- {messageList[i].Message}` - - message.Size = UDim2.new(0.98, 0, 0, message.TextBounds.Y) - message.Position = UDim2.new(0, 5, 0, posOffset) - message.Parent = Dev_TextHolder - posOffset += message.TextBounds.Y - - if movePosition then - if - (currentConsole == LOCAL_CONSOLE and localOffset > 0) - or ( - currentConsole == SERVER_CONSOLE - and serverOffset > 0 - ) - then - changeOffset(message.TextBounds.Y) - end - end - - message.Visible = true - - if messageList[i].Type == Enum.MessageType.MessageError then - message.TextColor3 = Color3.new(1, 0, 0) - elseif messageList[i].Type == Enum.MessageType.MessageInfo then - message.TextColor3 = Color3.new(0.4, 0.5, 1) - elseif - messageList[i].Type == Enum.MessageType.MessageWarning - then - message.TextColor3 = Color3.new(1, 0.6, 0.4) - else - message.TextColor3 = Color3.new(1, 1, 1) - end - end - end - - textHolderSize = posOffset - end - - -- Refreshing the textholder every 0.1 (if needed) is good enough, surely fast enough - -- We don't want it to update 50x in a tick because there are 50 messages in that tick - -- (Whenever for one reason or another a lot of output comes in, it can lag - -- This will make it behave better in a situation of a lot of output comming in) - local refreshQueued = false - local function refreshTextHolder() - if refreshQueued then - return - end - Delay(0.1, function() - refreshQueued = false - refreshTextHolderForReal() - end) - refreshQueued = true - end - - --Handle Dev-Console Scrollbar - - local inside = 0 - local function holdingUpButton() - if scrollUpIsDown then - return - end - scrollUpIsDown = true - wait(0.6) - inside += 1 - while scrollUpIsDown and inside < 2 do - wait() - changeOffset(12) - end - inside -= 1 - end - - local function holdingDownButton() - if scrollDownIsDown then - return - end - scrollDownIsDown = true - wait(0.6) - inside += 1 - while scrollDownIsDown and inside < 2 do - wait() - changeOffset(-12) - end - inside -= 1 - end - - Dev_Container.Body.ScrollBar.Up.MouseButton1Click:connect(function() - changeOffset(10) - end) - - Dev_Container.Body.ScrollBar.Up.MouseButton1Down:connect(function() - changeOffset(10) - holdingUpButton() - end) - - Dev_Container.Body.ScrollBar.Up.MouseButton1Up:connect(function() - clean() - end) - - Dev_Container.Body.ScrollBar.Down.MouseButton1Down:connect(function() - changeOffset(-10) - holdingDownButton() - end) - - Dev_Container.Body.ScrollBar.Down.MouseButton1Up:connect(function() - clean() - end) - - local function handleScroll(x, y) - if not previousMousePosScroll then - return - end - - local delta = (Vector2.new(x, y) - previousMousePosScroll).Y - - local backRatio = 1 - - ( - Dev_Container.Body.TextBox.AbsoluteSize.Y - / Dev_TextHolder.AbsoluteSize.Y - ) - - local movementSize = Dev_ScrollArea.AbsoluteSize.Y - - Dev_ScrollArea.Handle.AbsoluteSize.Y - local normalDelta = - math.max(math.min(delta, movementSize), 0 - movementSize) - local normalRatio = normalDelta / movementSize - - local textMovementSize = (backRatio * Dev_TextHolder.AbsoluteSize.Y) - local offsetChange = textMovementSize * normalRatio - - if currentConsole == LOCAL_CONSOLE then - localOffset = pOffset - offsetChange - elseif currentConsole == SERVER_CONSOLE then - serverOffset = pOffset - offsetChange - end - end - - Dev_ScrollArea.Handle.MouseButton1Down:connect(function(x, y) - previousMousePosScroll = Vector2.new(x, y) - -- pScrollHandle = Dev_ScrollArea.Handle.AbsolutePosition - if currentConsole == LOCAL_CONSOLE then - pOffset = localOffset - elseif currentConsole == SERVER_CONSOLE then - pOffset = serverOffset - end - end) - - Dev_ScrollArea.Handle.MouseButton1Up:connect(function(_, _) - clean() - end) - - local function existsInsideContainer(container, x, y) - local pos = container.AbsolutePosition - local size = container.AbsoluteSize - if - x < pos.X - or x > pos.X + size.X - or y < pos.y - or y > pos.y + size.y - then - return false - end - return true - end - - -- Easy, fast, and working nicely - local function numberWithZero(num) - return (num < 10 and "0" or "") .. num - end - - local function ConvertTimeStamp(timeStamp) - local localTime = timeStamp - os.time() + math.floor(tick()) - local dayTime = localTime % 86400 - - local hour = math.floor(dayTime / 3600) - - dayTime -= (hour * 3600) - local minute = math.floor(dayTime / 60) - - dayTime -= (minute * 60) - - local h = numberWithZero(hour) - local m = numberWithZero(minute) - local s = numberWithZero(dayTime) - - return `{h}{m}{s}` - end - - --Filter - - Dev_OptionsBar.ErrorToggleButton.MouseButton1Down:connect(function(_, _) - errorToggleOn = not errorToggleOn - Dev_OptionsBar.ErrorToggleButton.CheckFrame.Visible = errorToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.WarningToggleButton.MouseButton1Down:connect(function(_, _) - warningToggleOn = not warningToggleOn - Dev_OptionsBar.WarningToggleButton.CheckFrame.Visible = warningToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.InfoToggleButton.MouseButton1Down:connect(function(_, _) - infoToggleOn = not infoToggleOn - Dev_OptionsBar.InfoToggleButton.CheckFrame.Visible = infoToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.OutputToggleButton.MouseButton1Down:connect(function(_, _) - outputToggleOn = not outputToggleOn - Dev_OptionsBar.OutputToggleButton.CheckFrame.Visible = outputToggleOn - refreshTextHolder() - repositionList() - end) - - Dev_OptionsBar.WordWrapToggleButton.MouseButton1Down:connect(function(_, _) - wordWrapToggleOn = not wordWrapToggleOn - Dev_OptionsBar.WordWrapToggleButton.CheckFrame.Visible = - wordWrapToggleOn - refreshTextHolder() - repositionList() - end) - - ---Dev-Console Message Functionality - local function AddLocalMessage(messageStr, messageType, timeStamp) - localMessageList[#localMessageList + 1] = { - Message = messageStr, - Time = ConvertTimeStamp(timeStamp), - Type = messageType, - } - while #localMessageList > MAX_LIST_SIZE do - table.remove(localMessageList, 1) - end - - refreshTextHolder() - - repositionList() - end - - local function AddServerMessage(messageStr, messageType, timeStamp) - serverMessageList[#serverMessageList + 1] = { - Message = messageStr, - Time = ConvertTimeStamp(timeStamp), - Type = messageType, - } - while #serverMessageList > MAX_LIST_SIZE do - table.remove(serverMessageList, 1) - end - - refreshTextHolder() - - repositionList() - end - - --Handle Dev-Console Local/Server Buttons - Dev_Container.Body.LocalConsole.MouseButton1Click:connect(function(_, _) - if currentConsole == SERVER_CONSOLE then - currentConsole = LOCAL_CONSOLE - local localConsole = Dev_Container.Body.LocalConsole - local serverConsole = Dev_Container.Body.ServerConsole - - localConsole.Size = UDim2.new(0, 90, 0, 20) - serverConsole.Size = UDim2.new(0, 90, 0, 17) - localConsole.BackgroundTransparency = 0.6 - serverConsole.BackgroundTransparency = 0.8 - - if game:FindFirstChild "Players" and game.Players.LocalPlayer then - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - end - - refreshTextHolder() - repositionList() - end - end) - - Dev_Container.Body.LocalConsole.MouseButton1Up:connect(function() - clean() - end) - - local serverHistoryRequested = false - - Dev_Container.Body.ServerConsole.MouseButton1Click:connect(function(_, _) - if not serverHistoryRequested then - serverHistoryRequested = true - game:GetService("LogService"):RequestServerOutput() - end - - if currentConsole == LOCAL_CONSOLE then - currentConsole = SERVER_CONSOLE - local localConsole = Dev_Container.Body.LocalConsole - local serverConsole = Dev_Container.Body.ServerConsole - - serverConsole.Size = UDim2.new(0, 90, 0, 20) - localConsole.Size = UDim2.new(0, 90, 0, 17) - serverConsole.BackgroundTransparency = 0.6 - localConsole.BackgroundTransparency = 0.8 - - if game:FindFirstChild "Players" and game.Players.LocalPlayer then - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - end - - refreshTextHolder() - repositionList() - end - end) - - ---Extra Mouse Handlers for Dev-Console - Dev_Container.Body.ServerConsole.MouseButton1Up:connect(function() - clean() - end) - - if game:FindFirstChild "Players" and game.Players.LocalPlayer then - local LocalMouse = game.Players.LocalPlayer:GetMouse() - LocalMouse.Move:connect(function() - if not Dev_Container.Visible then - return - end - local mouse = game.Players.LocalPlayer:GetMouse() - refreshConsolePosition(mouse.X, mouse.Y) - refreshConsoleSize(mouse.X, mouse.Y) - handleScroll(mouse.X, mouse.Y) - - refreshTextHolder() - repositionList() - end) - - LocalMouse.Button1Up:connect(function() - clean() - end) - - LocalMouse.WheelForward:connect(function() - if not Dev_Container.Visible then - return - end - if - existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) - then - changeOffset(10) - end - end) - - LocalMouse.WheelBackward:connect(function() - if not Dev_Container.Visible then - return - end - if - existsInsideContainer(Dev_Container, LocalMouse.X, LocalMouse.Y) - then - changeOffset(-10) - end - end) - end - - Dev_ScrollArea.Handle.MouseButton1Down:connect(function() - repositionList() - end) - - ---Populate Dev-Console with dummy messages - - local history = game:GetService("LogService"):GetLogHistory() - - for i = 1, #history do - AddLocalMessage( - history[i].message, - history[i].messageType, - history[i].timestamp - ) - end - - game:GetService("LogService").MessageOut - :connect(function(message, messageType) - AddLocalMessage(message, messageType, os.time()) - end) - - game:GetService("LogService").ServerMessageOut:connect(AddServerMessage) -end - -local currentlyToggling = false -function ToggleConsole.OnInvoke() - if currentlyToggling then - return - end - - currentlyToggling = true - initializeDeveloperConsole() - Dev_Container.Visible = not Dev_Container.Visible - currentlyToggling = false -end diff --git a/luau/38037565.luau b/luau/38037565.luau deleted file mode 100644 index d2a0d99..0000000 --- a/luau/38037565.luau +++ /dev/null @@ -1,272 +0,0 @@ --- Unused by Mercury -print "[Mercury]: Loaded corescript 38037565" -for _ = 1, 8 do - print "IF YOU SEE THIS MESSAGE, PLEASE REPORT IT TO THE MERCURY DEVELOPERS" -end - -local damageGuiWidth = 5 -local damageGuiHeight = 5 - -local function waitForChild(parent, childName) - local child = parent:findFirstChild(childName) - if child then - return child - end - while true do - child = parent.ChildAdded:wait() - if child.Name == childName then - return child - end - end -end - --- declarations -local Figure = script.Parent -local Humanoid = waitForChild(Figure, "Humanoid") -local Torso = waitForChild(Figure, "Torso") - -local config = Figure:FindFirstChild "PlayerStats" - -local inCharTag = Instance.new "BoolValue" -inCharTag.Name = "InCharTag" - -local hider = Instance.new "BoolValue" -hider.Name = "RobloxBuildTool" - -local currentChildren, backpackTools - -if config == nil then - config = Instance.new "Configuration" - config.Parent = Figure - config.Name = "PlayerStats" -end - -local myHealth = config:FindFirstChild "MaxHealth" -if myHealth == nil then - myHealth = Instance.new "NumberValue" - myHealth.Parent = config - myHealth.Value = 100 - myHealth.Name = "MaxHealth" -end - -Humanoid.MaxHealth = myHealth.Value -Humanoid.Health = myHealth.Value - -local function onMaxHealthChange() - Humanoid.MaxHealth = myHealth.Value - Humanoid.Health = myHealth.Value -end - -myHealth.Changed:connect(onMaxHealthChange) - ---Humanoid.MaxHealth = myHealth.Value ---Humanoid.Health = Humanoid.MaxHealth - -local vPlayer = game.Players:GetPlayerFromCharacter(script.Parent) -local dotGui = vPlayer.PlayerGui:FindFirstChild "DamageOverTimeGui" -if dotGui == nil then - dotGui = Instance.new "BillboardGui" - dotGui.Name = "DamageOverTimeGui" - dotGui.Parent = vPlayer.PlayerGui - dotGui.Adornee = script.Parent:FindFirstChild "Head" - dotGui.Active = true - dotGui.size = UDim2.new(damageGuiWidth, 0, damageGuiHeight, 0.0) - dotGui.StudsOffset = Vector3.new(0, 2.0, 0.0) -end - -print "newHealth declarations finished" - -local function billboardHealthChange(dmg) - local textLabel = Instance.new "TextLabel" - textLabel.TextColor3 = dmg > 0 and Color3.new(0, 1, 0) - or Color3.new(1, 0, 1) - textLabel.Text = tostring(dmg) - textLabel.size = UDim2.new(1, 0, 1, 0.0) - textLabel.Active = true - textLabel.FontSize = 6 - textLabel.BackgroundTransparency = 1 - textLabel.Parent = dotGui - - for t = 1, 10 do - wait(0.1) - textLabel.TextTransparency = t / 10 - textLabel.Position = UDim2.new(0, 0, 0, -t * 5) - textLabel.FontSize = 6 - t * 0.6 - end - - textLabel:remove() -end - -local function setMaxHealth() - --print(Humanoid.Health) - if myHealth.Value >= 0 then - Humanoid.MaxHealth = myHealth.Value - print(Humanoid.MaxHealth) - if Humanoid.Health > Humanoid.MaxHealth then - Humanoid.Health = Humanoid.MaxHealth - end - end -end - -myHealth.Changed:connect(setMaxHealth) - --- Visual Effects -- - -local fireEffect = Instance.new "Fire" -fireEffect.Heat = 0.1 -fireEffect.Size = 3.0 -fireEffect.Name = "FireEffect" -fireEffect.Enabled = false --- - --- regeneration -while true do - local s = wait(1) - local health = Humanoid.Health - if health > 0 then -- and health < Humanoid.MaxHealth then - local delta = 0 - if config then - local regen = config:FindFirstChild "Regen" - local poison = config:FindFirstChild "Poison" - local ice = config:FindFirstChild "Ice" - local fire = config:FindFirstChild "Fire" - local stun = config:FindFirstChild "Stun" - if regen then - delta += regen.Value.X - if regen.Value.Y >= 0 then - regen.Value = Vector3.new( - regen.Value.X + regen.Value.Z, - regen.Value.Y - s, - regen.Value.Z - ) -- maybe have 3rd parameter be an increaser/decreaser? - elseif regen.Value.Y == -1 then - regen.Value = Vector3.new( - regen.Value.X + regen.Value.Z, - -1, - regen.Value.Z - ) - else - regen:remove() - end -- infinity is -1 - end - if poison then - delta -= poison.Value.X - if poison.Value.Y >= 0 then - poison.Value = Vector3.new( - poison.Value.X + poison.Value.Z, - poison.Value.Y - s, - poison.Value.Z - ) - elseif poison.Value.Y == -1 then - poison.Value = Vector3.new( - poison.Value.X + poison.Value.Z, - -1, - poison.Value.Z - ) - else - poison:remove() - end -- infinity is -1 - end - - if ice then - --print("IN ICE") - delta -= ice.Value.X - if ice.Value.Y >= 0 then - ice.Value = - Vector3.new(ice.Value.X, ice.Value.Y - s, ice.Value.Z) - else - ice:remove() - end - end - - if fire then - fireEffect.Enabled = true - fireEffect.Parent = Figure.Torso - delta -= fire.Value.X - if fire.Value.Y >= 0 then - fire.Value = Vector3.new( - fire.Value.X, - fire.Value.Y - s, - fire.Value.Z - ) - else - fire:remove() - fireEffect.Enabled = false - fireEffect.Parent = nil - end - end - - if stun then - if stun.Value > 0 then - Torso.Anchored = true - currentChildren = script.Parent:GetChildren() - backpackTools = game.Players - :GetPlayerFromCharacter(script.Parent).Backpack - :GetChildren() - for i = 1, #currentChildren do - if currentChildren[i].className == "Tool" then - inCharTag:Clone().Parent = currentChildren[i] - print(backpackTools) - table.insert(backpackTools, currentChildren[i]) - end - end - for i = 1, #backpackTools do - if - backpackTools[i]:FindFirstChild "RobloxBuildTool" - == nil - then - hider:Clone().Parent = backpackTools[i] - backpackTools[i].Parent = game.Lighting - end - end - wait(0.2) - for i = 1, #backpackTools do - backpackTools[i].Parent = - game.Players:GetPlayerFromCharacter(script.Parent).Backpack - end - stun.Value -= s - else - Torso.Anchored = false - for i = 1, #backpackTools do - local rbTool = - backpackTools[i]:FindFirstChild "RobloxBuildTool" - if rbTool then - rbTool:Remove() - end - backpackTools[i].Parent = game.Lighting - end - wait(0.2) - for i = 1, #backpackTools do - local wasInChar = - backpackTools[i]:FindFirstChild "InCharTag" - if wasInChar then - wasInChar:Remove() - backpackTools[i].Parent = script.Parent - else - backpackTools[i].Parent = - game.Players:GetPlayerFromCharacter( - script.Parent - ).Backpack - end - end - stun:Remove() - end - end - - if delta ~= 0 then - coroutine.resume(coroutine.create(billboardHealthChange), delta) - end - --delta *= .01 - end - --health += delta * s * Humanoid.MaxHealth - - health = Humanoid.Health + delta * s - if health * 1.01 < Humanoid.MaxHealth then - Humanoid.Health = health - --myHealth.Value = math.floor(Humanoid.Health) - elseif delta > 0 then - Humanoid.Health = Humanoid.MaxHealth - --myHealth.Value = Humanoid.Health - end - end -end diff --git a/luau/46295863.luau b/luau/46295863.luau index 51ae37a..2eb0463 100644 --- a/luau/46295863.luau +++ b/luau/46295863.luau @@ -312,13 +312,11 @@ local function setDisabledState(guiObject) elseif guiObject:IsA "TextButton" then guiObject.TextTransparency = 0.9 guiObject.Active = false - else - if guiObject.ClassName then - print( - "setDisabledState() got object of unsupported type. object type is ", - guiObject.ClassName - ) - end + elseif guiObject.ClassName then + print( + "setDisabledState() got object of unsupported type. object type is ", + guiObject.ClassName + ) end end @@ -1369,20 +1367,13 @@ local function createGameSettingsMenu(baseZIndex, _) if hasGraphicsSlider then UserSettings().GameSettings.FullscreenChanged:connect( function(isFullscreen) - if isFullscreen then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end + fullscreenCheckbox.Text = isFullscreen and "X" or "" end ) else fullscreenCheckbox.MouseButton1Click:connect(function() - if fullscreenCheckbox.Text == "" then - fullscreenCheckbox.Text = "X" - else - fullscreenCheckbox.Text = "" - end + fullscreenCheckbox.Text = fullscreenCheckbox.Text == "" and "X" + or "" end) end @@ -1535,6 +1526,9 @@ end RbxGui = LoadLibrary "RbxGui" +GuiService:AddKey "l" +GuiService:AddKey "r" + local baseZIndex = 0 if UserSettings then local createSettingsDialog = function() @@ -1657,82 +1651,109 @@ if UserSettings then end) end - gameMainMenu.ResetButton.MouseButton1Click:connect(function() + local function confirmReset() goToMenu( settingsFrame, "ResetConfirmationMenu", "up", UDim2.new(0, 525, 0, 370) ) - end) + end - gameMainMenu.LeaveGameButton.MouseButton1Click:connect(function() + local function confirmLeave() goToMenu( settingsFrame, "LeaveConfirmationMenu", "down", UDim2.new(0, 525, 0, 300) ) - end) + end + + local hotkeysConn + local function leaveResetHotkeys(key) -- esc, r, not enter (unfortunately) + if hotkeysConn then + hotkeysConn:disconnect() + end + if key == "r" then + confirmReset() + elseif key == "l" then + confirmLeave() + end + end + + local function showFunction() + settingsButton.Active = false + updateCameraDropDownSelection( + UserSettings().GameSettings.ControlMode.Name + ) + + if syncVideoCaptureSetting then + syncVideoCaptureSetting() + end + + goToMenu( + settingsFrame, + "GameMainMenu", + "right", + UDim2.new(0, 525, 0, 430) + ) + shield.Visible = true + shield.Active = true + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, 0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + end + + local function hideFunction() + settingsFrame.Parent:TweenPosition( + UDim2.new(0.5, -262, -0.5, -200), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + settingsFrame.Parent:TweenSize( + UDim2.new(0, 525, 0, 430), + Enum.EasingDirection.InOut, + Enum.EasingStyle.Sine, + tweenTime, + true + ) + shield.Visible = false + settingsButton.Active = true + end + + gameMainMenu.ResetButton.MouseButton1Click:connect(confirmReset) + gameMainMenu.LeaveGameButton.MouseButton1Click:connect(confirmLeave) GuiService.EscapeKeyPressed:connect(function() + if hotkeysConn then + hotkeysConn:disconnect() + end + -- Prevent mysterious missing settings menu bugs + delay(tweenTime, function() + if hotkeysConn then + hotkeysConn:disconnect() + end + hotkeysConn = GuiService.KeyPressed:connect(leaveResetHotkeys) + end) if currentMenuSelection == nil then game.GuiService:AddCenterDialog( shield, Enum.CenterDialogType.ModalDialog, - --showFunction - function() - settingsButton.Active = false - updateCameraDropDownSelection( - UserSettings().GameSettings.ControlMode.Name - ) - - if syncVideoCaptureSetting then - syncVideoCaptureSetting() - end - - goToMenu( - settingsFrame, - "GameMainMenu", - "right", - UDim2.new(0, 525, 0, 430) - ) - shield.Visible = true - shield.Active = true - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, 0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - end, - --hideFunction - function() - settingsFrame.Parent:TweenPosition( - UDim2.new(0.5, -262, -0.5, -200), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - settingsFrame.Parent:TweenSize( - UDim2.new(0, 525, 0, 430), - Enum.EasingDirection.InOut, - Enum.EasingStyle.Sine, - tweenTime, - true - ) - shield.Visible = false - settingsButton.Active = true - end + showFunction, + hideFunction ) elseif #lastMenuSelection > 0 then if #centerDialogs > 0 then diff --git a/luau/48488398.luau b/luau/48488398.luau index 3245ae4..a654ec3 100644 --- a/luau/48488398.luau +++ b/luau/48488398.luau @@ -3,12 +3,12 @@ print "[Mercury]: Loaded corescript 48488398" local TeleportService = game:GetService "TeleportService" -function waitForProperty(instance, property) +local function waitForProperty(instance, property) while not instance[property] do instance.Changed:wait() end end -function waitForChild(instance, name) +local function waitForChild(instance, name) while not instance:FindFirstChild(name) do instance.ChildAdded:wait() end @@ -26,13 +26,31 @@ local friendRequestBlacklist = {} local teleportEnabled = true -local makePopupInvisible = function() +local function makePopupInvisible() if script.Parent.Popup then script.Parent.Popup.Visible = false end end -function makeFriend(fromPlayer, toPlayer) +local function showOneButton() + local popup = script.Parent:FindFirstChild "Popup" + if popup then + popup.OKButton.Visible = true + popup.DeclineButton.Visible = false + popup.AcceptButton.Visible = false + end +end + +local function showTwoButtons() + local popup = script.Parent:FindFirstChild "Popup" + if popup then + popup.OKButton.Visible = false + popup.DeclineButton.Visible = true + popup.AcceptButton.Visible = true + end +end + +local function makeFriend(fromPlayer, toPlayer) local popup = script.Parent:FindFirstChild "Popup" if popup == nil then return @@ -145,25 +163,7 @@ game.Players.FriendRequestEvent:connect(function(fromPlayer, toPlayer, event) end end) -function showOneButton() - local popup = script.Parent:FindFirstChild "Popup" - if popup then - popup.OKButton.Visible = true - popup.DeclineButton.Visible = false - popup.AcceptButton.Visible = false - end -end - -function showTwoButtons() - local popup = script.Parent:FindFirstChild "Popup" - if popup then - popup.OKButton.Visible = false - popup.DeclineButton.Visible = true - popup.AcceptButton.Visible = true - end -end - -function showTeleportUI(message, timer) +local function showTeleportUI(message, timer) if teleportUI ~= nil then teleportUI:Remove() end @@ -177,7 +177,7 @@ function showTeleportUI(message, timer) end end -function onTeleport(teleportState, _, _) +local function onTeleport(teleportState) if TeleportService.CustomizedTeleportUI == false then if teleportState == Enum.TeleportState.Started then showTeleportUI("Teleport started...", 0) diff --git a/luau/97188756.luau b/luau/97188756.luau index 904c50b..1124019 100644 --- a/luau/97188756.luau +++ b/luau/97188756.luau @@ -21,29 +21,10 @@ local function WaitForChild(parent, childName) return parent[childName] end --- wtf --- local function typedef(obj) --- return obj --- end - local function IsPhone() local cGui = Game:GetService "CoreGui" local rGui = WaitForChild(cGui, "RobloxGui") - if rGui.AbsoluteSize.Y < 600 then - return true - end - return false -end - --- Users can use enough white spaces to spoof chatting as other players --- This function removes trailing and leading white spaces --- AFAIK, there is no reason for spam white spaces -local function StringTrim(str) - -- %S is whitespaces - -- When we find the first non space character defined by ^%s - -- we yank out anything in between that and the end of the string - -- Everything else is replaced with %1 which is essentially nothing - return (str:gsub("^%s*(.-)%s*$", "%1")) + return rGui.AbsoluteSize.Y < 600 end while Game.Players.LocalPlayer == nil do @@ -60,59 +41,53 @@ local Camera = Game.Workspace.CurrentCamera local CoreGuiService = Game:GetService "CoreGui" local PlayersService = Game:GetService "Players" local GuiService = Game:GetService "GuiService" -local UserInputService = Game:GetService "UserInputService" -- Lua Enums -local Enums, CreateEnum -do - Enums = {} - local EnumName = {} -- used as unique key for enum name - local enum_mt = { - __call = function(self, value) - return self[value] or self[tonumber(value)] - end, - __index = { - GetEnumItems = function(self) - local t = {} - for i, item in pairs(self) do - if type(i) == "number" then - t[#t + 1] = item - end +local Enums = {} +local EnumName = {} -- used as unique key for enum name +local enum_mt = { + __call = function(self, value) + return self[value] or self[tonumber(value)] + end, + __index = { + GetEnumItems = function(self) + local t = {} + for i, item in pairs(self) do + if type(i) == "number" then + t[#t + 1] = item end - table.sort(t, function(a, b) - return a.Value < b.Value - end) - return t - end, - }, - __tostring = function(self) - return `Enum.{self[EnumName]}` - end, - } - local item_mt = { - __call = function(self, value) - return value == self or value == self.Name or value == self.Value - end, - __tostring = function(self) - return `Enum.{self[EnumName]}.{self.Name}` - end, - } - CreateEnum = function(enumName) - return function(t) - local e = { [EnumName] = enumName } - for i, name in pairs(t) do - local item = setmetatable( - { Name = name, Value = i, Enum = e, [EnumName] = enumName }, - item_mt - ) - e[i] = item - e[name] = item - e[item] = item end - Enums[enumName] = e - return setmetatable(e, enum_mt) - end + table.sort(t, function(a, b) + return a.Value < b.Value + end) + return t + end, + }, + __tostring = function(self) + return `Enum.{self[EnumName]}` + end, +} +local item_mt = { + __call = function(self, value) + return value == self or value == self.Name or value == self.Value + end, + __tostring = function(self) + return `Enum.{self[EnumName]}.{self.Name}` + end, +} +local function CreateEnum(enumName, t) + local e = { [EnumName] = enumName } + for i, name in pairs(t) do + local item = setmetatable( + { Name = name, Value = i, Enum = e, [EnumName] = enumName }, + item_mt + ) + e[i] = item + e[name] = item + e[item] = item end + Enums[enumName] = e + return setmetatable(e, enum_mt) end --------------------------------------------------- ------------------ Input class -------------------- @@ -183,7 +158,7 @@ local Chat = { Admins_List = { "taskmanager", "Heliodex", "tako" }, SafeChat_List = SafeChat, - CreateEnum "SafeChat" { "Level1", "Level2", "Level3" }, + CreateEnum("SafeChat", { "Level1", "Level2", "Level3" }), SafeChatTree = {}, TempSpaceLabel = nil, } @@ -462,7 +437,13 @@ function Chat:CreateMessage(cPlayer, message) else pName = cPlayer.Name end - message = StringTrim(message) + -- Users can use enough white spaces to spoof chatting as other players + -- This removes trailing and leading white spaces + -- AFAIK, there is no reason for spam white spaces + -- %S is whitespaces + -- When we find the first non space character defined by ^%s we yank out anything in between that and the end of the string + -- Everything else is replaced with %1 which is essentially nothing + message = string.gsub(message, "^%s*(.-)%s*$", "%1") local pLabel local mLabel -- Our history stores upto 50 messages that is 100 textlabels @@ -610,103 +591,6 @@ function Chat:FindButtonTree(scButton, rootList) return list end -function Chat:ToggleSafeChatMenu(scButton) - local list = Chat:FindButtonTree(scButton, self.SafeChatTree) - if list then - for button, _ in pairs(list) do - if button:IsA "TextButton" or button:IsA "ImageButton" then - button.Visible = not button.Visible - end - end - return true - end - return false -end - -function Chat:CreateSafeChatOptions(list, rootButton) - local text_List = {} - local count = 0 - text_List[rootButton] = {} - text_List[rootButton][1] = list[1] - rootButton = rootButton or self.SafeChatButton - for msg, _ in pairs(list) do - if type(msg) == "string" then - local chatText = New "TextButton" { - Name = msg, - Text = msg, - Size = UDim2.new(0, 100, 0, 20), - TextXAlignment = Enum.TextXAlignment.Center, - TextColor3 = Color3.new(0.2, 0.1, 0.1), - BackgroundTransparency = 0.5, - BackgroundColor3 = Color3.new(1, 1, 1), - Parent = self.SafeChatFrame, - Visible = false, - Position = UDim2.new( - 0, - rootButton.Position.X.Scale + 105, - 0, - rootButton.Position.Y.Scale - ((count - 3) * 100) - ), - } - - count += 1 - - if type(list[msg]) == "table" then - text_List[rootButton][chatText] = - Chat:CreateSafeChatOptions(list[msg], chatText) - -- else - -- --table.insert(text_List[chatText], true) - end - chatText.MouseEnter:connect(function() - Chat:ToggleSafeChatMenu(chatText) - end) - - chatText.MouseLeave:connect(function() - Chat:ToggleSafeChatMenu(chatText) - end) - - chatText.MouseButton1Click:connect(function() - local lList = Chat:FindButtonTree(chatText) - -- if lList then - -- for i, v in pairs(lList) do - -- end - -- else - -- end - pcall(function() - PlayersService:Chat(lList[1]) - end) - end) - end - end - return text_List -end - -function Chat:CreateSafeChatGui() - self.SafeChatFrame = New "Frame" { - Name = "SafeChatFrame", - Size = UDim2.new(1, 0, 1, 0), - Parent = self.Gui, - BackgroundTransparency = 1, - - New "ImageButton" { - Name = "SafeChatButton", - Size = UDim2.new(0, 44, 0, 31), - Position = UDim2.new(0, 1, 0.35, 0), - BackgroundTransparency = 1, - Image = "http://banland.xyz/asset/?id=97080365", - }, - } - - self.SafeChatButton = self.SafeChatFrame.SafeChatButton - -- safe chat button is the root of this tree - self.SafeChatTree[self.SafeChatButton] = - Chat:CreateSafeChatOptions(self.SafeChat_List, self.SafeChatButton) - - self.SafeChatButton.MouseButton1Click:connect(function() - Chat:ToggleSafeChatMenu(self.SafeChatButton) - end) -end - function Chat:FocusOnChatBar() if self.ClickToChatButton then self.ClickToChatButton.Visible = false @@ -719,58 +603,6 @@ function Chat:FocusOnChatBar() self.ChatBar:CaptureFocus() end --- For touch devices we create a button instead -function Chat:CreateTouchButton() - self.ChatTouchFrame = New "Frame" { - Name = "ChatTouchFrame", - Size = UDim2.new(0, 128, 0, 32), - Position = UDim2.new(0, 88, 0, 0), - BackgroundTransparency = 1, - Parent = self.Gui, - - New "ImageButton" { - Name = "ChatLabel", - Size = UDim2.new(0, 74, 0, 28), - Position = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - ZIndex = 2.0, - }, - New "ImageLabel" { - Name = "Background", - Size = UDim2.new(1, 0, 1, 0), - Position = UDim2.new(0, 0, 0, 0), - BackgroundTransparency = 1, - Image = "http://banland.xyz/asset/?id=97078724", - }, - } - self.TapToChatLabel = self.ChatTouchFrame.ChatLabel - self.TouchLabelBackground = self.ChatTouchFrame.Background - - self.ChatBar = New "TextBox" { - Name = "ChatBar", - Size = UDim2.new(1, 0, 0.2, 0), - Position = UDim2.new(0, 0, 0.8, 800), - Text = "", - ZIndex = 1, - BackgroundTransparency = 1, - Parent = self.Frame, - TextXAlignment = Enum.TextXAlignment.Left, - TextColor3 = Color3.new(1, 1, 1), - ClearTextOnFocus = false, - } - - self.TapToChatLabel.MouseButton1Click:connect(function() - self.TapToChatLabel.Visible = false - --self.ChatBar.Visible = true - --self.Frame.Background.Visible = true - self.ChatBar:CaptureFocus() - self.GotFocus = true - if self.TouchLabelBackground then - self.TouchLabelBackground.Visible = false - end - end) -end - -- Non touch devices, create the bottom chat bar function Chat:CreateChatBar() -- okay now we do @@ -893,7 +725,6 @@ function Chat:CreateGui() if forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu then Chat:CreateChatBar() - -- Chat:CreateSafeChatGui() if self.ChatBar then self.ChatBar.FocusLost:connect(function(enterPressed) @@ -965,19 +796,16 @@ function Input:Initialize() end function Chat:FindMessageInSafeChat(message, list) - local foundMessage = false for msg, _ in pairs(list) do - if msg == message then + if + msg == message + or type(list[msg]) == "table" + and Chat:FindMessageInSafeChat(message, list[msg]) + then return true end - if type(list[msg]) == "table" then - foundMessage = Chat:FindMessageInSafeChat(message, list[msg]) - if foundMessage then - return true - end - end end - return foundMessage + return false end -- Just a wrapper around our PlayerChatted event @@ -997,22 +825,20 @@ function Chat:PlayerChatted(...) end end - if PlayersService.ClassicChat then - if - not ( - string.sub(message, 1, 3) == "/e " - or string.sub(message, 1, 7) == "/emote " - ) - and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) - or (Player.ChatMode == Enum.ChatMode.Menu and string.sub( + if + PlayersService.ClassicChat + and (not (string.sub(message, 1, 3) == "/e " or string.sub( + message, + 1, + 7 + ) == "/emote ") and (forceChatGUI or Player.ChatMode == Enum.ChatMode.TextAndMenu) or (Player.ChatMode == Enum.ChatMode.Menu and string.sub( message, 1, 3 - ) == "/sc") - or (Chat:FindMessageInSafeChat(message, self.SafeChat_List)) - then - Chat:UpdateChat(player, message) - end + ) == "/sc")) + or (Chat:FindMessageInSafeChat(message, self.SafeChat_List)) + then + Chat:UpdateChat(player, message) end end @@ -1061,11 +887,7 @@ function Chat:CoreGuiChanged(coreGuiType, enabled) if self.ChatBar then self.ChatBar.Visible = enabled - if enabled then - GuiService:SetGlobalGuiInset(0, 0, 0, 20) - else - GuiService:SetGlobalGuiInset(0, 0, 0, 0) - end + GuiService:SetGlobalGuiInset(0, 0, 0, enabled and 20 or 0) end end end @@ -1087,11 +909,13 @@ function Chat:Initialize() ) end) - self.EventListener = PlayersService.PlayerChatted:connect(function(...) + local function chatted(...) -- This event has 4 callback arguments -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer Chat:PlayerChatted(...) - end) + end + + self.EventListener = PlayersService.PlayerChatted:connect(chatted) self.MessageThread = coroutine.create(function() end) coroutine.resume(self.MessageThread) @@ -1103,11 +927,7 @@ function Chat:Initialize() -- NOTE: PlayerAdded only fires on the server, hence ChildAdded is used here PlayersService.ChildAdded:connect(function() Chat.EventListener:disconnect() - self.EventListener = PlayersService.PlayerChatted:connect(function(...) - -- This event has 4 callback arguments - -- Enum.PlayerChatType.All, chatPlayer, message, targetPlayer - Chat:PlayerChatted(...) - end) + self.EventListener = PlayersService.PlayerChatted:connect(chatted) end) Spawn(function() diff --git a/luau/studio.luau b/luau/studio.luau index 1577b4b..c4f6b5e 100644 --- a/luau/studio.luau +++ b/luau/studio.luau @@ -1,4 +1,5 @@ print "[Mercury]: Loaded Studio corescript" + local MarketplaceService = game:GetService "MarketplaceService" local InsertService = game:GetService "InsertService" local SocialService = game:GetService "SocialService" diff --git a/luau/visit.luau b/luau/visit.luau index 8360b7c..48b530c 100644 --- a/luau/visit.luau +++ b/luau/visit.luau @@ -1,15 +1,14 @@ print "[Mercury]: Loaded Visit corescript" + local ChangeHistoryService = game:GetService "ChangeHistoryService" local InsertService = game:GetService "InsertService" local Players = game:GetService "Players" local RunService = game:GetService "RunService" local ScriptInformationProvider = game:GetService "ScriptInformationProvider" local SocialService = game:GetService "SocialService" -local CoreGui = game:GetService "CoreGui" local ContentProvider = game:GetService "ContentProvider" local GamePassService = game:GetService "GamePassService" local Visit = game:GetService "Visit" -local ScriptContext = game:GetService "ScriptContext" local player @@ -85,9 +84,6 @@ end) workspace:SetPhysicsThrottleEnabled(true) -local addedBuildTools = false -local screenGui = CoreGui:FindFirstChild "RobloxGui" - function doVisit() message.Text = "Loading Game" @@ -124,19 +120,6 @@ end local success, err = pcall(doVisit) -if not addedBuildTools then - local playerName = Instance.new "StringValue" - playerName.Name = "PlayerName" - playerName.Value = player.Name - playerName.RobloxLocked = true - playerName.Parent = screenGui - - pcall(function() - ScriptContext:AddCoreScript(59431535, screenGui, "BuildToolsScript") - end) - addedBuildTools = true -end - if success then message.Parent = nil else