--[[ AQUA AUTOTYPER v4.1 - v2: history panel, keybinds, case mode, config persistence - v3: gradients, entrance anims, hover FX, sliding history drawer - v4: REAL riddle solver (knowledge base + repeat/trailing composition) - v4.1: fixed solveRiddle — "and " suffixes now captured ("where i go 3 times and sahur" → GYMGYMGYMSAHUR, not GYMGYMGYM) - redeem core unchanged (clickButton + fireBoxFocusLost) ]] -- ============================================================ -- EXECUTOR DETECTION -- ============================================================ local function getExecutorName() local ok, name = pcall(function() return identifyexecutor() end) if ok and name and #name > 0 then return name end ok, name = pcall(function() return getexecutorname() end) if ok and name and #name > 0 then return name end if syn then return "Synapse X" end if Krnl then return "Krnl" end if fluxus then return "Fluxus" end if getexecutorname then local ok2, n = pcall(getexecutorname) if ok2 and n and #n > 0 then return n end end return "Unknown" end local function checkAPIs() local a = {} a.getgenv = pcall(function() return getgenv() end) a.getconnections = type(getconnections) == "function" a.getupvalues = type(getupvalues) == "function" a.firesignal = type(firesignal) == "function" a.setupvalue = type(setupvalue) == "function" a.writefile = type(writefile) == "function" a.getgc = type(getgc) == "function" return a end local executorName = getExecutorName() local apis = checkAPIs() local fullSupport = apis.getgenv and apis.getconnections and apis.getupvalues local minimalSupport = apis.getgenv and apis.getconnections -- ============================================================ -- SERVICES -- ============================================================ local Players = game:GetService("Players") local ReplicatedStorage = game:GetService("ReplicatedStorage") local RunService = game:GetService("RunService") local UserInputService = game:GetService("UserInputService") local TweenService = game:GetService("TweenService") local HttpService = game:GetService("HttpService") local CoreGui = game:GetService("CoreGui") local player = Players.LocalPlayer local playerGui = player:WaitForChild("PlayerGui") if getgenv and getgenv().StopAqua then pcall(getgenv().StopAqua) end for _, name in ipairs({"AquaAutotyperUI", "AquaSplash"}) do local inCore = CoreGui:FindFirstChild(name) if inCore then inCore:Destroy() end local inPG = playerGui:FindFirstChild(name) if inPG then inPG:Destroy() end end -- ============================================================ -- SPLASH SCREEN -- ============================================================ local splash = Instance.new("ScreenGui") splash.Name = "AquaSplash" splash.ResetOnSpawn = false pcall(function() splash.Parent = CoreGui end) if not splash.Parent then splash.Parent = playerGui end local borderC, titleT, msgT, btnT, btnC, btnEnabled if fullSupport then borderC = Color3.fromRGB(34, 211, 238) titleT = "Your executor is supported." msgT = "All core APIs detected (" .. executorName .. ")." btnT = "INITIALIZE" btnC = Color3.fromRGB(34, 211, 238) btnEnabled = true elseif minimalSupport then borderC = Color3.fromRGB(250, 200, 120) titleT = "Partial support detected." msgT = "The script will work but it will be minimal and you may have to redeem manually." btnT = "START (MINIMAL MODE)" btnC = Color3.fromRGB(250, 200, 120) btnEnabled = true else borderC = Color3.fromRGB(240, 120, 120) titleT = "Your executor does not support this." msgT = "Recommended execs: Delta, Solara, Xeno" btnT = "UNSUPPORTED" btnC = Color3.fromRGB(240, 120, 120) btnEnabled = false end local sf = Instance.new("Frame") sf.Size = UDim2.new(0, 400, 0, 240) sf.Position = UDim2.new(0.5, -200, 0.5, -120) sf.BackgroundColor3 = Color3.fromRGB(6, 12, 14) sf.BorderSizePixel = 0 sf.Parent = splash local sfCorner = Instance.new("UICorner", sf) sfCorner.CornerRadius = UDim.new(0, 12) local sfStroke = Instance.new("UIStroke", sf) sfStroke.Thickness = 1.2 sfStroke.Color = borderC local sfGrad = Instance.new("UIGradient", sf) sfGrad.Color = ColorSequence.new(Color3.fromRGB(14, 28, 34), Color3.fromRGB(4, 8, 10)) local function splashLabel(text, y, size, color, bold) local l = Instance.new("TextLabel") l.Size = UDim2.new(1, -40, 0, size) l.Position = UDim2.new(0, 20, 0, y) l.BackgroundTransparency = 1 l.Text = text l.TextColor3 = color l.Font = bold and Enum.Font.GothamBold or Enum.Font.Gotham l.TextSize = size l.TextXAlignment = Enum.TextXAlignment.Left l.TextYAlignment = Enum.TextYAlignment.Top l.TextWrapped = true l.Parent = sf return l end splashLabel("AQUA AUTOTYPER", 20, 20, Color3.fromRGB(240, 250, 252), true) splashLabel("Executor: " .. executorName, 54, 14, Color3.fromRGB(120, 180, 195), false) splashLabel(titleT, 78, 16, borderC, true) splashLabel(msgT, 100, 34, Color3.fromRGB(170, 220, 230), false) splashLabel(string.format("getconnections %s getupvalues %s firesignal %s\nsetupvalue %s getgenv %s writefile %s", apis.getconnections and "OK" or "--", apis.getupvalues and "OK" or "--", apis.firesignal and "OK" or "--", apis.setupvalue and "OK" or "--", apis.getgenv and "OK" or "--", apis.writefile and "OK" or "--"), 138, 40, Color3.fromRGB(120, 180, 195), false) local splashBtn = Instance.new("TextButton") splashBtn.Size = UDim2.new(0, 200, 0, 34) splashBtn.Position = UDim2.new(0.5, -100, 1, -44) splashBtn.BackgroundColor3 = btnC splashBtn.TextColor3 = Color3.fromRGB(4, 10, 12) splashBtn.Text = btnT splashBtn.Font = Enum.Font.GothamBold splashBtn.TextSize = 13 splashBtn.AutoButtonColor = false splashBtn.Parent = sf local splashBtnCorner = Instance.new("UICorner", splashBtn) splashBtnCorner.CornerRadius = UDim.new(0, 6) -- ============================================================ -- ENGINE (built on INIT) -- ============================================================ local loadEngine loadEngine = function() if splash then pcall(function() splash:Destroy() end) splash = nil end -- CONFIG SYSTEM -- local CONFIG_FILE = "aqua_autotyper_config.json" local savedConfig = { codeSniper = true, autoSubmit = true, submitAfter = 3, retypeInvalid = true, caseMode = "EXACT", } pcall(function() if type(isfile) == "function" and type(readfile) == "function" and isfile(CONFIG_FILE) then local decoded = HttpService:JSONDecode(readfile(CONFIG_FILE)) if type(decoded) == "table" then if type(decoded.codeSniper) == "boolean" then savedConfig.codeSniper = decoded.codeSniper end if type(decoded.autoSubmit) == "boolean" then savedConfig.autoSubmit = decoded.autoSubmit end if type(decoded.submitAfter) == "number" then savedConfig.submitAfter = math.max(1, math.min(5, math.floor(decoded.submitAfter))) end if type(decoded.retypeInvalid) == "boolean" then savedConfig.retypeInvalid = decoded.retypeInvalid end if type(decoded.caseMode) == "string" and (decoded.caseMode == "EXACT" or decoded.caseMode == "UPPER" or decoded.caseMode == "LOWER") then savedConfig.caseMode = decoded.caseMode end end end end) local function saveConfig() if type(writefile) ~= "function" then return end pcall(function() writefile(CONFIG_FILE, HttpService:JSONEncode({ codeSniper = savedConfig.codeSniper, autoSubmit = savedConfig.autoSubmit, submitAfter = savedConfig.submitAfter, retypeInvalid = savedConfig.retypeInvalid, caseMode = savedConfig.caseMode, })) end) end -- STATE -- local _enabled = savedConfig.codeSniper local _seen = {} local _focused = nil local _lastBox = nil local _autoAccept = savedConfig.autoSubmit local _submitAfter = savedConfig.submitAfter local _capturedParts = {} local _lastWatchedBox = nil local _boxTextConn = nil local _boxAncestryConn = nil local _boxVisibilityConns = {} local _retypeInvalid = savedConfig.retypeInvalid local _lastNonBlankBoxText = "" local _pendingRejectedText = nil local _pendingRejectedBox = nil local _pendingRejectedUntil = 0 local _pendingRejectedToken = 0 local ACE_WORD_COUNT = 1 local getupvalues = (debug and debug.getupvalues) or getupvalues local getconns = getconnections or (debug and debug.getconnections) local setupv = (debug and debug.setupvalue) or setupvalue local setStatus, flashCode, appendToBox local rememberPendingSubmission, clearPendingSubmission, handleRedemptionFeedback local clearAceCapture local addHistoryEntry, markHistoryVerdict, renderHistoryPanel, toggleHistoryPanel, cycleCaseMode local _lastStatusMsg = nil -- ============ UTILS ============ local function isOurGui(instance) local p = instance for _ = 1, 10 do if not p then break end if p.Name == "AquaAutotyperUI" or p.Name == "AquaSplash" then return true end p = p.Parent end return false end local function isVisibleChain(inst) local current = inst while current do if current:IsA("GuiObject") and not current.Visible then return false end if current:IsA("ScreenGui") then return current.Enabled end current = current.Parent end return true end local function findAllTextBoxes(pg) local boxes = {} for _, gui in ipairs(pg:GetChildren()) do if gui:IsA("ScreenGui") and gui.Enabled and not isOurGui(gui) then for _, d in ipairs(gui:GetDescendants()) do if d:IsA("TextBox") and not isOurGui(d) then boxes[#boxes + 1] = d end end end end return boxes end local function findCodeButtons(pg) local btns = {} for _, gui in ipairs(pg:GetChildren()) do if gui:IsA("ScreenGui") and gui.Enabled and not isOurGui(gui) then for _, d in ipairs(gui:GetDescendants()) do if (d:IsA("TextButton") or d:IsA("ImageButton")) and not isOurGui(d) then local n = d.Name:lower() local pn = (d.Parent and d.Parent.Name or ""):lower() if (n:find("code") or n:find("redeem") or pn:find("code") or pn:find("redeem")) and isVisibleChain(d) then btns[#btns + 1] = d end end end end end return btns end local function aceCodeBox() local allBoxes = findAllTextBoxes(playerGui) for _, box in ipairs(allBoxes) do if isVisibleChain(box) then return box end end return nil end -- ============ REDEEM (exact copy from reference) ============ local function clickButton(btn) if not btn then return false end local methods = {} methods[#methods + 1] = function() btn.MouseButton1Click:Fire() end methods[#methods + 1] = function() btn.Activated:Fire() end if typeof(firesignal) == "function" then methods[#methods + 1] = function() firesignal(btn.MouseButton1Click) end methods[#methods + 1] = function() firesignal(btn.Activated) end end if typeof(getconns) == "function" then methods[#methods + 1] = function() local ok, cs = pcall(getconns, btn.MouseButton1Click) if ok and type(cs) == "table" then for _, c in ipairs(cs) do pcall(function() c:Fire() end) end end local ok2, cs2 = pcall(getconns, btn.Activated) if ok2 and type(cs2) == "table" then for _, c in ipairs(cs2) do pcall(function() c:Fire() end) end end end end if typeof(fireclick) == "function" then methods[#methods + 1] = function() fireclick(btn) end end local anyOk = false for _, fn in ipairs(methods) do local ok = pcall(fn) anyOk = anyOk or ok end return anyOk end local function fireBoxFocusLost(box) if not box then return false end local anyFired = false if typeof(firesignal) == "function" then local ok = pcall(firesignal, box.FocusLost, true) anyFired = anyFired or ok end if typeof(getconns) == "function" then local ok, cs = pcall(getconns, box.FocusLost) if ok and type(cs) == "table" then for _, c in ipairs(cs) do local fn pcall(function() fn = c.Function end) if fn and typeof(getupvalues) == "function" and typeof(setupv) == "function" then local uOk, ups = pcall(getupvalues, fn) if uOk and type(ups) == "table" then for i, v in pairs(ups) do if type(v) == "boolean" and v == true then pcall(setupv, fn, i, false) end end end end local fOk = pcall(function() if c.Enabled ~= false then c:Fire(true) end end) anyFired = anyFired or fOk end end end return anyFired end local function typeAndSubmitCode(code) local pg = playerGui if not pg then return false, "no PlayerGui" end local codesGui = pg:FindFirstChild("Codes") if codesGui then if codesGui:IsA("ScreenGui") then codesGui.Enabled = true end local codesFrame = codesGui:FindFirstChild("Codes") or codesGui if codesFrame then if codesFrame:IsA("GuiObject") then codesFrame.Visible = true end local cur = codesFrame while cur and cur ~= codesGui do if cur:IsA("GuiObject") then cur.Visible = true end cur = cur.Parent end local box = nil for _, d in ipairs(codesFrame:GetDescendants()) do if d:IsA("TextBox") and not isOurGui(d) then box = d break end end local submitBtn = nil for _, d in ipairs(codesFrame:GetDescendants()) do if (d:IsA("TextButton") or d:IsA("ImageButton")) and not isOurGui(d) then local n = d.Name:lower() local txt = "" pcall(function() txt = d.Text:lower() end) if n:find("submit") or txt:find("submit") or n:find("redeem") or txt:find("redeem") or n:find("claim") or txt:find("confirm") or n:find("enter") then submitBtn = d break end end end if not submitBtn then for _, d in ipairs(codesFrame:GetDescendants()) do if (d:IsA("TextButton") or d:IsA("ImageButton")) and not isOurGui(d) then local n = d.Name:lower() if not n:find("close") and not n:find("x") and not n:find("toggle") then submitBtn = d break end end end end if box then pcall(function() box.Text = code end) task.wait(0.05) if submitBtn then clickButton(submitBtn) end fireBoxFocusLost(box) return true, "submitted via PlayerGui.Codes" end end end local btns = findCodeButtons(pg) for _, btn in ipairs(btns) do clickButton(btn) task.wait(0.05) end task.wait(0.2) local box = nil local deadline = tick() + 2 while tick() < deadline do local allBoxes = findAllTextBoxes(pg) for _, d in ipairs(allBoxes) do if isVisibleChain(d) then local n = d.Name:lower() local pn = (d.Parent and d.Parent.Name or ""):lower() if n:find("code") or pn:find("code") or n:find("redeem") or pn:find("redeem") or n:find("input") or pn:find("textbox") or n:find("enter") then box = d break end end end if not box then for _, d in ipairs(allBoxes) do if isVisibleChain(d) then box = d break end end end if box then break end task.wait(0.1) end if not box then return false, "no codebox visible" end pcall(function() box.Text = code end) task.wait(0.05) local redeemBtn = nil local searchNames = {"submit","redeem","claim","confirm","enter","send","apply","ok","use","go","check"} local p = box.Parent for _ = 1, 8 do if not p then break end for _, d in ipairs(p:GetDescendants()) do if (d:IsA("TextButton") or d:IsA("ImageButton")) and not isOurGui(d) and d ~= box then local n = d.Name:lower() local txt = "" pcall(function() txt = d.Text:lower() end) for _, sn in ipairs(searchNames) do if n:find(sn) or txt:find(sn) then if isVisibleChain(d) then redeemBtn = d break end end end if redeemBtn then break end end end if redeemBtn then break end p = p.Parent end if redeemBtn then clickButton(redeemBtn) end fireBoxFocusLost(box) return true, "submitted via dynamic search" end -- ============ UI (v3: gradients + anims) ============ local COLORS = { Window = Color3.fromRGB(6, 12, 14), Row = Color3.fromRGB(10, 20, 24), Control = Color3.fromRGB(24, 40, 46), Log = Color3.fromRGB(4, 9, 11), Border = Color3.fromRGB(34, 211, 238), White = Color3.fromRGB(240, 250, 252), Text = Color3.fromRGB(170, 220, 230), Dim = Color3.fromRGB(120, 180, 195), Accent = Color3.fromRGB(34, 211, 238), Green = Color3.fromRGB(110, 220, 170), Red = Color3.fromRGB(240, 120, 120), Amber = Color3.fromRGB(250, 200, 120), } local function addCorner(parent, radius) local value = Instance.new("UICorner") value.CornerRadius = UDim.new(0, radius) value.Parent = parent return value end local function addStroke(parent, color, thickness, transparency) local value = Instance.new("UIStroke") value.ApplyStrokeMode = Enum.ApplyStrokeMode.Border value.Color = color value.Thickness = thickness or 1 value.Transparency = transparency or 0 value.Parent = parent return value end local function makeLabel(parent, name, text, size, position, textSize, color, font) local label = Instance.new("TextLabel") label.Name = name label.Size = size label.Position = position label.BackgroundTransparency = 1 label.Text = text label.TextSize = textSize label.TextColor3 = color label.Font = font or Enum.Font.GothamMedium label.TextXAlignment = Enum.TextXAlignment.Left label.TextYAlignment = Enum.TextYAlignment.Center label.Parent = parent return label end -- ============ UI FX HELPERS ============ local function addGradient(frame, top, bottom, rotation) local g = Instance.new("UIGradient", frame) g.Color = ColorSequence.new(top, bottom) g.Rotation = rotation or 90 return g end local function tweenProp(obj, time, easing, props) if not obj then return nil end local t = TweenService:Create(obj, TweenInfo.new(time, easing or Enum.EasingStyle.Quad, Enum.EasingDirection.Out), props) t:Play() return t end local function styleButton(btn) local base = btn.BackgroundColor3 btn.MouseEnter:Connect(function() tweenProp(btn, 0.12, Enum.EasingStyle.Quad, {BackgroundColor3 = base:Lerp(Color3.fromRGB(255, 255, 255), 0.12)}) end) btn.MouseLeave:Connect(function() tweenProp(btn, 0.12, Enum.EasingStyle.Quad, {BackgroundColor3 = base}) end) return btn end local GUI = Instance.new("ScreenGui") GUI.Name = "AquaAutotyperUI" GUI.ResetOnSpawn = false GUI.IgnoreGuiInset = true GUI.DisplayOrder = 999 if not pcall(function() GUI.Parent = CoreGui end) then GUI.Parent = playerGui end local Window = Instance.new("Frame") Window.Name = "Window" Window.Size = UDim2.fromOffset(310, 370) Window.AnchorPoint = Vector2.new(1, 0) Window.Position = UDim2.new(1, -8, 0, 24) Window.BackgroundColor3 = COLORS.Window Window.BorderSizePixel = 0 Window.ClipsDescendants = true Window.Parent = GUI addCorner(Window, 14) addStroke(Window, COLORS.Border, 2, 0.25) addGradient(Window, Color3.fromRGB(16, 30, 36), Color3.fromRGB(4, 8, 10), 90) local InterfaceScale = Instance.new("UIScale") InterfaceScale.Scale = 0.88 InterfaceScale.Parent = Window -- entrance animation tweenProp(Window, 0.4, Enum.EasingStyle.Quad, {Position = UDim2.new(1, -8, 0, 8)}) tweenProp(InterfaceScale, 0.4, Enum.EasingStyle.Quad, {Scale = 0.92}) local viewportConnection local function updateInterfaceScale() local camera = workspace.CurrentCamera if not camera then InterfaceScale.Scale = 0.92 return end local viewport = camera.ViewportSize local fitScale = math.min((viewport.X - 16) / 310, (viewport.Y - 16) / 370) if UserInputService.TouchEnabled then InterfaceScale.Scale = math.max(0.45, math.min(0.72, fitScale)) else InterfaceScale.Scale = 0.92 end end local function watchViewport() if viewportConnection then viewportConnection:Disconnect() viewportConnection = nil end local camera = workspace.CurrentCamera if camera then viewportConnection = camera:GetPropertyChangedSignal("ViewportSize"):Connect(updateInterfaceScale) end updateInterfaceScale() end workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(watchViewport) watchViewport() local BackgroundImage = Instance.new("ImageLabel") BackgroundImage.Name = "AquaBackground" BackgroundImage.Size = UDim2.new(1, 0, 1, 0) BackgroundImage.BackgroundTransparency = 1 BackgroundImage.Image = "rbxassetid://137692455767789" BackgroundImage.ScaleType = Enum.ScaleType.Stretch BackgroundImage.ImageColor3 = Color3.fromRGB(34, 211, 238) BackgroundImage.ImageTransparency = 0.32 BackgroundImage.ZIndex = 1 BackgroundImage.Parent = Window addCorner(BackgroundImage, 14) local Header = Instance.new("Frame") Header.Name = "Header" Header.Size = UDim2.new(1, 0, 0, 64) Header.BackgroundTransparency = 1 Header.Active = true Header.ZIndex = 3 Header.Parent = Window local Console, ConsoleOutput, updateConsoleCanvas local featureStates = {} local CONSOLE_COLORS = { Dim = "rgb(120,180,195)", Amber = "rgb(250,200,120)", Green = "rgb(110,220,170)", Red = "rgb(240,120,120)", Cyan = "rgb(120,220,255)", } local function scrollConsoleToBottom() task.defer(function() task.wait() if not Console then return end if updateConsoleCanvas then updateConsoleCanvas() end local bottom = math.max(0, Console.AbsoluteCanvasSize.Y - Console.AbsoluteWindowSize.Y) Console.CanvasPosition = Vector2.new(0, bottom) end) end local function appendConsoleStatus(name, activated) if not ConsoleOutput then return end local state = activated and "ON" or "OFF" local stateColor = activated and CONSOLE_COLORS.Green or CONSOLE_COLORS.Red local line = '[setting] ' .. '' .. name .. " " .. '-> ' .. '' .. state .. "" if ConsoleOutput.Text == "" then ConsoleOutput.Text = line else ConsoleOutput.Text = ConsoleOutput.Text .. "\n\n" .. line end scrollConsoleToBottom() end makeLabel(Header, "Title", "AQUA", UDim2.fromOffset(180, 22), UDim2.fromOffset(17, 14), 17, COLORS.White, Enum.Font.GothamBold) makeLabel(Header, "Subtitle", "AUTOTYPER", UDim2.fromOffset(180, 14), UDim2.fromOffset(17, 36), 10, COLORS.Accent, Enum.Font.GothamBold) -- main toggle knob local AutoWriteButton = Instance.new("TextButton") AutoWriteButton.Name = "AutoWrite" AutoWriteButton.Size = UDim2.fromOffset(47, 24) AutoWriteButton.Position = UDim2.new(1, -64, 0, 18) AutoWriteButton.BackgroundColor3 = COLORS.Accent AutoWriteButton.BorderSizePixel = 0 AutoWriteButton.AutoButtonColor = false AutoWriteButton.Active = true AutoWriteButton.Text = "" AutoWriteButton.ZIndex = 5 AutoWriteButton.Parent = Header addCorner(AutoWriteButton, 12) local AutoWriteStroke = addStroke(AutoWriteButton, COLORS.Border, 1, 0.25) local AutoWriteKnob = Instance.new("Frame") AutoWriteKnob.Name = "Knob" AutoWriteKnob.Size = UDim2.fromOffset(20, 20) AutoWriteKnob.Position = UDim2.new(1, -22, 0.5, -10) AutoWriteKnob.BackgroundColor3 = COLORS.Window AutoWriteKnob.BorderSizePixel = 0 AutoWriteKnob.ZIndex = 6 AutoWriteKnob.Parent = AutoWriteButton addCorner(AutoWriteKnob, 10) local autoWriteEnabled = _enabled _enabled = autoWriteEnabled AutoWriteButton.BackgroundColor3 = autoWriteEnabled and COLORS.Accent or COLORS.Control AutoWriteStroke.Transparency = autoWriteEnabled and 0.25 or 0.6 AutoWriteKnob.Position = autoWriteEnabled and UDim2.new(1, -22, 0.5, -10) or UDim2.new(0, 2, 0.5, -10) local lastToggleTime = 0 local function toggleAutoWrite() if tick() - lastToggleTime < 0.15 then return end lastToggleTime = tick() autoWriteEnabled = not autoWriteEnabled _enabled = autoWriteEnabled if not autoWriteEnabled and clearAceCapture then clearAceCapture() end savedConfig.codeSniper = autoWriteEnabled saveConfig() _lastStatusMsg = nil tweenProp(AutoWriteButton, 0.15, Enum.EasingStyle.Quad, {BackgroundColor3 = autoWriteEnabled and COLORS.Accent or COLORS.Control}) tweenProp(AutoWriteStroke, 0.15, Enum.EasingStyle.Quad, {Transparency = autoWriteEnabled and 0.25 or 0.6}) tweenProp(AutoWriteKnob, 0.15, Enum.EasingStyle.Quad, {Position = autoWriteEnabled and UDim2.new(1, -22, 0.5, -10) or UDim2.new(0, 2, 0.5, -10)}) if ConsoleOutput then if autoWriteEnabled then ConsoleOutput.Text = '> scanning for codes...' for _, featureName in ipairs({"Auto submit", "Retype invalid"}) do if featureStates[featureName] then appendConsoleStatus(featureName, true) end end else ConsoleOutput.Text = 'status: OFF\ncode sniper paused' end scrollConsoleToBottom() end end AutoWriteButton.Activated:Connect(toggleAutoWrite) AutoWriteButton.MouseButton1Click:Connect(toggleAutoWrite) AutoWriteButton.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then toggleAutoWrite() end end) local HeaderAccent = Instance.new("Frame") HeaderAccent.Name = "TitleDivider" HeaderAccent.Size = UDim2.new(1, -34, 0, 1) HeaderAccent.Position = UDim2.fromOffset(17, 54) HeaderAccent.BackgroundColor3 = COLORS.Border HeaderAccent.BackgroundTransparency = 0.4 HeaderAccent.BorderSizePixel = 0 HeaderAccent.Parent = Header local Settings = Instance.new("Frame") Settings.Name = "Settings" Settings.Size = UDim2.new(1, 0, 0, 154) Settings.Position = UDim2.fromOffset(0, 65) Settings.BackgroundTransparency = 1 Settings.ZIndex = 3 Settings.Parent = Window local function makeCard(name, position, size) local card = Instance.new("Frame") card.Name = name card.Position = position card.Size = size card.BackgroundColor3 = COLORS.Row card.BackgroundTransparency = 0.45 card.BorderSizePixel = 0 card.Parent = Settings addCorner(card, 9) addStroke(card, COLORS.Border, 1, 0.45) addGradient(card, COLORS.Row:Lerp(Color3.fromRGB(255, 255, 255), 0.08), COLORS.Row, 90) return card end local function makeStateButton(parent, enabled, consoleName, onToggle) parent.Active = true featureStates[consoleName] = enabled local button = Instance.new("TextButton") button.Name = "State" button.Size = UDim2.fromOffset(42, 20) button.Position = UDim2.new(1, -50, 0.5, -10) button.BackgroundColor3 = enabled and COLORS.Accent or Color3.fromRGB(18, 34, 40) button.BorderSizePixel = 0 button.AutoButtonColor = false button.Active = true button.Text = enabled and "ON" or "OFF" button.TextSize = 8 button.TextColor3 = enabled and COLORS.Window or Color3.fromRGB(140, 190, 200) button.Font = Enum.Font.GothamBold button.ZIndex = 5 button.Parent = parent addCorner(button, 6) local outline = addStroke(button, COLORS.Border, 1, enabled and 0.25 or 0.55) local state = enabled local lastSubToggle = 0 local function toggleState() if tick() - lastSubToggle < 0.15 then return end lastSubToggle = tick() state = not state featureStates[consoleName] = state button.Text = state and "ON" or "OFF" tweenProp(button, 0.12, Enum.EasingStyle.Quad, {BackgroundColor3 = state and COLORS.Accent or Color3.fromRGB(18, 34, 40)}) tweenProp(outline, 0.12, Enum.EasingStyle.Quad, {Transparency = state and 0.25 or 0.55}) if autoWriteEnabled then appendConsoleStatus(consoleName, state) end if onToggle then onToggle(state) end end button.Activated:Connect(toggleState) button.MouseButton1Click:Connect(toggleState) button.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.Touch or input.UserInputType == Enum.UserInputType.MouseButton1 then toggleState() end end) styleButton(button) return button end local AutoCard = makeCard("AutoSubmit", UDim2.fromOffset(17, 0), UDim2.fromOffset(276, 50)) makeLabel(AutoCard, "Title", "Auto submit", UDim2.new(1, -58, 1, 0), UDim2.fromOffset(12, 0), 11, COLORS.White, Enum.Font.GothamMedium) makeStateButton(AutoCard, _autoAccept, "Auto submit", function(state) _autoAccept = state savedConfig.autoSubmit = state saveConfig() end) local DelayCard = makeCard("SubmitAfter", UDim2.fromOffset(17, 57), UDim2.fromOffset(276, 43)) makeLabel(DelayCard, "Title", "Solve after msgs", UDim2.fromOffset(145, 43), UDim2.fromOffset(12, 0), 11, COLORS.White, Enum.Font.GothamMedium) local CounterShell = Instance.new("Frame") CounterShell.Name = "Counter" CounterShell.Size = UDim2.fromOffset(96, 31) CounterShell.Position = UDim2.new(1, -105, 0.5, -15) CounterShell.BackgroundColor3 = COLORS.Window CounterShell.BackgroundTransparency = 0.05 CounterShell.BorderSizePixel = 0 CounterShell.Parent = DelayCard addCorner(CounterShell, 7) addStroke(CounterShell, COLORS.Border, 1, 0.5) local Minus = Instance.new("TextButton") Minus.Name = "Minus" Minus.Size = UDim2.fromOffset(25, 25) Minus.Position = UDim2.fromOffset(3, 3) Minus.BackgroundColor3 = COLORS.Control Minus.BorderSizePixel = 0 Minus.AutoButtonColor = false Minus.Active = true Minus.Text = "-" Minus.TextSize = 16 Minus.TextColor3 = COLORS.Text Minus.Font = Enum.Font.GothamBold Minus.Parent = CounterShell addCorner(Minus, 5) local Count = makeLabel(CounterShell, "Count", tostring(_submitAfter), UDim2.fromOffset(28, 25), UDim2.fromOffset(34, 3), 17, COLORS.White, Enum.Font.GothamBold) Count.TextXAlignment = Enum.TextXAlignment.Center local Plus = Instance.new("TextButton") Plus.Name = "Plus" Plus.Size = UDim2.fromOffset(25, 25) Plus.Position = UDim2.fromOffset(68, 3) Plus.BackgroundColor3 = COLORS.Control Plus.BorderSizePixel = 0 Plus.AutoButtonColor = false Plus.Active = true Plus.Text = "+" Plus.TextSize = 16 Plus.TextColor3 = COLORS.Text Plus.Font = Enum.Font.GothamBold Plus.Parent = CounterShell addCorner(Plus, 5) local function decr() _submitAfter = math.max(1, _submitAfter - 1) Count.Text = tostring(_submitAfter) savedConfig.submitAfter = _submitAfter clearAceCapture() saveConfig() end local function incr() _submitAfter = math.min(5, _submitAfter + 1) Count.Text = tostring(_submitAfter) savedConfig.submitAfter = _submitAfter clearAceCapture() saveConfig() end Minus.Activated:Connect(decr) Minus.MouseButton1Click:Connect(decr) Plus.Activated:Connect(incr) Plus.MouseButton1Click:Connect(incr) styleButton(Minus) styleButton(Plus) local RetypeCard = makeCard("RetypeInvalid", UDim2.fromOffset(17, 103), UDim2.fromOffset(276, 38)) makeLabel(RetypeCard, "Title", "Retype invalid", UDim2.new(1, -65, 1, 0), UDim2.fromOffset(12, 0), 11, COLORS.White, Enum.Font.GothamMedium) local RetypeState = makeStateButton(RetypeCard, _retypeInvalid, "Retype invalid", function(state) _retypeInvalid = state savedConfig.retypeInvalid = state saveConfig() end) RetypeState.Position = UDim2.new(1, -50, 0.5, -10) Console = Instance.new("ScrollingFrame") Console.Name = "Console" Console.Size = UDim2.new(1, -34, 0, 127) Console.Position = UDim2.fromOffset(17, 216) Console.BackgroundColor3 = COLORS.Log Console.BorderSizePixel = 0 Console.ClipsDescendants = true Console.Active = true Console.ScrollingEnabled = true Console.ScrollingDirection = Enum.ScrollingDirection.Y Console.ElasticBehavior = Enum.ElasticBehavior.WhenScrollable Console.VerticalScrollBarInset = Enum.ScrollBarInset.ScrollBar Console.CanvasSize = UDim2.new(0, 0, 0, 0) Console.AutomaticCanvasSize = Enum.AutomaticSize.None Console.ScrollBarThickness = 4 Console.ScrollBarImageColor3 = COLORS.Dim Console.ZIndex = 3 Console.Parent = Window addCorner(Console, 9) addStroke(Console, COLORS.Border, 1, 0.5) addGradient(Console, Color3.fromRGB(10, 20, 24), Color3.fromRGB(3, 6, 8), 90) ConsoleOutput = Instance.new("TextLabel") ConsoleOutput.Name = "ConsoleOutput" ConsoleOutput.Size = UDim2.new(1, -18, 0, 115) ConsoleOutput.AutomaticSize = Enum.AutomaticSize.Y ConsoleOutput.Position = UDim2.fromOffset(9, 6) ConsoleOutput.BackgroundTransparency = 1 ConsoleOutput.RichText = true if autoWriteEnabled then ConsoleOutput.Text = '> scanning for codes...' else ConsoleOutput.Text = 'status: OFF\ncode sniper paused' end ConsoleOutput.TextSize = 14 ConsoleOutput.Font = Enum.Font.Code ConsoleOutput.TextColor3 = COLORS.Dim ConsoleOutput.TextXAlignment = Enum.TextXAlignment.Left ConsoleOutput.TextYAlignment = Enum.TextYAlignment.Top ConsoleOutput.TextWrapped = true ConsoleOutput.ZIndex = 4 ConsoleOutput.Parent = Console local CONSOLE_BOTTOM_PADDING = 30 updateConsoleCanvas = function() if not Console or not ConsoleOutput then return end local contentHeight = ConsoleOutput.Position.Y.Offset + ConsoleOutput.AbsoluteSize.Y + CONSOLE_BOTTOM_PADDING Console.CanvasSize = UDim2.new(0, 0, 0, contentHeight) end ConsoleOutput:GetPropertyChangedSignal("AbsoluteSize"):Connect(updateConsoleCanvas) task.defer(updateConsoleCanvas) -- drag system (touch + mouse) — skips ANY header button do local dragging = false local activeDragInput local dragStart local startPosition local dragMoved = false local DRAG_THRESHOLD = UserInputService.TouchEnabled and 10 or 3 local function isOverHeaderControl(position) for _, btn in ipairs(Header:GetDescendants()) do if btn:IsA("TextButton") then local btnPos = btn.AbsolutePosition local btnSize = btn.AbsoluteSize if position.X >= (btnPos.X - 10) and position.X <= (btnPos.X + btnSize.X + 10) and position.Y >= (btnPos.Y - 10) and position.Y <= (btnPos.Y + btnSize.Y + 10) then return true end end end return false end local function stopDragging(input) if input ~= activeDragInput then return end dragging = false activeDragInput = nil dragStart = nil startPosition = nil end Header.InputBegan:Connect(function(input) if input.UserInputType ~= Enum.UserInputType.MouseButton1 and input.UserInputType ~= Enum.UserInputType.Touch then return end if dragging or isOverHeaderControl(input.Position) then return end dragging = true activeDragInput = input dragStart = Vector2.new(input.Position.X, input.Position.Y) startPosition = Window.Position dragMoved = false input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End or input.UserInputState == Enum.UserInputState.Cancel then stopDragging(input) end end) end) UserInputService.InputChanged:Connect(function(input) if not dragging or not activeDragInput then return end local isTrackedTouch = activeDragInput.UserInputType == Enum.UserInputType.Touch and input == activeDragInput local isTrackedMouse = activeDragInput.UserInputType == Enum.UserInputType.MouseButton1 and input.UserInputType == Enum.UserInputType.MouseMovement if not isTrackedTouch and not isTrackedMouse then return end local current = Vector2.new(input.Position.X, input.Position.Y) local delta = current - dragStart if not dragMoved then if delta.Magnitude < DRAG_THRESHOLD then return end dragMoved = true end Window.Position = UDim2.new( startPosition.X.Scale, startPosition.X.Offset + delta.X, startPosition.Y.Scale, startPosition.Y.Offset + delta.Y ) end) end -- ============ HISTORY DRAWER + KEYBINDS + CASE MODE ============ local ACE_CASE_MODE = (savedConfig.caseMode == "UPPER" or savedConfig.caseMode == "LOWER" or savedConfig.caseMode == "EXACT") and savedConfig.caseMode or "EXACT" local HISTORY_FILE = "aqua_history.json" local historyEntries = {} pcall(function() if type(isfile) == "function" and type(readfile) == "function" and isfile(HISTORY_FILE) then local decoded = HttpService:JSONDecode(readfile(HISTORY_FILE)) if type(decoded) == "table" then historyEntries = decoded end end end) local historyPanel, historyList, historyRowsLayout local function saveHistory() if type(writefile) ~= "function" then return end pcall(function() writefile(HISTORY_FILE, HttpService:JSONEncode(historyEntries)) end) end local function verdictColor(verdict) if verdict == "invalid" then return COLORS.Amber end if verdict == "failed" then return COLORS.Red end if verdict == "success" then return COLORS.Green end if verdict == "riddle" then return Color3.fromRGB(168, 85, 247) end return COLORS.Dim end addHistoryEntry = function(code, verdict, meta) if not code or code == "" then return end table.insert(historyEntries, 1, { code = code, time = os.time(), verdict = verdict or "submitted", meta = meta or "", }) if #historyEntries > 200 then local trimmed = {} for i = 1, 200 do trimmed[i] = historyEntries[i] end historyEntries = trimmed end saveHistory() if historyPanel and historyPanel.Visible then renderHistoryPanel() end end markHistoryVerdict = function(code, verdict) for i = 1, math.min(#historyEntries, 30) do if historyEntries[i].code == code then historyEntries[i].verdict = verdict break end end saveHistory() if historyPanel and historyPanel.Visible then renderHistoryPanel() end end -- history drawer (same texture as main window + gradient) historyPanel = Instance.new("Frame") historyPanel.Name = "HistoryPanel" historyPanel.AnchorPoint = Vector2.new(1, 0) historyPanel.Position = UDim2.new(1, -326, 0, 8) historyPanel.Size = UDim2.new(0, 260, 0, 370) historyPanel.BackgroundColor3 = COLORS.Window historyPanel.BorderSizePixel = 0 historyPanel.ClipsDescendants = true historyPanel.Parent = GUI addCorner(historyPanel, 12) addStroke(historyPanel, COLORS.Border, 1.2, 0.3) addGradient(historyPanel, Color3.fromRGB(16, 30, 36), Color3.fromRGB(4, 8, 10), 90) local historyBG = Instance.new("ImageLabel") historyBG.Name = "HistoryBG" historyBG.Size = UDim2.new(1, 0, 1, 0) historyBG.BackgroundTransparency = 1 historyBG.Image = "rbxassetid://137692455767789" historyBG.ScaleType = Enum.ScaleType.Stretch historyBG.ImageColor3 = Color3.fromRGB(34, 211, 238) historyBG.ImageTransparency = 0.32 historyBG.ZIndex = 1 historyBG.Parent = historyPanel addCorner(historyBG, 12) local historyTitle = makeLabel(historyPanel, "HistoryTitle", "CODE HISTORY", UDim2.new(1, -70, 0, 20), UDim2.fromOffset(14, 10), 11, COLORS.White, Enum.Font.GothamBold) historyTitle.ZIndex = 2 local clearHistoryBtn = Instance.new("TextButton") clearHistoryBtn.Name = "ClearHistory" clearHistoryBtn.Size = UDim2.fromOffset(46, 20) clearHistoryBtn.Position = UDim2.new(1, -58, 0, 10) clearHistoryBtn.BackgroundColor3 = COLORS.Control clearHistoryBtn.Text = "CLEAR" clearHistoryBtn.TextSize = 8 clearHistoryBtn.TextColor3 = COLORS.Red clearHistoryBtn.Font = Enum.Font.GothamBold clearHistoryBtn.AutoButtonColor = false clearHistoryBtn.ZIndex = 3 clearHistoryBtn.Parent = historyPanel addCorner(clearHistoryBtn, 5) styleButton(clearHistoryBtn) clearHistoryBtn.MouseButton1Click:Connect(function() historyEntries = {} saveHistory() renderHistoryPanel() end) local historyDivider = Instance.new("Frame") historyDivider.Size = UDim2.new(1, -28, 0, 1) historyDivider.Position = UDim2.fromOffset(14, 36) historyDivider.BackgroundColor3 = COLORS.Border historyDivider.BackgroundTransparency = 0.4 historyDivider.BorderSizePixel = 0 historyDivider.ZIndex = 2 historyDivider.Parent = historyPanel historyList = Instance.new("ScrollingFrame") historyList.Name = "HistoryList" historyList.Size = UDim2.new(1, -16, 1, -48) historyList.Position = UDim2.fromOffset(8, 42) historyList.BackgroundTransparency = 1 historyList.ScrollingEnabled = true historyList.ScrollingDirection = Enum.ScrollingDirection.Y historyList.CanvasSize = UDim2.new(0, 0, 0, 0) historyList.ScrollBarThickness = 3 historyList.ScrollBarImageColor3 = COLORS.Border historyList.ZIndex = 2 historyList.Parent = historyPanel historyRowsLayout = Instance.new("UIListLayout", historyList) historyRowsLayout.Padding = UDim.new(0, 5) historyRowsLayout.SortOrder = Enum.SortOrder.LayoutOrder historyRowsLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() historyList.CanvasSize = UDim2.new(0, 0, 0, historyRowsLayout.AbsoluteContentSize.Y) end) renderHistoryPanel = function() if not historyList then return end for _, child in ipairs(historyList:GetChildren()) do if child:IsA("Frame") then child:Destroy() end end for i, entry in ipairs(historyEntries) do if i > 100 then break end local row = Instance.new("Frame") row.Size = UDim2.new(1, -4, 0, 26) row.BackgroundColor3 = COLORS.Row row.BackgroundTransparency = 0.4 row.Parent = historyList addCorner(row, 5) local codeLabel = Instance.new("TextLabel") codeLabel.Size = UDim2.new(1, -74, 1, 0) codeLabel.Position = UDim2.fromOffset(8, 0) codeLabel.BackgroundTransparency = 1 codeLabel.Text = entry.code or "?" codeLabel.TextColor3 = COLORS.White codeLabel.Font = Enum.Font.Code codeLabel.TextSize = 11 codeLabel.TextXAlignment = Enum.TextXAlignment.Left codeLabel.Parent = row local timeLabel = Instance.new("TextLabel") timeLabel.Size = UDim2.new(0, 40, 1, 0) timeLabel.Position = UDim2.new(1, -52, 0, 0) timeLabel.BackgroundTransparency = 1 timeLabel.Text = os.date("%H:%M", entry.time or 0) timeLabel.TextColor3 = COLORS.Dim timeLabel.Font = Enum.Font.Code timeLabel.TextSize = 9 timeLabel.TextXAlignment = Enum.TextXAlignment.Right timeLabel.Parent = row local verdictLabel = Instance.new("TextLabel") verdictLabel.Size = UDim2.new(0, 42, 1, 0) verdictLabel.Position = UDim2.new(1, -96, 0, 0) verdictLabel.BackgroundTransparency = 1 verdictLabel.Text = (entry.verdict or "submitted"):upper() verdictLabel.TextColor3 = verdictColor(entry.verdict) verdictLabel.Font = Enum.Font.GothamBold verdictLabel.TextSize = 8 verdictLabel.TextXAlignment = Enum.TextXAlignment.Right verdictLabel.Parent = row end end -- header buttons: HISTORY + CASE (styled) local histButton = Instance.new("TextButton") histButton.Name = "HistoryToggle" histButton.Size = UDim2.fromOffset(47, 24) histButton.Position = UDim2.new(1, -116, 0, 18) histButton.BackgroundColor3 = COLORS.Control histButton.Text = "HIST" histButton.TextSize = 9 histButton.TextColor3 = COLORS.Text histButton.Font = Enum.Font.GothamBold histButton.AutoButtonColor = false histButton.Parent = Header addCorner(histButton, 12) addStroke(histButton, COLORS.Border, 1, 0.4) styleButton(histButton) local caseButton = Instance.new("TextButton") caseButton.Name = "CaseToggle" caseButton.Size = UDim2.fromOffset(52, 24) caseButton.Position = UDim2.new(1, -172, 0, 18) caseButton.BackgroundColor3 = COLORS.Control caseButton.Text = ACE_CASE_MODE caseButton.TextSize = 9 caseButton.TextColor3 = COLORS.Text caseButton.Font = Enum.Font.GothamBold caseButton.AutoButtonColor = false caseButton.Parent = Header addCorner(caseButton, 12) addStroke(caseButton, COLORS.Border, 1, 0.4) styleButton(caseButton) -- sliding history drawer local drawerOpen = true toggleHistoryPanel = function() if not historyPanel then return end drawerOpen = not drawerOpen if drawerOpen then historyPanel.Visible = true historyPanel.Position = UDim2.new(1, -606, 0, 8) tweenProp(historyPanel, 0.24, Enum.EasingStyle.Quad, {Position = UDim2.new(1, -326, 0, 8)}) renderHistoryPanel() else local t = tweenProp(historyPanel, 0.24, Enum.EasingStyle.Quad, {Position = UDim2.new(1, -606, 0, 8)}) t.Completed:Connect(function() if not drawerOpen then historyPanel.Visible = false end end) end end cycleCaseMode = function() if ACE_CASE_MODE == "EXACT" then ACE_CASE_MODE = "UPPER" elseif ACE_CASE_MODE == "UPPER" then ACE_CASE_MODE = "LOWER" else ACE_CASE_MODE = "EXACT" end savedConfig.caseMode = ACE_CASE_MODE saveConfig() if caseButton then caseButton.Text = ACE_CASE_MODE end if ConsoleOutput and _enabled then ConsoleOutput.Text = ConsoleOutput.Text .. '\n\ncase mode: ' .. ACE_CASE_MODE .. "" scrollConsoleToBottom() end end histButton.MouseButton1Click:Connect(toggleHistoryPanel) caseButton.MouseButton1Click:Connect(cycleCaseMode) -- keybinds UserInputService.InputBegan:Connect(function(input) if input.UserInputType ~= Enum.UserInputType.Keyboard then return end if UserInputService:GetFocusedTextBox() then return end local kc = input.KeyCode if kc == Enum.KeyCode.RightShift then toggleAutoWrite() elseif kc == Enum.KeyCode.RightAlt then toggleHistoryPanel() elseif kc == Enum.KeyCode.X then cycleCaseMode() end end) renderHistoryPanel() -- ============ RIDDLE SOLVER (v4.1) ============ -- FEED ME DATA: add/change facts below. Order matters — most specific -- patterns FIRST. Every riddle scans top-to-bottom. local RIDDLE_KNOWLEDGE = { { id = "gym", value = "GYM", patterns = {"where i go", "goes to the gym", "go to the gym", "workout", "gym", "lift weights", "trains"} }, { id = "age", value = "24", patterns = {"how old", "age", "years old"} }, { id = "birthmo", value = "FEBRUARY", patterns = {"month of birth", "birthday month", "birth month", "born in which month", "birthday in"} }, { id = "brainrot", value = "MEOWL", patterns = {"favorite brainrot", "favourite brainrot", "best brainrot", "top brainrot"} }, { id = "city", value = "CHICAGO", patterns = {"where he lives", "where he live", "where does he live", "lives in", "city"} }, { id = "weight", value = "250", patterns = {"how much does he weigh", "he weigh", "weighs", "weight"} }, } -- optional: drop a file named aqua_riddles.json next to the script with -- the same structure to add extra facts without editing the script pcall(function() if type(isfile) == "function" and type(readfile) == "function" and isfile("aqua_riddles.json") then local extra = HttpService:JSONDecode(readfile("aqua_riddles.json")) if type(extra) == "table" then for _, fact in ipairs(extra) do if type(fact) == "table" and type(fact.value) == "string" and type(fact.patterns) == "table" then RIDDLE_KNOWLEDGE[#RIDDLE_KNOWLEDGE + 1] = fact end end end end end) local PURPLE = Color3.fromRGB(168, 85, 247) local riddleEnabled = true local function solveRiddle(raw) local text = tostring(raw or ""):lower() text = text:gsub("<[^>]+>", "") -- 1) repeat count: "3 times", "twice", "3x"/"x3" local multiplier = 1 local mult = text:match("(%d+)%s*times?") if mult then multiplier = tonumber(mult) or 1 text = text:gsub("%s*%d+%s*times?%s*", " ") else local x = text:match("(%d+)%s*x") or text:match("x%s*(%d+)") if x then multiplier = tonumber(x) or 1 text = text:gsub("%s*%d+%s*x%s*", " "):gsub("%s*x%s*%d+%s*", " ") elseif text:find("twice") then multiplier = 2 text = text:gsub("twice", " ") end end -- 2) match facts FIRST (so "and " clauses compose instead of becoming suffixes) local hits = {} for _, fact in ipairs(RIDDLE_KNOWLEDGE) do for _, pat in ipairs(fact.patterns) do local pos = string.find(text, pat, 1, true) if pos then table.insert(hits, { pos = pos, value = fact.value }) break end end end if #hits == 0 then return nil end table.sort(hits, function(a, b) return a.pos < b.pos end) -- 3) trailing suffix — ONLY when exactly one fact matched: -- whatever follows "and" becomes the suffix (word OR number), -- uppercased to match the stored values local trailing = "" if #hits == 1 then local suffix = text:match("and%s+(.+)$") if suffix then trailing = suffix:gsub("[^%w]", ""):upper():sub(1, 24) elseif multiplier > 1 then local endNum = text:match("(%d+)$") if endNum then trailing = endNum end end end local values = {} for _, h in ipairs(hits) do values[#values + 1] = h.value end if #values == 1 and multiplier > 1 then values[1] = values[1]:rep(math.min(multiplier, 9)) end return table.concat(values) .. trailing end local function submitRiddleAnswer(answer) if not answer or answer == "" then return end if ACE_CASE_MODE == "UPPER" then answer = answer:upper() elseif ACE_CASE_MODE == "LOWER" then answer = answer:lower() end local box = aceCodeBox() if box then _lastBox = box watchBoxForBlankReset(box) pcall(function() box.Text = answer end) end setStatus("Riddle solved: " .. answer, PURPLE) flashCode(answer, PURPLE) addHistoryEntry(answer, "riddle") if _autoAccept then rememberPendingSubmission(box, answer, true) local ok, statusMsg = typeAndSubmitCode(answer) if ok then setStatus("Redeemed riddle: " .. answer, COLORS.Green) else markHistoryVerdict(answer, "failed") setStatus("Riddle failed: " .. tostring(statusMsg), COLORS.Red) end end end -- RIDDLE toggle button (purple when on, sits left of CASE) local riddleButton = Instance.new("TextButton") riddleButton.Name = "RiddleToggle" riddleButton.Size = UDim2.fromOffset(50, 24) riddleButton.Position = UDim2.new(1, -228, 0, 18) riddleButton.BackgroundColor3 = PURPLE riddleButton.Text = "RIDDLE" riddleButton.TextSize = 8 riddleButton.TextColor3 = Color3.fromRGB(250, 250, 255) riddleButton.Font = Enum.Font.GothamBold riddleButton.AutoButtonColor = false riddleButton.Parent = Header addCorner(riddleButton, 12) addStroke(riddleButton, COLORS.Border, 1, 0.4) styleButton(riddleButton) local function toggleRiddle() riddleEnabled = not riddleEnabled tweenProp(riddleButton, 0.15, Enum.EasingStyle.Quad, {BackgroundColor3 = riddleEnabled and PURPLE or COLORS.Control}) if ConsoleOutput and _enabled then ConsoleOutput.Text = ConsoleOutput.Text .. '\n\nriddle solver: ' .. (riddleEnabled and "ON" or "OFF") .. "" scrollConsoleToBottom() end end riddleButton.MouseButton1Click:Connect(toggleRiddle) UserInputService.InputBegan:Connect(function(input) if input.UserInputType ~= Enum.UserInputType.Keyboard then return end if UserInputService:GetFocusedTextBox() then return end if input.KeyCode == Enum.KeyCode.R then toggleRiddle() end end) -- ============ STATUS / LOG ============ function setStatus(msg, col) if not ConsoleOutput or not _enabled then return end if msg == _lastStatusMsg then return end _lastStatusMsg = msg col = col or COLORS.Dim local line = '' .. tostring(msg) .. "" if ConsoleOutput.Text == "" then ConsoleOutput.Text = line else ConsoleOutput.Text = ConsoleOutput.Text .. "\n\n" .. line end scrollConsoleToBottom() end function flashCode(code, col) if not code or code == "" or code == "—" then return end setStatus("[code] -> " .. tostring(code), col or COLORS.White) end function col3ToRich(col) return string.format("rgb(%d,%d,%d)", math.floor(col.R * 255 + 0.5), math.floor(col.G * 255 + 0.5), math.floor(col.B * 255 + 0.5)) end function resetPasteCounter() _capturedParts = {} end clearAceCapture = function() _capturedParts = {} end function clearBoxWatchers() if _boxTextConn then pcall(function() _boxTextConn:Disconnect() end) end if _boxAncestryConn then pcall(function() _boxAncestryConn:Disconnect() end) end for _, connection in ipairs(_boxVisibilityConns) do pcall(function() connection:Disconnect() end) end _boxTextConn = nil _boxAncestryConn = nil _boxVisibilityConns = {} _lastWatchedBox = nil end function watchBoxForBlankReset(box) if not box or _lastWatchedBox == box then return end clearBoxWatchers() _lastWatchedBox = box if box.Text ~= "" then _lastNonBlankBoxText = box.Text end _boxTextConn = box:GetPropertyChangedSignal("Text"):Connect(function() if box.Text == "" then resetPasteCounter() else _lastNonBlankBoxText = box.Text end end) _boxAncestryConn = box.AncestryChanged:Connect(function(_, parent) if not parent then resetPasteCounter(); clearBoxWatchers() end end) end UserInputService.TextBoxFocused:Connect(function(box) if box:IsDescendantOf(GUI) then return end if box ~= aceCodeBox() then return end _focused = box _lastBox = box watchBoxForBlankReset(box) if _enabled then setStatus("Ready", COLORS.Green) end end) UserInputService.TextBoxFocusReleased:Connect(function(box) if box:IsDescendantOf(GUI) then return end local codeBox = aceCodeBox() if box ~= codeBox and box ~= _lastBox then return end if _retypeInvalid and rememberPendingSubmission and (box == codeBox or box == _lastBox) then local submittedText = box.Text ~= "" and box.Text or _lastNonBlankBoxText rememberPendingSubmission(box, submittedText, false) end if _focused == box then _focused = nil end end) -- ============ FEEDBACK (retype on invalid) ============ function clearPendingSubmission() _pendingRejectedToken = _pendingRejectedToken + 1 _pendingRejectedText = nil _pendingRejectedBox = nil _pendingRejectedUntil = 0 end function rememberPendingSubmission(box, text, replaceExisting) if not _retypeInvalid or not text or text == "" then return end if not replaceExisting and _pendingRejectedText and os.clock() <= _pendingRejectedUntil then return end _pendingRejectedToken = _pendingRejectedToken + 1 local token = _pendingRejectedToken _pendingRejectedText = text _pendingRejectedBox = box _pendingRejectedUntil = os.clock() + 8 task.delay(8, function() if token == _pendingRejectedToken then clearPendingSubmission() end end) end local function restoreRejectedText(box, previousText) if not _retypeInvalid or not previousText or previousText == "" then return false end RunService.Heartbeat:Wait() local repasteBox = aceCodeBox() or box if not repasteBox or not isVisibleChain(repasteBox) then return false end local restored = pcall(function() repasteBox.Text = previousText end) if restored then _lastBox = repasteBox watchBoxForBlankReset(repasteBox) end return restored end function handleRedemptionFeedback(text, feedbackObject) if not _retypeInvalid or not _pendingRejectedText then return end if os.clock() > _pendingRejectedUntil then clearPendingSubmission() return end if feedbackObject and feedbackObject:IsDescendantOf(GUI) then return end local lower = tostring(text or ""):lower() local rejected = lower:find("invalid code", 1, true) or lower:find("code is invalid", 1, true) or lower:find("expired", 1, true) or lower:find("already redeemed", 1, true) or lower:find("already used", 1, true) or lower:find("doesn't exist", 1, true) or lower:find("does not exist", 1, true) or lower:find("not found", 1, true) or lower:find("rejected", 1, true) if not rejected then return end local previousText = _pendingRejectedText local previousBox = _pendingRejectedBox local restored = restoreRejectedText(previousBox, previousText) clearPendingSubmission() markHistoryVerdict(previousText, "invalid") if restored then setStatus("Invalid - repasted: " .. previousText, COLORS.Amber) flashCode(previousText, COLORS.Red) end end local function watchRedemptionFeedbackObject(obj) if not (obj:IsA("TextLabel") or obj:IsA("TextButton")) then return end handleRedemptionFeedback(obj.Text or "", obj) obj:GetPropertyChangedSignal("Text"):Connect(function() handleRedemptionFeedback(obj.Text or "", obj) end) end for _, obj in ipairs(playerGui:GetDescendants()) do watchRedemptionFeedbackObject(obj) end playerGui.DescendantAdded:Connect(function(obj) task.wait(0.04) watchRedemptionFeedbackObject(obj) end) -- ============ ANNOUNCEMENT LISTENER ============ local function resolveNotifyRemote() if _G.AquaNotifyRemote then return _G.AquaNotifyRemote end local Packages = ReplicatedStorage:FindFirstChild("Packages") if not Packages then return nil end local Net = Packages:FindFirstChild("Net") if not Net then return nil end local getinfo = debug and (debug.getinfo or debug.info) if getgc and getinfo and getconnections then for _, d in ipairs(Net:GetDescendants()) do if d:IsA("RemoteEvent") then local ok, cs = pcall(getconnections, d.OnClientEvent) if ok then for _, c in ipairs(cs) do local f, fn = pcall(function() return c.Function end) if f and type(fn) == "function" then local i, info = pcall(getinfo, fn) if i and tostring(info.short_src or info.source or ""):find("NotificationController", 1, true) then return d end end end end end end end return nil end local function aceStripRich(text) if type(text) ~= "string" then return tostring(text) end return (text:gsub("<[^>]->", "")) end local function aceTokenize(text) local words = {} for word in text:gmatch("[%w_]+") do words[#words + 1] = word end return words end local aceCollectBuffer = {} local function onAceAnnouncement(...) local text = aceStripRich(tostring((...) or "")) text = text:match("^%s*(.-)%s*$") or "" if text == "" then return end -- RIDDLES are full sentences — solve BEFORE the single-token filter if riddleEnabled then local solved = solveRiddle(text) if solved then submitRiddleAnswer(solved) return end end if text:find("%s") then return end for _, word in ipairs(aceTokenize(text)) do aceCollectBuffer[#aceCollectBuffer + 1] = word end local parts = {} for index = 1, math.min(#aceCollectBuffer, ACE_WORD_COUNT) do parts[index] = aceCollectBuffer[index] end if #aceCollectBuffer < ACE_WORD_COUNT then return end aceCollectBuffer = {} local captured = table.concat(parts) if captured == "" or _seen[captured] then return end _seen[captured] = true task.delay(1.25, function() _seen[captured] = nil end) appendToBox(captured) end -- ============ CAPTURE → TYPE → SUBMIT ============ function appendToBox(text) if not text or text == "" then return end if _lastWatchedBox and not isVisibleChain(_lastWatchedBox) then resetPasteCounter() clearBoxWatchers() end local box = aceCodeBox() _capturedParts[#_capturedParts + 1] = text local combinedCode = table.concat(_capturedParts) if ACE_CASE_MODE == "UPPER" then combinedCode = combinedCode:upper() elseif ACE_CASE_MODE == "LOWER" then combinedCode = combinedCode:lower() end local capturedCount = #_capturedParts if box then _lastBox = box watchBoxForBlankReset(box) local boxWasFocused = UserInputService:GetFocusedTextBox() == box box.Text = combinedCode if boxWasFocused then pcall(function() local caretEnd = #combinedCode + 1 box.CursorPosition = caretEnd box.SelectionStart = caretEnd end) end else setStatus("Captured; opening & searching UI...", COLORS.Text) end setStatus("Pasted " .. tostring(capturedCount) .. "/" .. tostring(_submitAfter), COLORS.Green) flashCode(combinedCode, COLORS.Green) if capturedCount >= _submitAfter then _capturedParts = {} if _autoAccept then rememberPendingSubmission(box, combinedCode, true) local ok, statusMsg = typeAndSubmitCode(combinedCode) if ok then addHistoryEntry(combinedCode, "submitted") setStatus("Redeemed: " .. combinedCode, COLORS.Green) else addHistoryEntry(combinedCode, "failed", tostring(statusMsg)) local restored = restoreRejectedText(box, combinedCode) clearPendingSubmission() if restored then setStatus("Failed - repasted: " .. combinedCode, COLORS.Amber) flashCode(combinedCode, COLORS.Red) else setStatus("Failed: " .. tostring(statusMsg), COLORS.Red) end end end end end -- ============ HOOK + CLEANUP ============ local notifyRemote = resolveNotifyRemote() local notifyConn if notifyRemote then notifyConn = notifyRemote.OnClientEvent:Connect(function(...) if not _enabled then return end pcall(onAceAnnouncement, ...) end) if getgenv then getgenv().AquaNotifyRemote = notifyRemote end if _enabled then ConsoleOutput.Text = 'notification remote hooked: ' .. notifyRemote.Name .. "" scrollConsoleToBottom() end elseif _enabled then ConsoleOutput.Text = 'no notification remote found (minimal)' scrollConsoleToBottom() end if getgenv then getgenv().StopAqua = function() if notifyConn then pcall(function() notifyConn:Disconnect() end) notifyConn = nil end if GUI then pcall(function() GUI:Destroy() end) GUI = nil end end end end -- ============================================================ -- WIRE INIT -- ============================================================ if btnEnabled then splashBtn.MouseButton1Click:Connect(loadEngine) else splashBtn.TextTransparency = 0.5 end print("✓ Aqua Autotyper v4.1 loaded - press INITIALIZE")