--[[ ================================================================================ BEYBLADE X BATTLES - SmartKeys Tabbed auto-play panel with a bey-type reader and a drift-free scheduler. ================================================================================ USE IT Paste this whole file into your executor and execute, or host it and run: loadstring(game:HttpGet("https://your.host/SmartKeys.lua"))() About loadstring: Roblox ships loadstring() DISABLED (LoadStringEnabled defaults to false) and it only accepts plain Luau source, never bytecode. Executors re-add loadstring() plus game:HttpGet, which is why the one-liner above only works inside an executor. So there is nothing to "enable" - if your executor has loadstring, the line works; if it doesn't, paste the file. WHAT MAKES IT NOT A DUMB MACRO 1. Drift-free scheduling. A normal auto-clicker does wait(3) in a loop, so every press costs one extra frame and the error piles up: after 20 minutes a "3 second" macro is seconds behind. This one schedules against an absolute clock (nextAt = nextAt + interval), so the error never accumulates. The GUI shows the live drift in milliseconds. 2. Feedback learning (Adaptive mode). After pressing F it watches the ProximityPrompt it was aiming at. If the prompt is still there and nothing changed, the press was too early: the interval grows. If the prompt closed or advanced, the press landed: the interval creeps back down toward your minimum. That is an AIMD control loop - real adaptation, but it is a heuristic, not a neural net, and it only learns from prompts. 3. Smart gating. It can refuse to press: no ProximityPrompt in range, no tool equipped, character mid-jump/ragdoll/dead. Presses that would have been wasted are counted as "skipped" instead of spamming the game. 4. Zero human delay. Jitter defaults to 0 and there is no artificial pause anywhere. Turn jitter up only if you actually want humanised timing. GAME PROFILE (BEYBLADE X-BATTLES, place 85070202669030) Read straight out of that game's battle HUD, not guessed: R is SKILL, F is SUB_SKILL, E is SHOOT, T is CAMERA. The profile binds one slot to each skill and gates it on an opponent being in range AND the skill being off cooldown, polling every 0.4s so the press lands the moment it comes up. Bey builds come from BladeId / RachetId / BitId attributes on workspace Parts, and each of those Parts carries VisibleOwners - a comma-joined user id list. "battle only" is decided by place id: the hub is 85070202669030 and matches run in a separate place, so it sits still in the hub and runs in the arena. The score HUD (PlayerGui.Score) only exists in a match. Bey detection needs no model id: opponents come from Players' Characters, and beys no player owns are found by scanning workspace for models named like a bey (bey/blade/spinner/gyro), with stadium furniture blacklisted so the arena never counts. Auto pause stops the script when no bey has been near for 6 seconds and starts it again on contact - so it sits still in the lobby and works during a battle, with nothing to press. Backend: it uses your executor's keypress/keyrelease (real OS input) when available, otherwise VirtualInputManager:SendKeyEvent. Give Roblox window focus - neither backend delivers input while the window is in the background. Heads up: executors and input automation break Roblox's Terms of Use, and accounts do get actioned for it. That is your call, not the script's. ================================================================================ ]] --============================================================================== -- BOOTSTRAP --============================================================================== if not game:IsLoaded() then game.Loaded:Wait() end local Players = game:GetService("Players") local UserInputService = game:GetService("UserInputService") local ProximityPromptService = game:GetService("ProximityPromptService") local HttpService = game:GetService("HttpService") local TweenService = game:GetService("TweenService") local player = Players.LocalPlayer local waitedForPlayer = 0 while not player and waitedForPlayer < 10 do task.wait(0.1) waitedForPlayer = waitedForPlayer + 0.1 player = Players.LocalPlayer end local VirtualInputManager = nil pcall(function() VirtualInputManager = game:GetService("VirtualInputManager") end) -- executor keypress / keyrelease (Synapse-style, numeric virtual key codes) local execPress, execRelease = nil, nil if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" then if type(env.keypress) == "function" and type(env.keyrelease) == "function" then execPress, execRelease = env.keypress, env.keyrelease end end end if not execPress and type(keypress) == "function" and type(keyrelease) == "function" then execPress, execRelease = keypress, keyrelease end local VIRTUAL_KEY = { F = 70, R = 82, E = 69, Q = 81, Space = 32, LeftShift = 16, RightShift = 16, G = 71, V = 86, C = 67, X = 88, Z = 90, } local Backend = "none" if execPress then Backend = "executor" elseif VirtualInputManager then Backend = "virtual" end --============================================================================== -- CONFIG --============================================================================== local Config = { running = false, mode = "Adaptive", -- "Adaptive" | "Fixed" jitter = 0, -- extra +/- seconds per press, 0 = no human delay at all adaptiveMin = 1.0, adaptiveMax = 8.0, learnStep = 0.10, probeWindow = 0.40, -- how long to watch a prompt before calling the press a miss smartDetect = true, promptFallback = true, -- if no prompt is ever seen in 20s, stop gating on prompts scanBeyModels = true, -- also treat unowned bey-named models as targets releasePad = 8, -- hysteresis: keep pressing until the target is this much further autoPause = false, -- stop by itself when no bey has been near for a while battleOnly = true, -- only press while the game says a match is running enemyRange = 30, -- studs, used by the Enemy gate -- BEY BRAIN: type-aware timing. The role comes from the Bit code and the -- blade name; the model then decides when a press is actually worth it. adaptType = true, burstWindow = true, aggression = 1.0, -- 0.5 = patient, 2.0 = all out brainRange = 45, leadTime = 0.22, -- fire this many seconds before the opponent arrives counterMoves = true, -- read the opponent's move (dash/turn/stall) and answer it myType = "auto", -- auto | attack | defense | stamina | balance iconTypes = true, -- read a bit's type from its item icon colour hotkey = Enum.KeyCode.RightShift, } local PROMPT_FALLBACK_AFTER = 20 local Keys = { { name = "F", keyCode = Enum.KeyCode.F, enabled = true, interval = 3.0, hold = 0.04, gate = "Prompt", -- Prompt | Always | Tool | Idle presses = 0, skipped = 0, drift = 0, learned = 3.0, nextAt = 0, status = "idle", }, { name = "R", keyCode = Enum.KeyCode.R, enabled = true, interval = 3.0, hold = 0.04, gate = "Always", -- Prompt | Always | Tool | Idle presses = 0, skipped = 0, drift = 0, learned = 3.0, nextAt = 0, status = "idle", }, } local GATE_VALUES = { "Prompt", "Enemy", "Enemy+Skill", "Skill", "Brain", "Tool", "Idle", "Always" } local MODE_VALUES = { "Adaptive", "Fixed" } local KEY_CHOICES = { Enum.KeyCode.F, Enum.KeyCode.R, Enum.KeyCode.E, Enum.KeyCode.Q, Enum.KeyCode.Space, Enum.KeyCode.LeftShift, Enum.KeyCode.G, Enum.KeyCode.V, Enum.KeyCode.C, Enum.KeyCode.X, Enum.KeyCode.Z, } --============================================================================== -- CHARACTER HELPERS (used by the smart gates) --============================================================================== local BUSY_STATES = { Jumping = true, Freefall = true, FallingDown = true, Climbing = true, GettingUp = true, Ragdoll = true, } local function getHumanoid() local char = player and player.Character if not char then return nil end return char:FindFirstChildOfClass("Humanoid") end local function isAlive() local hum = getHumanoid() if not hum then -- arena games often swap the avatar for a custom rig (a bey, not a -- humanoid). "no Humanoid" means unknown, not dead, so never block on it. return player ~= nil and player.Character ~= nil end return hum.Health > 0 end local function isBusy() if not isAlive() then return true end local hum = getHumanoid() if not hum then return false end local ok, state = pcall(function() return hum:GetState() end) if ok and state and BUSY_STATES[tostring(state)] then return true end return false end local function hasTool() local char = player and player.Character if not char then return false end local hum = getHumanoid() if hum and hum:FindFirstChildOfClass("Tool") then return true end return char:FindFirstChildOfClass("Tool") ~= nil end --============================================================================== -- ENEMY AWARENESS -- An arena game has nothing like ProximityPrompts to key off, so the useful -- signal is "is an opponent close enough that a special or dash would matter". --============================================================================== local function getRoot(character) if not character then return nil end local root = character:FindFirstChild("HumanoidRootPart") if root then return root end if character.PrimaryPart then return character.PrimaryPart end for _, child in ipairs(character:GetChildren()) do if child:IsA("BasePart") then return child end end return nil end local function isEnemy(otherPlayer, character) if otherPlayer == player or not player then return false end -- 2v2: never fire on a teammate if the game assigns teams local myTeam = player.Team local otherTeam = otherPlayer.Team if myTeam and otherTeam and myTeam == otherTeam then return false end local hum = character:FindFirstChildOfClass("Humanoid") if hum and hum.Health <= 0 then return false end return true end --============================================================================== -- BEY DETECTION -- There is no "model id" to look up: a script cannot resolve "the bey asset" and -- does not need to. Two cheap signals are enough: -- 1. every opponent in Players has a Character in workspace, and -- 2. a bey nobody owns (an AI top, or one parented into the stadium folder) is -- simply a model near you whose name looks like a bey. -- So: nearest of (opponent character, bey-named model), with the arena itself -- blacklisted so the stadium never counts as a target. --============================================================================== -- lowercase substrings that make a workspace model look like a spinning top local BEY_PATTERNS = { "bey", "blade", "spinner", "gyro", "spintop" } -- arena furniture, never a target (checked first, wins over the patterns) local BEY_BLOCKLIST = { "stadium", "arena", "stage", "floor", "map", "spawn", "baseplate", "gate", "wall", "billboard", "surface", "decal", "text", } local Scan = { at = 0, list = {}, } local function nameLooksLikeBey(name) local lower = string.lower(name) for _, bad in ipairs(BEY_BLOCKLIST) do if string.find(lower, bad, 1, true) then return false end end for _, good in ipairs(BEY_PATTERNS) do if string.find(lower, good, 1, true) then return true end end return false end -- true if the instance lives inside any player's character (mine included) local function ownedByAPlayer(inst, charSet) local node = inst while node and node ~= workspace do if charSet[node] then return true end node = node.Parent end return false end local function namedAfterMe(name) if not player then return false end local lower = string.lower(name) local myName = string.lower(player.Name) if #myName >= 3 and string.find(lower, myName, 1, true) then return true end local display = player.DisplayName and string.lower(player.DisplayName) or "" if #display >= 3 and string.find(lower, display, 1, true) then return true end return false end local function collectBeyModels(charSet) local found = {} local ok, descendants = pcall(function() return workspace:GetDescendants() end) if not ok or not descendants then return found end -- a giant map should not turn this scan into a frame killer if #descendants > 4000 then local topOk, children = pcall(function() return workspace:GetChildren() end) if topOk and children then descendants = children end end for _, inst in ipairs(descendants) do if inst:IsA("Model") and nameLooksLikeBey(inst.Name) and not namedAfterMe(inst.Name) and not ownedByAPlayer(inst, charSet) then local root = getRoot(inst) if root then table.insert(found, { obj = inst, root = root, label = inst.Name }) end end end return found end -- nearest hostile thing: (target, distance, label). distance is math.huge when -- nothing at all is in the server, and can exceed range for a target too far. local function nearestEnemy(range) if not player then return nil, math.huge, nil end local root = getRoot(player.Character) if not root then return nil, math.huge, nil end local best, bestDist, bestLabel = nil, math.huge, nil local charSet = {} for _, other in ipairs(Players:GetPlayers()) do if other.Character then charSet[other.Character] = true end end -- 1. real opponents for _, other in ipairs(Players:GetPlayers()) do local char = other.Character if other ~= player and char and isEnemy(other, char) then local otherRoot = getRoot(char) if otherRoot then local ok, dist = pcall(function() return (root.Position - otherRoot.Position).Magnitude end) if ok and dist < bestDist then best, bestDist, bestLabel = other, dist, other.Name end end end end -- 2. beys nobody owns (AI tops). The instance list is cached; distances are -- recomputed every call so a moving bey is tracked live. if Config.scanBeyModels then if os.clock() - Scan.at > 0.5 then Scan.at = os.clock() Scan.list = collectBeyModels(charSet) end for _, item in ipairs(Scan.list) do if item.obj.Parent and item.root.Parent then local ok, dist = pcall(function() return (root.Position - item.root.Position).Magnitude end) if ok and dist < bestDist then best, bestDist, bestLabel = item.obj, dist, item.label end end end end if best and bestDist <= range then return best, bestDist, bestLabel end return nil, bestDist, bestLabel end -- how far the closest standalone bey model is, and how many exist at all. -- beyCount > 0 means "this game spawns beys as their own models", which makes -- a bey a far better battle signal than a player merely standing nearby. local function nearestBeyDistance() if not Config.scanBeyModels then return math.huge, 0 -- stale cache would otherwise leak into the decision end local root = getRoot(player and player.Character) if not root then return math.huge, 0 end local best = math.huge local count = 0 for _, item in ipairs(Scan.list) do if item.obj.Parent and item.root.Parent then count = count + 1 local ok, dist = pcall(function() return (root.Position - item.root.Position).Magnitude end) if ok and dist < best then best = dist end end end return best, count end --============================================================================== -- GAME STATE (verified against BEYBLADE X-BATTLES with BeyProbe) -- The battle HUD is PlayerGui.ShootGui and each action button carries a -- CoolTime label holding the seconds left, so a skill can be gated on being -- off cooldown instead of guessed at. Bey builds are workspace Parts carrying -- BladeId / RachetId / BitId attributes (note the game's spelling: "Rachet"). -- Every reader here returns nil when the game does not expose the value, and -- callers treat nil as "do not block" - a missing sensor must never lock a -- gate closed. --============================================================================== local GameState = { lastCool = nil, coolChangedAt = 0, coolSuspect = false, ratio = nil, ratioAt = 0, ratioSuspect = false, builds = {}, buildsAt = 0, battle = nil, battleAt = 0, score = nil, scoreAt = 0, } local COOLDOWN_BUTTONS = { R = "SkillButton", F = "Sub_SkillButton", E = "ShootButton", } local function findDeep(root, name) if not root then return nil end local ok, found = pcall(function() return root:FindFirstChild(name, true) end) return ok and found or nil end local function battleGui() if not player then return nil end local gui = player:FindFirstChild("PlayerGui") if not gui then return nil end return gui:FindFirstChild("ShootGui") end -- Am I in a match? Verified signal first, HUD second. -- 1. Each bey Part carries VisibleOwners: a comma-joined user id list with a -- trailing comma, e.g. "11869406351,". If my id is in one of those lists, -- the game has replicated that match's beys to me, which it only does for -- participants. Live dump confirms the format. -- 2. ShootGui.Enabled, which no dump has confirmed either way. -- Blocking needs agreement from both: if the HUD looks available we allow, so an -- unreadable signal can never silence the script. local HUB_PLACE_ID = 85070202669030 local function inBattle() -- Verified with two live dumps: the hub is place 85070202669030 and every -- match runs in its own place (87039656804706 in the sample). A place id is -- exact, unlike anything inferred from the HUD, so it is checked first. local okPlace, placeId = pcall(function() return game.PlaceId end) if okPlace and type(placeId) == "number" then return placeId ~= HUB_PLACE_ID end if os.clock() - GameState.battleAt < 0.4 then return GameState.battle end GameState.battleAt = os.clock() local listedInMatch = false local sawMatchParts = false if player then local myId = "," .. tostring(player.UserId) .. "," local ok, children = pcall(function() return workspace:GetChildren() end) if ok and children then for _, inst in ipairs(children) do local okOwners, owners = pcall(function() return inst:GetAttribute("VisibleOwners") end) if okOwners and type(owners) == "string" and owners ~= "" then sawMatchParts = true local padded = "," .. string.gsub(owners, "%s+", "") .. "," if string.find(padded, myId, 1, true) then listedInMatch = true break end end end end end if listedInMatch then GameState.battle = true return true end local gui = battleGui() if not gui then GameState.battle = nil return nil end local ok, enabled = pcall(function() return gui.Enabled end) if not ok then GameState.battle = nil return nil end if enabled then GameState.battle = nil return nil end -- HUD is off: only call it a lobby if we also saw match parts that skip me if sawMatchParts then GameState.battle = false return false end GameState.battle = nil return nil end -- The skill buttons carry a shrinking overlay frame (button.Frame.BGFrame). -- Two dumps pin it down: full height in the hub with the skill locked, zero -- height in a match, so height / buttonHeight = remaining cooldown, 0 = ready. -- The CoolTime label is only a fallback: it read the same "1" in both dumps, so -- it is almost certainly a static label and not a countdown. local function overlayRatio(button) if not button then return nil end local group = button:FindFirstChild("Frame") local bg = group and group:FindFirstChild("BGFrame") if not bg then return nil end local buttonHeight = 0 local bgHeight = 0 pcall(function() buttonHeight = button.AbsoluteSize.Y bgHeight = bg.AbsoluteSize.Y end) if buttonHeight <= 1 then return nil end return math.clamp(bgHeight / buttonHeight, 0, 1) end local function labelSeconds(button) local label = findDeep(button, "CoolTime") if not label then return nil end local text = "" pcall(function() text = label.Text end) local digits = string.match(text or "", "%d+%.?%d*") return digits and tonumber(digits) or nil end -- ready = true | false | nil (unknown), plus a short string for the display. -- A sensor that never changes is reported as unknown, so a wrong guess can never -- hold the gate shut. local function cooldownState(keyName) local buttonName = COOLDOWN_BUTTONS[keyName] if not buttonName then return nil, "n/a" end local gui = battleGui() if not gui then return nil, "n/a" end local folder = findDeep(gui, buttonName) if not folder then return nil, "n/a" end local ratio = overlayRatio(folder:FindFirstChild("PC")) or overlayRatio(folder:FindFirstChild("Mobile")) if ratio ~= nil then local now = os.clock() if GameState.ratio == nil or math.abs(ratio - GameState.ratio) > 0.01 then GameState.ratio = ratio GameState.ratioAt = now GameState.ratioSuspect = false elseif ratio > 0.05 and (now - GameState.ratioAt) > 4 then GameState.ratioSuspect = true end if GameState.ratioSuspect then return nil, "bar stuck", nil end if ratio > 0.05 then return false, string.format("%.0f%%", ratio * 100), ratio end return true, "ready", 0 end local remaining = labelSeconds(folder) if remaining == nil then return nil, "n/a" end local now = os.clock() if GameState.lastCool ~= remaining then GameState.lastCool = remaining GameState.coolChangedAt = now GameState.coolSuspect = false elseif remaining > 0.05 and (now - GameState.coolChangedAt) > 4 then GameState.coolSuspect = true end if GameState.coolSuspect then return nil, "label stuck" end if remaining > 0.05 then return false, string.format("%.0fs", remaining) end return true, "ready" end -- my own bey is a Model inside my character with a MeshPart named "Blade", -- e.g. "STEEL SAMURAI 5-70GF". That is my build without guessing. local function myBeyName() local char = player and player.Character if not char then return nil end local ok, children = pcall(function() return char:GetChildren() end) if not ok or not children then return nil end for _, inst in ipairs(children) do local okModel, isModel = pcall(function() return inst:IsA("Model") end) if okModel and isModel and inst:FindFirstChild("Blade") then return inst.Name end end return nil end local function squash(text) return string.lower((string.gsub(tostring(text or ""), "[^%w]", ""))) end local function shortId(value, prefix) local text = tostring(value or "?") text = string.gsub(text, "^" .. prefix, "") text = string.gsub(text, "_%d+$", "") return text end -- the beys currently in play: Blade + Rachet + Bit, nearest first. The game -- puts these on loose workspace Parts, so the nearest one to you is the best -- available guess at "yours" and the second is the opponent's. local function readBuilds() if os.clock() - GameState.buildsAt < 1 then return GameState.builds end GameState.buildsAt = os.clock() local list = {} local ok, children = pcall(function() return workspace:GetChildren() end) if not ok or not children then return list end local myRoot = getRoot(player and player.Character) for _, inst in ipairs(children) do local okBlade, blade = pcall(function() return inst:GetAttribute("BladeId") end) if okBlade and blade then -- in a match every bey Part lists its participants in VisibleOwners; -- Player.CurrentMatchId is the sharper key when the game sets it, -- and the two agree in the dump (oWUMintz, my UserId listed) local mine = true local myMatch = nil if player then local okMatch, current = pcall(function() return player:GetAttribute("CurrentMatchId") end) if okMatch and type(current) == "string" and current ~= "" and current ~= "None" then myMatch = current end end if myMatch then local okPart, partMatch = pcall(function() return inst:GetAttribute("MatchId") end) mine = okPart and partMatch == myMatch else local okOwners, owners = pcall(function() return inst:GetAttribute("VisibleOwners") end) if okOwners and type(owners) == "string" and owners ~= "" and player then local padded = "," .. string.gsub(owners, "%s+", "") .. "," mine = string.find(padded, "," .. tostring(player.UserId) .. ",", 1, true) ~= nil end end local dist = math.huge pcall(function() dist = (myRoot.Position - inst.Position).Magnitude end) if mine then table.insert(list, { blade = tostring(blade), ratchet = tostring(inst:GetAttribute("RachetId") or "?"), bit = tostring(inst:GetAttribute("BitId") or "?"), poison = inst:GetAttribute("Condition_Poison"), dist = dist, }) end end end table.sort(list, function(a, b) return a.dist < b.dist end) GameState.builds = list return list end -- Score: match place only. The exact shape came from BeyProbeBrain: -- Score.CanvasGroup.<"1"|"2">.TextLabel.Text = "0" score -- Score.CanvasGroup.<"1"|"2">.Max.Text = "/4" first to 4 -- Score.CanvasGroup.<"1"|"2">.ImageLabel.Image = rbxthumb id= -- The avatar id says which side is whose, so "my score" does not depend on -- which column the HUD happens to put me in. local function readScore() local gui = player and player:FindFirstChild("PlayerGui") local scoreGui = gui and gui:FindFirstChild("Score") if not scoreGui then GameState.score = nil GameState.myScore = nil GameState.oppScore = nil GameState.scoreTarget = nil return nil end if os.clock() - GameState.scoreAt < 0.25 then return GameState.score end GameState.scoreAt = os.clock() GameState.myScore = nil GameState.oppScore = nil GameState.scoreTarget = nil local ok, canvas = pcall(function() return scoreGui:FindFirstChild("CanvasGroup") end) local sides = {} if ok and canvas then local okChildren, children = pcall(function() return canvas:GetChildren() end) if okChildren and children then for _, frame in ipairs(children) do local okFrame, isFrame = pcall(function() return frame:IsA("GuiObject") end) if okFrame and isFrame and string.match(frame.Name, "^%d+$") then local value, target, userId = nil, nil, nil pcall(function() local label = frame:FindFirstChild("TextLabel") local maxLabel = frame:FindFirstChild("Max") local avatar = frame:FindFirstChild("ImageLabel") if label then value = tonumber(string.match(label.Text, "%d+")) end if maxLabel then target = tonumber(string.match(maxLabel.Text, "%d+")) end if avatar then userId = tonumber(string.match(avatar.Image, "id=(%d+)")) end end) if value then table.insert(sides, { value = value, target = target, userId = userId }) end end end end end if #sides >= 2 then local mine, theirs = nil, nil for _, side in ipairs(sides) do if side.userId and player and side.userId == player.UserId then mine = side elseif not theirs then theirs = side end end if mine and theirs then GameState.myScore = mine.value GameState.oppScore = theirs.value GameState.scoreTarget = mine.target or theirs.target GameState.score = string.format("%d : %d", mine.value, theirs.value) return GameState.score end end -- fallback for a different HUD shape: numeric labels left to right local okDesc, descendants = pcall(function() return scoreGui:GetDescendants() end) if not okDesc or not descendants then return GameState.score end local found = {} for _, inst in ipairs(descendants) do local okLabel, isLabel = pcall(function() return inst:IsA("TextLabel") end) if okLabel and isLabel then local text = "" local x = 0 pcall(function() text = inst.Text x = inst.AbsolutePosition.X end) local number = string.match(tostring(text or ""), "^%s*(%d+)%s*$") if number then table.insert(found, { text = number, x = x }) end end end if #found == 0 then GameState.score = nil return nil end table.sort(found, function(a, b) return a.x < b.x end) local parts = {} for _, item in ipairs(found) do table.insert(parts, item.text) if #parts >= 4 then break end end GameState.score = table.concat(parts, " : ") return GameState.score end --============================================================================== -- PROMPT TRACKER -- A real, game-agnostic signal: F is Roblox's default ProximityPrompt key, so -- "a prompt is showing" is exactly "pressing F right now would do something". --============================================================================== local Tracker = { set = {}, version = 0, seenAt = 0, everSeen = false, } -- Roblox throttles an unfocused client and its HUD stops refreshing, so the -- round sensors can report stale values (LocalPlayerBeyRunning false while the -- match is actually still running). That is what stopped the auto-play when -- tabbing out: the round gate latched shut. While unfocused, round state is -- treated as unknown instead of trusting a stale read. local windowFocused = true task.spawn(function() pcall(function() windowFocused = UserInputService.WindowFocused UserInputService.WindowFocused:Connect(function() windowFocused = true end) UserInputService.WindowFocusReleased:Connect(function() windowFocused = false end) end) end) -- Round state, verified with BeyProbeFinish on a live match: -- player.LocalPlayerBeyRunning true while my bey spins, false at round end -- PlayerGui.Score.Enabled true during a round, false in the transition -- PlayerGui.Popup001 enabled with "SPINFINISH" / "XTREME FINISH" -- Condition_Poison only ever nil -> false (initialisation, not -- a hit), so it is deliberately not used here local function readRoundState() local running = nil if player then local ok, value = pcall(function() return player:GetAttribute("LocalPlayerBeyRunning") end) if ok and type(value) == "boolean" then running = value end end local gui = player and player:FindFirstChild("PlayerGui") local scoreOn = nil local finishText = nil if gui then local scoreGui = gui:FindFirstChild("Score") if scoreGui then local ok, enabled = pcall(function() return scoreGui.Enabled end) if ok then scoreOn = enabled end end local popup = gui:FindFirstChild("Popup001") local popupOn = false if popup then local okPopup, enabled = pcall(function() return popup.Enabled end) if okPopup and enabled then popupOn = true local text = "" pcall(function() for _, inst in ipairs(popup:GetDescendants()) do if inst:IsA("TextLabel") and inst.Text ~= "" then text = text .. " " .. inst.Text end end end) if string.find(string.upper(text), "FINISH", 1, true) then finishText = text end end end -- the dump showed Popup001 switching on and never logging an off, so a -- sticky popup must not mean "round over" forever: honour it for a few -- seconds after it opens, then fall back to the running/score pair if popupOn and not GameState.popupOn then GameState.finishAt = os.clock() end GameState.popupOn = popupOn if finishText and not (GameState.finishAt and (os.clock() - GameState.finishAt) < 4) then finishText = nil end end GameState.beyRunning = running GameState.scoreLive = scoreOn GameState.finishText = finishText GameState.focused = windowFocused if not windowFocused then -- fail open: a backgrounded client is throttled and its HUD lags, so a -- stale "not running" must never switch the auto-play off GameState.roundLive = nil return end if finishText then GameState.roundLive = false elseif running == false or scoreOn == false then GameState.roundLive = false elseif running == true and scoreOn == true then GameState.roundLive = true else GameState.roundLive = nil end end local function promptValid(prompt) if typeof(prompt) ~= "Instance" or not prompt:IsA("ProximityPrompt") then return false end if not prompt.Parent or not prompt.Enabled then return false end local char = player and player.Character local root = char and char:FindFirstChild("HumanoidRootPart") if not root then return true end local pos = nil local parent = prompt.Parent if parent:IsA("Attachment") then pos = parent.WorldPosition elseif parent:IsA("BasePart") then pos = parent.Position else local part = parent:FindFirstChildWhichIsA("BasePart") if part then pos = part.Position end end if not pos then return true end local ok, reach = pcall(function() return (root.Position - pos).Magnitude end) if not ok then return true end return reach <= (prompt.MaxActivationDistance + 3) end local function trackerAny() for prompt in pairs(Tracker.set) do if not promptValid(prompt) then Tracker.set[prompt] = nil else return true, prompt end end return false, nil end ProximityPromptService.PromptShown:Connect(function(prompt) Tracker.set[prompt] = true Tracker.seenAt = os.clock() Tracker.everSeen = true end) ProximityPromptService.PromptHidden:Connect(function(prompt) if Tracker.set[prompt] then Tracker.set[prompt] = nil Tracker.version = Tracker.version + 1 Tracker.seenAt = os.clock() end end) --============================================================================== -- INPUT LAYER --============================================================================== local function sendKey(keyCode, isDown) if Backend == "executor" then local vk = VIRTUAL_KEY[keyCode.Name] if not vk then return false end local ok = pcall(function() if isDown then execPress(vk) else execRelease(vk) end end) return ok end if VirtualInputManager then local ok = pcall(function() VirtualInputManager:SendKeyEvent(isDown, keyCode, false, game) end) if ok then return true end -- older engines took three arguments ok = pcall(function() VirtualInputManager:SendKeyEvent(isDown, keyCode, false) end) return ok end return false end local function pressDown(keyCode) return sendKey(keyCode, true) end local function pressUp(keyCode) return sendKey(keyCode, false) end --============================================================================== -- SCHEDULER --============================================================================== local Engine = { gen = 0, startedAt = 0, sessionPresses = 0, lastFireAt = 0, gapSum = 0, gapCount = 0, lastAction = "-", } local rng = Random.new() local function effectiveInterval(entry) if Config.mode == "Adaptive" then if not entry.learned then entry.learned = entry.interval end return math.clamp(entry.learned, Config.adaptiveMin, Config.adaptiveMax) end return entry.interval end local function enemyAllows() -- hysteresis: once engaged, keep firing until the target is a bit further -- out, so a bey drifting on the edge of range does not flicker the gate local pad = Engine.engaged and Config.releasePad or 0 local target, dist = nearestEnemy(Config.enemyRange + pad) Engine.engaged = target ~= nil if target then return true, "" end if dist == math.huge then return false, "no bey near" end return false, string.format("out %.0f", dist) end --============================================================================== -- BEY BRAIN: read the matchup, watch the approach, pick the moment -- -- Beyblade X never sends "attack / defense / stamina" to the client, but the -- dumps already contain two usable hints: the Bit code (Bit_F_0001 -> F) and -- the blade name (VOLT-VALKERION-S). Real bits map to roles, so the role is -- inferred from the bit first, the blade second, a Type attribute third, and -- anything unknown is treated neutrally instead of guessed at. -- -- The model fails open: if it errors, it reports "fire" and the ordinary -- enemy + cooldown checks take over, so a bad read can never silence a key. --============================================================================== local BIT_ROLE = { F = "attack", LF = "attack", LR = "attack", RF = "attack", GF = "attack", UF = "attack", R = "attack", A = "attack", B = "defense", N = "defense", HN = "defense", UN = "defense", BS = "defense", DB = "defense", O = "stamina", Z = "stamina", W = "stamina", U = "stamina", FB = "stamina", T = "balance", P = "balance", H = "balance", GP = "balance", C = "balance", E = "balance", L = "balance", } -- only blades whose role is not in doubt; an unknown name stays unknown local BLADE_ROLE = { VALKERION = "attack", DRAN = "attack", DRAGOON = "attack", SHARK = "attack", TRICERATOPS = "defense", RHINO = "defense", GOLEM = "defense", KNIGHT = "defense", WIZARD = "stamina", UNICORN = "stamina", } -- what each role calls "close enough to spend a skill", and how fast it should -- be pressing while it waits: attack commits early and presses hard, stamina -- waits for the opponent to over-commit, defense only answers something inbound local ROLE_RANGE = { attack = { engage = 42, commit = 20, burst = 12, scale = 0.80 }, defense = { engage = 26, commit = 15, burst = 10, scale = 1.25 }, stamina = { engage = 30, commit = 13, burst = 9, scale = 1.45 }, balance = { engage = 34, commit = 17, burst = 11, scale = 0.95 }, unknown = { engage = 34, commit = 16, burst = 10, scale = 1.00 }, } local Brain = { my = { role = "unknown", name = "?" }, opp = { role = "unknown" }, myRole = "unknown", oppRole = "unknown", dist = math.huge, closing = 0, eta = math.huge, state = "idle", action = "hold", reason = "warming up", urgency = 1, refractory = 0.18, lastFireAt = 0, pressure = 0, profile = "mixer", hits = 0, misses = 0, probeAt = 0, probeDist = 0, probeMax = 0, matchup = {}, oppMove = nil, -- last classified opponent move oppMoveAt = 0, oppSpeed = 0, onUpdate = nil, } local function roleFromLabel(text) local ok, label = pcall(squash, text) if not ok or label == nil or label == "" then return nil end if string.find(label, "attack", 1, true) or string.find(label, "offense", 1, true) then return "attack" end if string.find(label, "defen", 1, true) or string.find(label, "tank", 1, true) then return "defense" end if string.find(label, "stamina", 1, true) or string.find(label, "endur", 1, true) then return "stamina" end if string.find(label, "balance", 1, true) then return "balance" end return nil end -- The game publishes no numbers: the type is an icon. From the item cards, -- blue swirl = attack, green shield = balance, red = defense, orange = stamina. -- If the icon is tinted through ImageColor3 the tint names the type directly; -- if they turn out to be separate white assets, the asset ids get mapped. local ICON_ROLE_CACHE = {} local function roleFromColor(color) if typeof(color) ~= "Color3" then return nil end local r, g, b = color.R, color.G, color.B if math.max(r, g, b) < 0.25 then return nil end if b > r + 0.08 and b > g + 0.08 then return "attack" -- blue swirl end if g > r + 0.08 and g > b + 0.08 then return "balance" -- green shield end if r > 0.45 and g < 0.45 and b < 0.45 then return "defense" -- red end if r > 0.45 and g >= 0.45 and b < 0.45 then return "stamina" -- orange end return nil end -- The cards are white-tinted (verified with BeyProbeIcons), so the colour is -- baked into the icon asset instead of ImageColor3. Every bit of a type shares -- the same asset, so learn it: vote for each asset using bits that are already -- known from the table, and trust only unambiguous winners (>=2 cards, one -- role only). This resolves V, Q, LO and friends without guessing at names. local ICON_ASSET_ROLES = nil local ICON_ASSET_CODE_CACHE = {} -- Ground truth, straight out of ReplicatedStorage.BeyReplicatedAssets.Datas -- .BeyBaseData.BeyTacticsImages. These are the game's own icon ids per tactic: -- Attack 124841890579888 (blue) -- Balance 121445837012197 (red) -- Defence 79562318885964 (green) -- Stamina 114126096778708 (yellow) local TACTIC_ASSET = { ["124841890579888"] = "attack", ["121445837012197"] = "balance", ["79562318885964"] = "defense", ["114126096778708"] = "stamina", } -- Bit -> tactic, read off the item cards in BeyProbeIcons and resolved through -- the table above. This is better evidence than any name lore, so it is -- checked before BIT_ROLE and it corrects entries that were guessed wrong. local BIT_TACTIC = { A = "attack", F = "attack", GF = "attack", LR = "attack", UF = "attack", V = "attack", Q = "attack", T = "balance", E = "balance", UN = "defense", BS = "defense", N = "defense", B = "stamina", DB = "stamina", LO = "stamina", } local SKIP_CARD_CODES = { NEW = true, BIT = true, ATK = true, DEF = true, RES = true, STA = true, END = true, ABC = true, VS = true, OK = true, USE = true, ON = true, OFF = true, } local function collectIconCards() local cards = {} local gui = player and player:FindFirstChild("PlayerGui") if not gui then return cards end local ok, descendants = pcall(function() return gui:GetDescendants() end) if not ok or not descendants then return cards end for _, inst in ipairs(descendants) do local okText, isText = pcall(function() return inst:IsA("TextLabel") or inst:IsA("TextButton") end) if okText and isText then local text = "" pcall(function() text = string.upper(string.gsub(tostring(inst.Text), "%s+", "")) end) if string.match(text, "^%u%u?%u?$") and not SKIP_CARD_CODES[text] then local node = inst for _ = 1, 3 do node = node and node.Parent if not node then break end local okKids, kids = pcall(function() return node:GetDescendants() end) if okKids and kids then local images = {} for _, child in ipairs(kids) do local okIcon, isIcon = pcall(function() return child:IsA("ImageLabel") end) if okIcon and isIcon and #images < 4 then local image = "" pcall(function() image = tostring(child.Image) end) local id = string.match(image, "(%d+)") if id then table.insert(images, id) end end end if #images > 0 then table.insert(cards, { code = text, images = images }) break end end end end end end return cards end local function learnIconAssets() if ICON_ASSET_ROLES ~= nil then return ICON_ASSET_ROLES end local votes = {} for _, card in ipairs(collectIconCards()) do local role = BIT_ROLE[card.code] if role then for _, id in ipairs(card.images) do votes[id] = votes[id] or {} votes[id][role] = (votes[id][role] or 0) + 1 end end end local learned = {} for id, tally in pairs(votes) do local bestRole, bestCount, distinct = nil, 0, 0 for role, count in pairs(tally) do distinct = distinct + 1 if count > bestCount then bestRole, bestCount = role, count end end if bestRole and bestCount >= 2 and distinct == 1 then learned[id] = bestRole end end ICON_ASSET_ROLES = learned return learned end local function assetRoleFor(code) if not Config.iconTypes or code == nil or code == "" or code == "?" then return nil end local cached = ICON_ASSET_CODE_CACHE[code] if cached ~= nil then return cached or nil end local learned = learnIconAssets() local target = string.upper(code) local role = nil for _, card in ipairs(collectIconCards()) do if card.code == target then for _, id in ipairs(card.images) do if TACTIC_ASSET[id] then role = TACTIC_ASSET[id] break end if learned[id] then role = learned[id] break end end end if role then break end end ICON_ASSET_CODE_CACHE[code] = role or false return role end -- find the card that shows this bit code and read its icon tint local function iconRoleFor(code) if not Config.iconTypes or code == nil or code == "" or code == "?" then return nil end local cached = ICON_ROLE_CACHE[code] if cached ~= nil then return cached or nil end local gui = player and player:FindFirstChild("PlayerGui") if not gui then return nil end local ok, descendants = pcall(function() return gui:GetDescendants() end) if not ok or not descendants then return nil end local upper = string.upper(code) local role = nil for _, inst in ipairs(descendants) do local okText, isText = pcall(function() return inst:IsA("TextLabel") or inst:IsA("TextButton") end) if okText and isText then local text = "" pcall(function() text = string.upper(string.gsub(tostring(inst.Text), "%s+", "")) end) if text == upper then local node = inst for _ = 1, 3 do node = node and node.Parent if not node then break end local okIcon, icon = pcall(function() return node:FindFirstChildWhichIsA("ImageLabel", true) end) if okIcon and icon then local color = nil pcall(function() color = icon.ImageColor3 end) role = roleFromColor(color) if role then break end end end end end if role then break end end ICON_ROLE_CACHE[code] = role or false return role end local function roleFromBit(bitName) if bitName == nil then return nil end local ok, code = pcall(function() return string.upper(shortId(bitName, "Bit_")) end) if not ok or code == "" or code == "?" then return nil end -- the item cards are ground truth: their icon resolves through the game's -- own BeyTacticsImages table, so this beats the lore guesses below if BIT_TACTIC[code] then return BIT_TACTIC[code] end if BIT_ROLE[code] then return BIT_ROLE[code] end -- full names ("Bit_Flat_0001") fall back to their first letter local first = string.match(code, "^%a") if first and BIT_ROLE[first] then return BIT_ROLE[first] end -- last resort: the type icon the game draws on that bit's card local iconRole = iconRoleFor(code) if iconRole then return iconRole end return assetRoleFor(code) end local function roleFromBuildName(name) -- this game names the rig after the build: "STEEL SAMURAI 5-70GF" is -- Rachet 5-70 + Bit GF, which matched the build part in the dump local ok, text = pcall(function() return string.upper(tostring(name)) end) if not ok then return nil end local bit = string.match(text, "%d+%-%d+(%a+)$") if bit and BIT_ROLE[bit] then return BIT_ROLE[bit] end return nil end local function roleFromBlade(bladeName) if bladeName == nil then return nil end local ok, name = pcall(function() return string.upper(tostring(bladeName)) end) if not ok or name == "" then return nil end for key, role in pairs(BLADE_ROLE) do if string.find(name, key, 1, true) then return role end end return nil end local function roleFromAttributes(inst) if not inst then return nil end local names = { "Type", "BeyType", "BladeType", "Role", "Category", "BeyRole" } for _, attr in ipairs(names) do local ok, value = pcall(function() return inst:GetAttribute(attr) end) if ok and value ~= nil then local role = roleFromLabel(value) if role then return role end end end return nil end local function myBeyModel() local char = player and player.Character if not char then return nil end local ok, children = pcall(function() return char:GetChildren() end) if not ok or not children then return nil end for _, inst in ipairs(children) do local okModel, isModel = pcall(function() return inst:IsA("Model") end) if okModel and isModel and inst:FindFirstChild("Blade") then return inst end end return nil end -- The build pick is sticky. Re-guessing "nearest part" on every tick is what -- made the bey readout jump between two beys mid-match: the parts sit on the -- arena floor, so their distances cross constantly. local BuildPick = { key = nil, part = nil, confident = false, matchId = nil } local function buildKey(item) return tostring(item.blade) .. "|" .. tostring(item.bit) .. "|" .. tostring(item.ratchet) end local function findMyBuild() local builds = readBuilds() local matchId = nil if player then local ok, value = pcall(function() return player:GetAttribute("CurrentMatchId") end) if ok and type(value) == "string" and value ~= "" and value ~= "None" then matchId = value end end if matchId ~= BuildPick.matchId then BuildPick.matchId = matchId BuildPick.key = nil BuildPick.part = nil BuildPick.confident = false end local mineName = myBeyName() local mineKey = mineName and squash(mineName) or nil if mineKey then for _, item in ipairs(builds) do local bladeKey = squash(shortId(item.blade, "Blade_")) if bladeKey ~= "" and string.find(mineKey, bladeKey, 1, true) then BuildPick.key = buildKey(item) BuildPick.part = item BuildPick.confident = true return item end end end -- hold the previous pick while that part is still in the server if BuildPick.part then for _, item in ipairs(builds) do if buildKey(item) == BuildPick.key then return item end end end -- no rig-name match: take the nearest once, then keep it until it vanishes local guess = builds[1] if guess then BuildPick.key = buildKey(guess) BuildPick.part = guess BuildPick.confident = false end return guess end local function attrOf(inst, name) if not inst then return nil end local ok, value = pcall(function() return inst:GetAttribute(name) end) return ok and value or nil end local function myBeyInfo() local model = myBeyModel() local bladePart = model and model:FindFirstChild("Blade") local build = findMyBuild() local role = nil if Config.myType and Config.myType ~= "auto" then role = Config.myType end if not role then role = roleFromAttributes(bladePart) or roleFromAttributes(model) end if not role and model then -- rig name carries the build ("... 5-70GF" = Bit GF) role = roleFromBuildName(model.Name) end if not role then -- the game may mirror the equipped build onto my own blade part role = roleFromBit(attrOf(bladePart, "BitId")) or roleFromBlade(attrOf(bladePart, "BladeId")) end if not role and build then role = roleFromBit(build.bit) or roleFromBlade(build.blade) end if not role and model then role = roleFromBlade(model.Name) end local bitText = shortId(attrOf(bladePart, "BitId") or (build and build.bit) or "?", "Bit_") local bladeText = shortId( attrOf(bladePart, "BladeId") or (build and build.blade) or (model and model.Name) or "?", "Blade_" ) local name = (model and model.Name) or myBeyName() or bladeText return { name = name, blade = bladeText, bit = bitText, role = role or "unknown", } end local function opponentBeyInfo() local builds = readBuilds() local mine = findMyBuild() -- compare by key, not by table identity: readBuilds() returns fresh tables, -- so "item ~= mine" was true for my own part and the pick was arbitrary local mineKey = mine and buildKey(mine) or nil local pick = nil for _, item in ipairs(builds) do if buildKey(item) ~= mineKey then pick = item break end end if not pick then return { role = "unknown", blade = "?", bit = "?" } end local role = roleFromBit(pick.bit) or roleFromBlade(pick.blade) or "unknown" return { blade = shortId(pick.blade, "Blade_"), bit = shortId(pick.bit, "Bit_"), role = role, } end -- Role readout hysteresis: one odd read (missing attribute, part swap) must -- not make the pill jump. It takes three agreeing reads to change a role. local ROLE_STABLE = { my = nil, myN = 0, opp = nil, oppN = 0 } local function stableRole(slot, role) if type(role) ~= "string" or role == "" then role = "unknown" end local seen = ROLE_STABLE[slot] if seen == nil then ROLE_STABLE[slot] = role ROLE_STABLE[slot .. "N"] = 0 return role end if role == seen then ROLE_STABLE[slot .. "N"] = 0 return seen end local count = (ROLE_STABLE[slot .. "N"] or 0) + 1 ROLE_STABLE[slot .. "N"] = count if count >= 3 then ROLE_STABLE[slot] = role ROLE_STABLE[slot .. "N"] = 0 return role end return seen end --============================================================================== -- OPPONENT MOVE PROBE -- Two channels a client can actually see: -- 1. the opponent bey's root motion - speed spike, sharp turn, speed collapse -- 2. Condition_* attributes on that bey - a condition turning active is the -- nearest thing this client gets to "they pressed a skill" -- It classifies a move and the brain answers it. Nothing here reads memory or -- touches remotes; every signal is read-only replication. --============================================================================== local Opp = { at = 0, pos = nil, dir = nil, attrs = nil, window = nil, peak = 0, base = nil } local function oppRoot(target) if not target then return nil end local ok, isPlayer = pcall(function() return target:IsA("Player") end) if ok and isPlayer then return getRoot(target.Character) end local okModel, model = pcall(function() return target.PrimaryPart or target:FindFirstChildWhichIsA("BasePart", true) end) if okModel then return model end return nil end -- true when a Condition_* value on the bey (or its rig) becomes active, or -- changes to a new value. The first call only seeds the snapshot. local function conditionFlipped(root) local seen = {} local flipped = false local insts = { root } local parent = root and root.Parent if parent then table.insert(insts, parent) end for _, inst in ipairs(insts) do local ok, attrs = pcall(function() return inst:GetAttributes() end) if ok and type(attrs) == "table" then for name, value in pairs(attrs) do if type(name) == "string" and string.sub(name, 1, 10) == "Condition_" and value ~= nil and value ~= false and value ~= 0 then seen[name] = value if Opp.attrs and Opp.attrs[name] ~= value then flipped = true end end end end end Opp.attrs = seen return flipped end local function probeOpponent(target) if not Config.counterMoves then return end local now = os.clock() local root = oppRoot(target) if not root then Opp.pos, Opp.dir, Opp.window, Opp.peak = nil, nil, nil, 0 return end local ok, pos = pcall(function() return root.Position end) if not ok or typeof(pos) ~= "Vector3" then Opp.pos = nil return end if conditionFlipped(root) then Brain.oppMove, Brain.oppMoveAt = "skill", now end local dt = now - (Opp.at or now) if not Opp.pos or dt < 0.03 then Opp.pos, Opp.at = pos, now return end local delta = pos - Opp.pos local speed = delta.Magnitude / dt if Opp.base == nil then Opp.base = speed end -- cruise: ignore spikes, otherwise a dash would redefine "normal" if speed < (Opp.base or 0) * 1.6 then Opp.base = (Opp.base or 0) + (speed - (Opp.base or 0)) * 0.08 end local burst = speed > math.max((Opp.base or 0) * 1.8, (Opp.base or 0) + 16) if burst then Opp.peak = math.max(Opp.peak or 0, speed) Opp.window = Opp.window or now if (Brain.closing or 0) > 3 then Brain.oppMove, Brain.oppMoveAt = "dash", now elseif (Brain.closing or 0) < -3 then Brain.oppMove, Brain.oppMoveAt = "retreat", now end end -- sharp direction change while already moving: they slipped the line if delta.Magnitude > 0.6 then local unit = delta.Unit if Opp.dir and unit:Dot(Opp.dir) < -0.2 and (Opp.base or 0) > 8 then Brain.oppMove, Brain.oppMoveAt = "turn", now end Opp.dir = unit end -- their burst just died: recovery frames, the punish window if Opp.window then local age = now - Opp.window if age > 0.25 and age < 1.1 then if speed < math.max((Opp.base or 0) * 1.15, 6) and (Opp.peak or 0) > (Opp.base or 0) * 1.8 then Brain.oppMove, Brain.oppMoveAt = "stall", now Opp.window, Opp.peak = nil, 0 end elseif age >= 1.1 then Opp.window, Opp.peak = nil, 0 end end Brain.oppSpeed = speed Opp.pos, Opp.at = pos, now end -- distance, closing speed, time to contact: "is the opponent coming at me" local function brainSense() local target, dist = nearestEnemy(Config.brainRange) local now = os.clock() local dt = now - (Brain.sensedAt or now) if dt >= 0.02 then if Brain.dist ~= math.huge and dist ~= math.huge then local instant = (Brain.dist - dist) / dt Brain.closing = (Brain.closing * 0.55) + (instant * 0.45) elseif dist == math.huge then Brain.closing = 0 end Brain.sensedAt = now -- opponent profile: EMA of closing speed. A rusher keeps closing, a -- camper drifts away, a mixer does both. This decides whether waiting -- for an approach is worth anything at all. local sample = math.clamp((Brain.closing or 0) / 12, -1, 1) Brain.pressure = ((Brain.pressure or 0) * 0.97) + (sample * 0.03) if Brain.pressure > 0.3 then Brain.profile = "rusher" elseif Brain.pressure < -0.2 then Brain.profile = "camper" else Brain.profile = "mixer" end -- Did the last fire land? A landed hit kicks the other bey away, so the -- distance jumps up inside the next three quarters of a second. That is -- the only hit signal a client gets, and it is enough to keep score. if Brain.probeAt and Brain.probeAt > 0 then if dist ~= math.huge and dist > (Brain.probeMax or 0) then Brain.probeMax = dist end if now - Brain.probeAt >= 0.75 then local gain = (Brain.probeMax or 0) - (Brain.probeDist or 0) local key = Brain.probeKey or (tostring(Brain.myRole or "unknown") .. "|" .. tostring(Brain.oppRole or "unknown")) local record = Brain.matchup[key] if not record then record = { hits = 0, misses = 0 } Brain.matchup[key] = record end if gain >= 7 then record.hits = record.hits + 1 Brain.hits = (Brain.hits or 0) + 1 else record.misses = record.misses + 1 Brain.misses = (Brain.misses or 0) + 1 end Brain.probeAt = 0 Brain.probeMax = 0 end end end Brain.target = target Brain.dist = dist if dist ~= math.huge and Brain.closing > 0.5 then Brain.eta = dist / Brain.closing else Brain.eta = math.huge end -- read what the opponent is doing with that distance probeOpponent(target) end local function brainDecide() local myRole = (Brain.my and Brain.my.role) or "unknown" local oppRole = (Brain.opp and Brain.opp.role) or "unknown" local rule = ROLE_RANGE[myRole] or ROLE_RANGE.unknown -- a camper never walks into you, so "wait for the approach" is a losing -- plan against one: tighten the distance thresholds by 15% instead local closer = Brain.profile == "camper" and 0.85 or 1 -- matchup memory: a pairing that keeps missing gets engaged closer, one -- that keeps landing is allowed to fire from slightly further out local record = Brain.matchup[tostring(myRole) .. "|" .. tostring(oppRole)] local accuracy = 1 if record then local total = record.hits + record.misses if total >= 3 then accuracy = 1 + (0.12 * ((record.hits - record.misses) / total)) end end local commitAt = (rule.commit or 30) * closer * accuracy local burstAt = (rule.burst or 20) * closer * accuracy local dist = Brain.dist local eta = Brain.eta local closing = Brain.closing local lead = Config.leadTime local state, action, reason = "idle", "hold", "no target" if not inBattle() then state, action, reason = "idle", "hold", "in lobby" elseif GameState.roundLive == false then state, action, reason = "idle", "hold", "round over" elseif not Brain.target or dist == math.huge then state, action, reason = "idle", "hold", "no bey near" elseif dist > rule.engage then state, action, reason = "watch", "hold", "out of range" else local incoming = (closing > 2.5 and eta < 900 and eta <= (lead + 0.6)) or (Brain.profile == "rusher" and dist <= commitAt) if closing < -3 and dist > burstAt then -- they are disengaging: a burst now lands on an empty stadium state, action, reason = "watch", "hold", "they are running" elseif myRole == "attack" then -- do not feed a wall: wait until the defense commits, then burst if oppRole == "defense" and Config.burstWindow and not incoming then state, action, reason = "pressure", "hold", "waiting out defense" elseif dist <= burstAt or (incoming and eta <= lead) then state, action, reason = "burst", "fire", "all in" elseif dist <= commitAt then state, action, reason = "commit", "fire", "in range" else state, action, reason = "pressure", "hold", "closing" end elseif myRole == "stamina" then -- stay calm, let them commit, punish the commitment if incoming and eta <= lead then state, action, reason = "commit", "fire", "they committed" elseif dist <= burstAt and closing > 4 then state, action, reason = "commit", "fire", "counter" else state, action, reason = "pressure", "hold", "holding centre" end elseif myRole == "defense" then if dist <= burstAt then state, action, reason = "burst", "fire", "blocking" elseif incoming and eta <= (lead + 0.1) then state, action, reason = "commit", "fire", "incoming" else state, action, reason = "pressure", "hold", "set" end elseif myRole == "balance" then if oppRole == "attack" then if incoming and eta <= (lead + 0.05) then state, action, reason = "commit", "fire", "counter" elseif dist <= burstAt then state, action, reason = "burst", "fire", "tight" else state, action, reason = "pressure", "hold", "baiting" end elseif dist <= commitAt or (incoming and eta <= lead) then state, action, reason = "commit", "fire", "pressuring" else state, action, reason = "pressure", "hold", "stalking" end else if dist <= burstAt or (incoming and eta <= lead) then state, action, reason = "commit", "fire", "contact" elseif dist <= commitAt then state, action, reason = "commit", "fire", "range" else state, action, reason = "pressure", "hold", "closing" end end end -- OPPONENT MOVE REACTION: the probe says what they just did, so answer it. -- A dash is a trade only taken when already loaded and in burst range; a -- turn or retreat is a whiff waiting to happen, so the shot is held; a stall -- is their recovery window and the best moment to spend the skill. local move = Brain.oppMove local moveAge = os.clock() - (Brain.oppMoveAt or 0) if Config.counterMoves and move and moveAge < 1.0 then if move == "stall" or move == "skill" then if dist ~= math.huge and dist <= commitAt then state, action, reason = "commit", "fire", "punishing recovery" end elseif move == "dash" then if dist ~= math.huge and dist <= burstAt and (closing or 0) > 0 then state, action, reason = "burst", "fire", "counter dash" elseif action == "fire" then -- do not feed their dash: hold and let it pass state, action, reason = "watch", "hold", "dodging dash" end elseif move == "turn" or move == "retreat" then if action == "fire" then state, action, reason = "watch", "hold", "they slipped out" end end end if not Config.burstWindow and state == "burst" then state = "commit" end -- never lose a round by doing nothing: skill ready, enemy already in commit -- range, and nothing fired for a while means take the shot if action == "hold" and dist ~= math.huge and dist <= commitAt then if (os.clock() - (Brain.lastFireAt or 0)) > 1.6 then state, action, reason = "commit", "fire", "stale pressure" end end -- score awareness: this HUD is first to 4 (Score...Max reads "/4"). -- behind or facing their match point means press harder; sitting on my -- own match point means do not throw the round away. local myScore = GameState.myScore local oppScore = GameState.oppScore local target = GameState.scoreTarget or 4 -- accuracy is the learned matchup hit rate: a pairing that lands gets driven -- harder, one that keeps missing eases off Brain.urgency = accuracy if myScore and oppScore then if oppScore >= target - 1 and oppScore > myScore then Brain.urgency = accuracy * 1.3 elseif myScore < oppScore then Brain.urgency = accuracy * 1.15 elseif myScore >= target - 1 then Brain.urgency = accuracy * 0.85 end end -- a new round resets everything: do not fire into the transition local scoreTag = tostring(myScore) .. ":" .. tostring(oppScore) if Brain.scoreTag ~= nil and Brain.scoreTag ~= scoreTag then Brain.roundAt = os.clock() -- The score is the ONLY round-end truth this client gets: BeyProbeFinish -- showed no burst flag, no finish type, no running/stop state, no result -- GUI toggle. A point scored soon after a fire is therefore the best -- hit signal that exists, and it beats the knockback guess. if myScore and Brain.lastMyScore and myScore > Brain.lastMyScore and (os.clock() - (Brain.lastFireAt or 0)) <= 5 and Brain.probeKey then local scored = Brain.matchup[Brain.probeKey] if not scored then scored = { hits = 0, misses = 0 } Brain.matchup[Brain.probeKey] = scored end scored.hits = scored.hits + 1 Brain.hits = (Brain.hits or 0) + 1 Brain.scored = (Brain.scored or 0) + 1 -- already credited, so do not also count the knockback probe Brain.probeAt = 0 end end Brain.scoreTag = scoreTag Brain.lastMyScore, Brain.lastOppScore = myScore, oppScore if Brain.roundAt and (os.clock() - Brain.roundAt) < 0.7 then state, action, reason = "idle", "hold", "round reset" end Brain.state, Brain.action, Brain.reason = state, action, reason Brain.myRole, Brain.oppRole = myRole, oppRole Brain.rule = rule end -- how much to stretch the press interval: burst presses fast, watching waits local function brainIntervalScale() if not Config.smartDetect or not Config.adaptType then return 1 end local rule = Brain.rule or ROLE_RANGE[Brain.myRole or "unknown"] or ROLE_RANGE.unknown local scale = rule.scale or 1 if Brain.state == "burst" then scale = scale * 0.55 elseif Brain.state == "commit" then scale = scale * 0.85 elseif Brain.state == "watch" then scale = scale * 1.8 end local drive = math.clamp((Config.aggression or 1) * (Brain.urgency or 1), 0.25, 3) scale = scale / drive return math.clamp(scale, 0.3, 3) end local function cooldownAllows(entry) local ready = cooldownState(entry.keyCode.Name) if ready == nil or ready == true then return true, "" end return false, "cooling" end local function gateAllows(entry) if Config.battleOnly and inBattle() == false then return false, "in lobby" end if not Config.smartDetect then return true, "" end if not isAlive() then return false, "dead" end -- the round is already decided (bey stopped, scoreboard hidden, or a -- finish popup is up): every press from here is wasted cooldown if GameState.roundLive == false then return false, "round over" end local gate = entry.gate if gate == "Always" then return true, "" elseif gate == "Prompt" then local ok = trackerAny() if ok then return true, "" end -- safety net: a game that has never shown a prompt should not be -- starved forever, so fall back to blind pressing after 20s if Config.promptFallback and not Tracker.everSeen and (os.clock() - Engine.startedAt) > PROMPT_FALLBACK_AFTER then return true, "fallback" end return false, "no prompt" elseif gate == "Enemy" then return enemyAllows() elseif gate == "Enemy+Skill" then local okEnemy, whyEnemy = enemyAllows() if not okEnemy then return false, whyEnemy end return cooldownAllows(entry) elseif gate == "Skill" then return cooldownAllows(entry) elseif gate == "Brain" then local okCool, whyCool = cooldownAllows(entry) if not okCool then return false, whyCool end if not Config.adaptType then return enemyAllows() end if Brain.action == "fire" then -- one press per skill animation: without this the burst state -- re-presses R every interval and every press after the first is -- thrown away by the game if os.clock() - (Brain.lastFireAt or 0) < (Brain.refractory or 0.18) then return false, "recovering" end return true, "" end return false, Brain.state elseif gate == "Tool" then if hasTool() then return true, "" end return false, "no tool" elseif gate == "Idle" then if isBusy() then return false, "busy" end return true, "" end return true, "" end local function learn(entry, direction) local base = entry.learned or entry.interval if direction > 0 then entry.learned = math.min(Config.adaptiveMax, base + Config.learnStep) else entry.learned = math.max(Config.adaptiveMin, base - (Config.learnStep * 0.5)) end end local function doPress(entry, gen) local aimedAtPrompt = false local versionAtPress = Tracker.version if entry.gate == "Prompt" then local ok = trackerAny() aimedAtPrompt = ok end local delivered = pressDown(entry.keyCode) if entry.hold > 0 then task.wait(entry.hold) end pressUp(entry.keyCode) if delivered then entry.presses = entry.presses + 1 Engine.sessionPresses = Engine.sessionPresses + 1 local now = os.clock() if Engine.lastFireAt > 0 then Engine.gapSum = Engine.gapSum + (now - Engine.lastFireAt) Engine.gapCount = Engine.gapCount + 1 end Engine.lastFireAt = now if entry.gate == "Brain" then Brain.lastFireAt = now Brain.probeAt = now Brain.probeDist = Brain.dist or 0 Brain.probeMax = Brain.probeDist Brain.probeKey = tostring(Brain.myRole or "unknown") .. "|" .. tostring(Brain.oppRole or "unknown") end Engine.lastAction = string.format("%s pressed (%.2fs)", entry.keyCode.Name, effectiveInterval(entry)) end -- feed the learner: did the prompt close / advance, or is it still sitting there? if delivered and aimedAtPrompt and Config.mode == "Adaptive" and Config.smartDetect then task.delay(Config.probeWindow, function() if gen ~= Engine.gen then return end local stillThere = trackerAny() local progressed = (Tracker.version > versionAtPress) or not stillThere if progressed then learn(entry, -1) else learn(entry, 1) end end) end end local function keyLoop(entry, gen) local firstDelay = 0.15 entry.nextAt = os.clock() + firstDelay while Config.running and gen == Engine.gen do -- sleep in chunks so Stop is instant and so the loop survives restarts while true do local remaining = entry.nextAt - os.clock() if remaining <= 0 then break end if not Config.running or gen ~= Engine.gen then return end task.wait(math.min(remaining, 0.2)) end if not Config.running or gen ~= Engine.gen then return end local target = entry.nextAt local firedAt = os.clock() entry.drift = (firedAt - target) * 1000 if entry.enabled then local allowed, reason = gateAllows(entry) if allowed then entry.status = reason == "fallback" and "pressing (no prompts)" or "pressing" doPress(entry, gen) else entry.skipped = entry.skipped + 1 entry.status = "skipped: " .. reason end else entry.status = "off" end -- absolute-clock scheduling: advance from the target, never from "now", -- so a late frame is a one-off delay and not permanent drift local interval = effectiveInterval(entry) * brainIntervalScale() if Config.jitter > 0 then interval = interval + rng:NextNumber(-Config.jitter, Config.jitter) interval = math.max(0.05, interval) end entry.nextAt = target + interval if entry.nextAt < os.clock() then -- long stall (tab out, lag spike): resync instead of machine-gunning entry.nextAt = os.clock() + interval end end end local function setRunning(state) if Config.running == state then return end Config.running = state if state then Engine.gen = Engine.gen + 1 Engine.startedAt = os.clock() Engine.lastFireAt = 0 Engine.gapSum = 0 Engine.gapCount = 0 local gen = Engine.gen for _, entry in ipairs(Keys) do entry.status = "armed" task.spawn(keyLoop, entry, gen) end else Engine.gen = Engine.gen + 1 for _, entry in ipairs(Keys) do entry.status = "idle" end end end --============================================================================== -- GUI --============================================================================== local old = nil if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" then old = env.__SmartKeys end end if old then pcall(function() old:Destroy() end) end local function guiParent() if type(gethui) == "function" then local ok, hui = pcall(gethui) if ok and hui then return hui end end local ok, core = pcall(function() return game:GetService("CoreGui") end) if ok and core then return core end return player:WaitForChild("PlayerGui") end -- cosmic palette: deep space base, indigo panels, cyan/violet/magenta accents local BG = Color3.fromRGB(6, 5, 18) local PANEL = Color3.fromRGB(16, 14, 34) local PANEL2 = Color3.fromRGB(25, 22, 50) local PANEL3 = Color3.fromRGB(36, 32, 70) local LINE = Color3.fromRGB(60, 54, 104) local TEXT = Color3.fromRGB(238, 241, 255) local MUTED = Color3.fromRGB(150, 152, 190) local ACCENT = Color3.fromRGB(110, 240, 255) local ACCENT2 = Color3.fromRGB(186, 132, 255) local ACCENT3 = Color3.fromRGB(255, 120, 214) local WARN = Color3.fromRGB(255, 200, 120) local DANGER = Color3.fromRGB(255, 104, 140) local function create(class, props, parent) local obj = Instance.new(class) for key, value in pairs(props) do obj[key] = value end if parent then obj.Parent = parent end return obj end local function corner(parent, radius) return create("UICorner", { CornerRadius = UDim.new(0, radius or 8) }, parent) end local function stroke(parent, color, thickness) return create("UIStroke", { Color = color or LINE, Thickness = thickness or 1, ApplyStrokeMode = Enum.ApplyStrokeMode.Border, }, parent) end local function gradient(parent, top, bottom, rotation) return create("UIGradient", { Color = ColorSequence.new(top, bottom), Rotation = rotation or 90, }, parent) end local screen = create("ScreenGui", { Name = "SmartKeys", ResetOnSpawn = false, ZIndexBehavior = Enum.ZIndexBehavior.Sibling, DisplayOrder = 999, IgnoreGuiInset = true, }, guiParent()) if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" then env.__SmartKeys = screen end end local shadow = create("Frame", { Name = "Shadow", Size = UDim2.new(0, 620, 0, 470), Position = UDim2.new(0.5, -310, 0.5, -229), BackgroundColor3 = Color3.fromRGB(0, 0, 0), BackgroundTransparency = 0.5, BorderSizePixel = 0, ZIndex = 1, }, screen) corner(shadow, 24) local window = create("Frame", { Name = "Window", Size = UDim2.new(0, 620, 0, 470), Position = UDim2.new(0.5, -310, 0.5, -235), BackgroundColor3 = BG, BorderSizePixel = 0, ZIndex = 2, }, screen) corner(window, 20) gradient(window, Color3.fromRGB(22, 17, 46), Color3.fromRGB(3, 3, 10), 90) -- COSMIC BACKDROP: procedural nebula + two parallax star layers + meteors, all -- Frames, so it is resolution independent (same at 1080p or 4K) and cannot break -- when an uploaded image asset goes missing. local space = create("Frame", { Name = "Space", Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, BorderSizePixel = 0, ClipsDescendants = true, ZIndex = 0, }, window) corner(space, 20) local nebula = create("Frame", { Size = UDim2.new(1, 240, 1, 240), Position = UDim2.new(0, -120, 0, -120), BackgroundColor3 = ACCENT2, BackgroundTransparency = 0.9, BorderSizePixel = 0, ZIndex = 0, }, space) corner(nebula, 999) local nebulaGrad = create("UIGradient", { Color = ColorSequence.new({ ColorSequenceKeypoint.new(0, Color3.fromRGB(108, 64, 236)), ColorSequenceKeypoint.new(0.5, Color3.fromRGB(26, 82, 198)), ColorSequenceKeypoint.new(1, Color3.fromRGB(214, 74, 196)), }), Rotation = 20, Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.45), NumberSequenceKeypoint.new(0.5, 0.92), NumberSequenceKeypoint.new(1, 0.5), }), }, nebula) task.spawn(function() while screen.Parent do TweenService:Create(nebulaGrad, TweenInfo.new(16, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Rotation = 200 }):Play() task.wait(16) TweenService:Create(nebulaGrad, TweenInfo.new(16, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Rotation = 20 }):Play() task.wait(16) end end) local stars = {} local function sky(count, size, drift, faint) local layer = create("Frame", { Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, BorderSizePixel = 0, ZIndex = 0, }, space) for i = 1, count do local tint = Color3.fromRGB(255, 255, 255) if i % 5 == 0 then tint = ACCENT elseif i % 7 == 0 then tint = ACCENT2 elseif i % 11 == 0 then tint = ACCENT3 end local star = create("Frame", { Size = UDim2.new(0, size, 0, size), Position = UDim2.new(math.random(), 0, math.random(), 0), BackgroundColor3 = tint, BackgroundTransparency = faint + math.random() * 0.45, BorderSizePixel = 0, ZIndex = 0, }, layer) if size >= 2 then corner(star, size) end table.insert(stars, { obj = star, phase = math.random() * 6.283, speed = 0.6 + math.random() * 1.8, base = star.BackgroundTransparency, }) end -- parallax: the two layers drift at different speeds, which reads as depth task.spawn(function() while screen.Parent do TweenService:Create(layer, TweenInfo.new(drift, Enum.EasingStyle.Linear), { Position = UDim2.new(0, -24, 0, -6) }):Play() task.wait(drift) TweenService:Create(layer, TweenInfo.new(drift, Enum.EasingStyle.Linear), { Position = UDim2.new(0, 0, 0, 0) }):Play() task.wait(drift) end end) end sky(46, 1, 12, 0.2) sky(26, 2, 8, 0.1) -- one twinkle loop for the whole sky instead of a tween per star task.spawn(function() local t = 0 while screen.Parent do t = t + 0.1 for _, star in ipairs(stars) do if star.obj.Parent then local wave = (math.sin(t * star.speed + star.phase) + 1) * 0.5 star.obj.BackgroundTransparency = math.clamp(star.base - wave * 0.28, 0, 1) end end task.wait(0.1) end end) -- an occasional meteor, so the sky is alive rather than only twinkling task.spawn(function() while screen.Parent do task.wait(9 + math.random() * 8) local meteor = create("Frame", { Size = UDim2.new(0, 96, 0, 2), BackgroundColor3 = Color3.fromRGB(255, 255, 255), BackgroundTransparency = 0.2, BorderSizePixel = 0, Rotation = 26, ZIndex = 0, }, space) corner(meteor, 1) create("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 255, 255), ACCENT2), Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1), NumberSequenceKeypoint.new(1, 0.05), }), }, meteor) local sx = 0.05 + math.random() * 0.45 meteor.Position = UDim2.new(sx, 0, -0.05, 0) TweenService:Create(meteor, TweenInfo.new(1.2, Enum.EasingStyle.Quad, Enum.EasingDirection.In), { Position = UDim2.new(sx + 0.5, 0, 0.8, 0), BackgroundTransparency = 1, }):Play() task.delay(1.3, function() meteor:Destroy() end) end end) local rail = create("Frame", { Name = "Rail", Size = UDim2.new(0, 4, 1, -44), Position = UDim2.new(0, 0, 0, 22), BackgroundColor3 = ACCENT, BorderSizePixel = 0, }, window) corner(rail, 2) gradient(rail, ACCENT, ACCENT2, 90) local winScale = create("UIScale", { Scale = 0.94 }, window) TweenService:Create( winScale, TweenInfo.new(0.24, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), { Scale = 1 } ):Play() local windowEdge = stroke(window, LINE, 1) gradient(windowEdge, Color3.fromRGB(74, 82, 108), Color3.fromRGB(28, 31, 42), 90) local rim = stroke(window, ACCENT2, 2) rim.Transparency = 0.9 -- sidebar shell: the window is landscape and every control lives in a left -- rail, so the silhouette is nothing like the old tall card local header = create("Frame", { Name = "Sidebar", Size = UDim2.new(0, 132, 1, 0), Position = UDim2.new(0, 0, 0, 0), BackgroundColor3 = PANEL, BorderSizePixel = 0, }, window) corner(header, 18) gradient(header, Color3.fromRGB(30, 25, 62), Color3.fromRGB(10, 9, 26), 90) create("Frame", { Size = UDim2.new(1, 0, 0, 16), Position = UDim2.new(0, 0, 1, -16), BackgroundColor3 = PANEL, BorderSizePixel = 0, }, header) local underline = create("Frame", { Size = UDim2.new(0, 2, 1, -44), Position = UDim2.new(1, -2, 0, 22), BackgroundColor3 = ACCENT, BorderSizePixel = 0, }, header) corner(underline, 1) gradient(underline, ACCENT, ACCENT2, 0) local underlineGradient = underline:FindFirstChildOfClass("UIGradient") if underlineGradient then task.spawn(function() while screen.Parent do TweenService:Create( underlineGradient, TweenInfo.new(3, Enum.EasingStyle.Linear), { Rotation = underlineGradient.Rotation + 180 } ):Play() task.wait(3) end end) end local dotGlow = create("Frame", { Size = UDim2.new(0, 16, 0, 16), Position = UDim2.new(0, 14, 0, 74), BackgroundColor3 = DANGER, BackgroundTransparency = 0.82, BorderSizePixel = 0, }, header) corner(dotGlow, 8) local dot = create("Frame", { Size = UDim2.new(0, 8, 0, 8), Position = UDim2.new(0, 18, 0, 78), BackgroundColor3 = DANGER, BorderSizePixel = 0, }, header) corner(dot, 4) local dotPulse = create("UIScale", { Scale = 1 }, dotGlow) task.spawn(function() while screen.Parent do TweenService:Create( dotPulse, TweenInfo.new(0.9, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Scale = 1.35 } ):Play() task.wait(0.9) TweenService:Create( dotPulse, TweenInfo.new(0.9, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Scale = 1 } ):Play() task.wait(0.9) end end) create("TextLabel", { Size = UDim2.new(0, 112, 0, 36), Position = UDim2.new(0, 14, 0, 14), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "BEYBLADE\nX BATTLES", TextColor3 = TEXT, TextSize = 14, TextWrapped = true, TextXAlignment = Enum.TextXAlignment.Left, TextYAlignment = Enum.TextYAlignment.Top, }, header) create("TextLabel", { Size = UDim2.new(0, 112, 0, 12), Position = UDim2.new(0, 14, 0, 54), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = Backend, TextColor3 = MUTED, TextSize = 9, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, header) local hotkeyBtn = create("TextButton", { Size = UDim2.new(0, 100, 0, 22), Position = UDim2.new(0, 16, 0, 96), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamMedium, Text = "RSHIFT", TextColor3 = MUTED, TextSize = 11, }, header) corner(hotkeyBtn, 6) stroke(hotkeyBtn, LINE, 1) local closeBtn = create("TextButton", { Size = UDim2.new(0, 24, 0, 22), Position = UDim2.new(0, 16, 1, -122), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = "x", TextColor3 = MUTED, TextSize = 12, }, window) corner(closeBtn, 6) stroke(closeBtn, LINE, 1) -- tab bar ------------------------------------------------------------------- local TAB_NAMES = { "LIVE", "KEYS", "TUNE", "STATS", "CFG" } local tabBar = create("Frame", { Name = "Tabs", Size = UDim2.new(0, 132, 0, 190), Position = UDim2.new(0, 0, 0, 126), BackgroundTransparency = 1, BorderSizePixel = 0, }, window) create("UIPadding", { PaddingTop = UDim.new(0, 6), PaddingLeft = UDim.new(0, 16), PaddingRight = UDim.new(0, 16), }, tabBar) create("UIListLayout", { FillDirection = Enum.FillDirection.Vertical, Padding = UDim.new(0, 6), HorizontalAlignment = Enum.HorizontalAlignment.Center, }, tabBar) local body = create("Frame", { Name = "Body", Size = UDim2.new(1, -132, 1, 0), Position = UDim2.new(0, 132, 0, 0), BackgroundTransparency = 1, BorderSizePixel = 0, }, window) local pages = {} local tabButtons = {} local activePage = nil for index, tabName in ipairs(TAB_NAMES) do local page = create("ScrollingFrame", { Name = tabName .. "Page", Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, BorderSizePixel = 0, CanvasSize = UDim2.new(0, 0, 0, 0), AutomaticCanvasSize = Enum.AutomaticSize.Y, ScrollBarThickness = 3, ScrollBarImageColor3 = LINE, ScrollBarImageTransparency = 0.4, Visible = false, }, body) create("UIPadding", { PaddingTop = UDim.new(0, 16), PaddingBottom = UDim.new(0, 16), PaddingLeft = UDim.new(0, 16), PaddingRight = UDim.new(0, 16), }, page) create("UIListLayout", { FillDirection = Enum.FillDirection.Vertical, SortOrder = Enum.SortOrder.LayoutOrder, Padding = UDim.new(0, 12), }, page) pages[index] = page local btn = create("TextButton", { Size = UDim2.new(0, 100, 0, 28), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = tabName, TextColor3 = MUTED, TextSize = 10, }, tabBar) corner(btn, 7) stroke(btn, LINE, 1) tabButtons[index] = btn end local function showTab(index) activePage = pages[index] for i, page in ipairs(pages) do page.Visible = i == index end for i, btn in ipairs(tabButtons) do local on = i == index TweenService:Create(btn, TweenInfo.new(0.16), { TextColor3 = on and Color3.fromRGB(205, 248, 255) or MUTED, BackgroundColor3 = on and Color3.fromRGB(26, 34, 66) or PANEL2, }):Play() end end for index, btn in ipairs(tabButtons) do btn.MouseButton1Click:Connect(function() showTab(index) end) end showTab(1) local function sectionTitle(text, order) local row = create("Frame", { Size = UDim2.new(1, 0, 0, 22), BackgroundTransparency = 1, LayoutOrder = order, }, activePage) local dash = create("Frame", { Size = UDim2.new(0, 3, 0, 11), Position = UDim2.new(0, 0, 0.5, -5), BackgroundColor3 = ACCENT, BorderSizePixel = 0, }, row) corner(dash, 2) gradient(dash, ACCENT, ACCENT2, 90) create("TextLabel", { Size = UDim2.new(1, -14, 1, 0), Position = UDim2.new(0, 10, 0, 0), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = string.upper(text), TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, }, row) return row end local function card(order, height) local frame = create("Frame", { Size = UDim2.new(1, 0, 0, height), BackgroundColor3 = PANEL, BorderSizePixel = 0, LayoutOrder = order, }, activePage) corner(frame, 14) gradient(frame, PANEL, Color3.fromRGB(8, 7, 20), 90) local edge = stroke(frame, LINE, 1) gradient(edge, Color3.fromRGB(66, 74, 96), Color3.fromRGB(32, 35, 47), 90) frame.MouseEnter:Connect(function() TweenService:Create(edge, TweenInfo.new(0.16), { Color = ACCENT2, Transparency = 0.15 }):Play() end) frame.MouseLeave:Connect(function() TweenService:Create(edge, TweenInfo.new(0.16), { Color = LINE, Transparency = 0 }):Play() end) create("Frame", { Size = UDim2.new(1, -24, 0, 1), Position = UDim2.new(0, 12, 0, 1), BackgroundColor3 = Color3.fromRGB(255, 255, 255), BackgroundTransparency = 0.9, BorderSizePixel = 0, }, frame) return frame end local function labelRow(parent, text, y, color, bold) return create("TextLabel", { Size = UDim2.new(0, 200, 0, 18), Position = UDim2.new(0, 14, 0, y), BackgroundTransparency = 1, Font = bold and Enum.Font.GothamBold or Enum.Font.Gotham, Text = text, TextColor3 = color or TEXT, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Left, }, parent) end -- pill toggle ---------------------------------------------------------------- local function makeToggle(parent, y, getValue, setValue) local pill = create("TextButton", { Size = UDim2.new(0, 42, 0, 22), Position = UDim2.new(1, -56, 0, y), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Text = "", }, parent) corner(pill, 11) local knob = create("Frame", { Size = UDim2.new(0, 16, 0, 16), Position = UDim2.new(0, 3, 0.5, -8), BackgroundColor3 = MUTED, BorderSizePixel = 0, }, pill) corner(knob, 8) local function render(animate) local on = getValue() local goalPos = on and UDim2.new(0, 23, 0.5, -8) or UDim2.new(0, 3, 0.5, -8) local goalColor = on and ACCENT or MUTED if animate then TweenService:Create(knob, TweenInfo.new(0.15), { Position = goalPos, BackgroundColor3 = goalColor }):Play() TweenService:Create(pill, TweenInfo.new(0.15), { BackgroundColor3 = on and Color3.fromRGB(38, 62, 48) or PANEL2, }):Play() else knob.Position = goalPos knob.BackgroundColor3 = goalColor pill.BackgroundColor3 = on and Color3.fromRGB(38, 62, 48) or PANEL2 end end pill.MouseButton1Click:Connect(function() setValue(not getValue()) render(true) end) render(false) return { render = render } end -- number field with -/+ steppers --------------------------------------------- local function makeNumber(parent, y, getValue, setValue, min, max, step, suffix) local holder = create("Frame", { Size = UDim2.new(0, 150, 0, 24), Position = UDim2.new(1, -164, 0, y - 3), BackgroundTransparency = 1, }, parent) create("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, VerticalAlignment = Enum.VerticalAlignment.Center, Padding = UDim.new(0, 4), }, holder) local function stepBtn(text, dir) local btn = create("TextButton", { Size = UDim2.new(0, 20, 0, 22), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = text, TextColor3 = MUTED, TextSize = 12, }, holder) corner(btn, 5) stroke(btn, LINE, 1) btn.MouseButton1Click:Connect(function() local nextValue = math.clamp(getValue() + (dir * step), min, max) setValue(nextValue) end) return btn end stepBtn("-", -1) local box = create("TextBox", { Size = UDim2.new(0, 62, 0, 22), BackgroundColor3 = PANEL2, BorderSizePixel = 0, Font = Enum.Font.GothamMedium, Text = string.format("%.2f", getValue()), TextColor3 = TEXT, TextSize = 12, ClearTextOnFocus = false, }, holder) corner(box, 5) stroke(box, LINE, 1) local suffixLabel = create("TextLabel", { Size = UDim2.new(0, 26, 0, 22), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = suffix or "s", TextColor3 = MUTED, TextSize = 11, TextXAlignment = Enum.TextXAlignment.Left, }, holder) stepBtn("+", 1) local function refresh() box.Text = string.format("%.2f", getValue()) end box.FocusLost:Connect(function() local parsed = tonumber(box.Text) if parsed then setValue(math.clamp(parsed, min, max)) end refresh() end) return { refresh = refresh, suffixLabel = suffixLabel } end -- cycle button (no dropdown menu = nothing to break) ------------------------- local function makeCycle(parent, y, values, getValue, setValue) local btn = create("TextButton", { Size = UDim2.new(0, 110, 0, 22), Position = UDim2.new(1, -124, 0, y - 2), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamMedium, Text = getValue(), TextColor3 = TEXT, TextSize = 11, }, parent) corner(btn, 5) stroke(btn, LINE, 1) local function render() btn.Text = getValue() .. " >" end btn.MouseButton1Click:Connect(function() local current = getValue() local index = 1 for i, value in ipairs(values) do if value == current then index = i break end end local nextValue = values[(index % #values) + 1] setValue(nextValue) render() end) render() return { render = render, button = btn } end -- key picker: cycles the actual bound key for a row --------------------------- local function makeKeyCycle(parent, y, getValue, setValue) local btn = create("TextButton", { Size = UDim2.new(0, 110, 0, 22), Position = UDim2.new(1, -124, 0, y - 2), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamMedium, Text = getValue().Name, TextColor3 = TEXT, TextSize = 11, }, parent) corner(btn, 5) stroke(btn, LINE, 1) local function render() btn.Text = getValue().Name .. " >" end btn.MouseButton1Click:Connect(function() local current = getValue() local index = 1 for i, code in ipairs(KEY_CHOICES) do if code == current then index = i break end end setValue(KEY_CHOICES[(index % #KEY_CHOICES) + 1]) render() end) render() return { render = render, button = btn } end --============================================================================== -- GUI: MASTER CARD --============================================================================== activePage = pages[1] sectionTitle("Run", 1) local masterCard = card(2, 104) create("TextLabel", { Size = UDim2.new(0, 240, 0, 20), Position = UDim2.new(0, 14, 0, 12), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "STATUS", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, }, masterCard) local stateLabel = create("TextLabel", { Size = UDim2.new(0, 300, 0, 22), Position = UDim2.new(0, 14, 0, 30), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "STOPPED", TextColor3 = TEXT, TextSize = 17, TextXAlignment = Enum.TextXAlignment.Left, }, masterCard) local detailLabel = create("TextLabel", { Size = UDim2.new(1, -28, 0, 30), Position = UDim2.new(0, 14, 0, 54), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "press RSHIFT or the button below", TextColor3 = MUTED, TextSize = 11, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, }, masterCard) --============================================================================== -- GUI: KEY CARDS --============================================================================== --============================================================================== -- GUI: BEYBLADE LIVE CARD --============================================================================== sectionTitle("Beyblade X", 3) local beyCard = card(4, 146) local beyPill = create("Frame", { Size = UDim2.new(0, 92, 0, 22), Position = UDim2.new(0, 14, 0, 12), BackgroundColor3 = PANEL2, BorderSizePixel = 0, }, beyCard) corner(beyPill, 11) local beyPillText = create("TextLabel", { Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "READING...", TextColor3 = MUTED, TextSize = 10, }, beyPill) local beyScore = create("TextLabel", { Size = UDim2.new(0, 140, 0, 24), Position = UDim2.new(1, -154, 0, 10), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "-", TextColor3 = TEXT, TextSize = 17, TextXAlignment = Enum.TextXAlignment.Right, }, beyCard) create("TextLabel", { Size = UDim2.new(0, 60, 0, 12), Position = UDim2.new(0, 14, 0, 44), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "SKILL", TextColor3 = MUTED, TextSize = 9, TextXAlignment = Enum.TextXAlignment.Left, }, beyCard) local beyTrack = create("Frame", { Size = UDim2.new(1, -112, 0, 8), Position = UDim2.new(0, 60, 0, 46), BackgroundColor3 = PANEL2, BorderSizePixel = 0, }, beyCard) corner(beyTrack, 4) local beyFill = create("Frame", { Size = UDim2.new(0, 0, 1, 0), BackgroundColor3 = ACCENT, BorderSizePixel = 0, }, beyTrack) corner(beyFill, 4) local beyPct = create("TextLabel", { Size = UDim2.new(0, 54, 0, 14), Position = UDim2.new(1, -64, 0, 42), BackgroundTransparency = 1, Font = Enum.Font.GothamMedium, Text = "-", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Right, }, beyCard) local beyYou = create("TextLabel", { Size = UDim2.new(1, -28, 0, 16), Position = UDim2.new(0, 14, 0, 66), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "you: -", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, beyCard) local beyOpp = create("TextLabel", { Size = UDim2.new(1, -28, 0, 16), Position = UDim2.new(0, 14, 0, 86), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "opp: -", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, beyCard) create("TextLabel", { Size = UDim2.new(1, -28, 0, 14), Position = UDim2.new(0, 14, 0, 106), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "hub 85070202669030 · any other place = match · cooldown read from the skill bar", TextColor3 = Color3.fromRGB(96, 103, 122), TextSize = 9, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, beyCard) --============================================================================== -- GUI: BEY BRAIN CARD --============================================================================== sectionTitle("Bey brain", 5) local brainCard = card(6, 232) local TYPE_CYCLE = { "auto", "attack", "defense", "stamina", "balance" } local typeIndex = 1 for i, value in ipairs(TYPE_CYCLE) do if value == Config.myType then typeIndex = i end end local myTypeBtn = create("TextButton", { Size = UDim2.new(0, 150, 0, 24), Position = UDim2.new(0, 14, 0, 12), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = "MY TYPE", TextColor3 = MUTED, TextSize = 10, }, brainCard) corner(myTypeBtn, 12) stroke(myTypeBtn, LINE, 1) local oppPill = create("Frame", { Size = UDim2.new(0, 150, 0, 24), Position = UDim2.new(1, -164, 0, 12), BackgroundColor3 = PANEL2, BorderSizePixel = 0, }, brainCard) corner(oppPill, 12) stroke(oppPill, LINE, 1) local oppPillText = create("TextLabel", { Size = UDim2.new(1, 0, 1, 0), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "OPP · ?", TextColor3 = MUTED, TextSize = 10, }, oppPill) local brainState = create("TextLabel", { Size = UDim2.new(1, -28, 0, 20), Position = UDim2.new(0, 14, 0, 44), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "IDLE", TextColor3 = MUTED, TextSize = 15, TextXAlignment = Enum.TextXAlignment.Left, }, brainCard) local brainWhy = create("TextLabel", { Size = UDim2.new(1, -28, 0, 14), Position = UDim2.new(0, 14, 0, 68), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "waiting for a bey", TextColor3 = MUTED, TextSize = 9, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, brainCard) local toggleRenders = {} local function brainToggleRow(y, text, getValue, setValue) local btn = create("TextButton", { Size = UDim2.new(1, -28, 0, 24), Position = UDim2.new(0, 14, 0, y), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = "", TextSize = 10, }, brainCard) corner(btn, 8) stroke(btn, LINE, 1) local label = create("TextLabel", { Size = UDim2.new(1, -68, 1, 0), Position = UDim2.new(0, 10, 0, 0), BackgroundTransparency = 1, Font = Enum.Font.GothamMedium, Text = text, TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, }, btn) local value = create("TextLabel", { Size = UDim2.new(0, 56, 1, 0), Position = UDim2.new(1, -62, 0, 0), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "OFF", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Right, }, btn) local function render() local on = getValue() value.Text = on and "ON" or "OFF" value.TextColor3 = on and ACCENT or MUTED label.TextColor3 = on and TEXT or MUTED btn.BackgroundColor3 = on and Color3.fromRGB(23, 38, 32) or PANEL2 end btn.MouseButton1Click:Connect(function() setValue(not getValue()) render() end) render() table.insert(toggleRenders, render) return render end brainToggleRow(88, "follow my bey type", function() return Config.adaptType end, function(value) Config.adaptType = value end) brainToggleRow(116, "wait for the burst window", function() return Config.burstWindow end, function(value) Config.burstWindow = value end) brainToggleRow(144, "read type from item icons", function() return Config.iconTypes end, function(value) Config.iconTypes = value ICON_ROLE_CACHE = {} ICON_ASSET_ROLES = nil ICON_ASSET_CODE_CACHE = {} end) labelRow(brainCard, "aggression", 172) local aggressionField aggressionField = makeNumber(brainCard, 172, function() return Config.aggression end, function(value) Config.aggression = value if aggressionField then aggressionField.refresh() end end) local function brainRender() local my = Brain.my or { role = "unknown" } local opp = Brain.opp or { role = "unknown" } local myRole = string.upper(my.role or "unknown") local suffix = Config.myType ~= "auto" and " (set)" or "" myTypeBtn.Text = "MY TYPE · " .. myRole .. suffix myTypeBtn.TextColor3 = (my.role == "unknown") and WARN or ACCENT oppPillText.Text = "OPP · " .. string.upper(opp.role or "unknown") oppPillText.TextColor3 = (opp.role == "unknown") and MUTED or ACCENT2 local shotRecord = "" local shots = (Brain.hits or 0) + (Brain.misses or 0) if shots > 0 then shotRecord = string.format(" · %d/%d", Brain.hits or 0, shots) end brainState.Text = string.upper(Brain.state or "idle") .. " · " .. string.upper(Brain.profile or "mixer") .. shotRecord brainState.TextColor3 = Brain.action == "fire" and ACCENT or MUTED local distText = "-" if Brain.dist and Brain.dist ~= math.huge then distText = string.format("%.0f studs", Brain.dist) end local etaText = "-" if Brain.eta and Brain.eta < 900 then etaText = string.format("%.2fs", Brain.eta) end local scoreText = "" if GameState.myScore and GameState.oppScore then scoreText = string.format("%d-%d · ", GameState.myScore, GameState.oppScore) end -- live proof the opponent probe is reading something local moveText = "" local moveAge = os.clock() - (Brain.oppMoveAt or 0) if Brain.oppMove and moveAge < 1.2 then moveText = " · opp " .. Brain.oppMove end brainWhy.Text = scoreText .. string.format( "%s · %s · closing %.1f · eta %s", Brain.reason or "waiting", distText, Brain.closing or 0, etaText ) .. moveText for _, render in ipairs(toggleRenders) do render() end end myTypeBtn.MouseButton1Click:Connect(function() typeIndex = (typeIndex % #TYPE_CYCLE) + 1 Config.myType = TYPE_CYCLE[typeIndex] brainRender() end) Brain.onUpdate = brainRender activePage = pages[2] sectionTitle("Keys", 7) for index, entry in ipairs(Keys) do local keyCard = card(7 + index, 190) local titleLabel = create("TextLabel", { Size = UDim2.new(0, 120, 0, 20), Position = UDim2.new(0, 14, 0, 12), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "KEY " .. entry.keyCode.Name, TextColor3 = TEXT, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Left, }, keyCard) local badge = create("TextLabel", { Size = UDim2.new(0, 130, 0, 20), Position = UDim2.new(1, -260, 0, 12), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "idle", TextColor3 = MUTED, TextSize = 10, TextXAlignment = Enum.TextXAlignment.Right, }, keyCard) local toggle = makeToggle(keyCard, 11, function() return entry.enabled end, function(value) entry.enabled = value end) labelRow(keyCard, "key", 42) local keyCycle keyCycle = makeKeyCycle(keyCard, 42, function() return entry.keyCode end, function(value) entry.keyCode = value titleLabel.Text = "KEY " .. value.Name end) labelRow(keyCard, "interval", 74) local intervalField intervalField = makeNumber(keyCard, 74, function() return entry.interval end, function(value) entry.interval = value entry.learned = value intervalField.refresh() end, 0.1, 30, 0.1, "s") labelRow(keyCard, "hold", 106) local holdField holdField = makeNumber(keyCard, 106, function() return entry.hold end, function(value) entry.hold = value holdField.refresh() end, 0, 2, 0.01, "s") labelRow(keyCard, "gate", 138, MUTED) local gateCycle = makeCycle(keyCard, 138, GATE_VALUES, function() return entry.gate end, function(value) entry.gate = value end) entry.ui = { titleLabel = titleLabel, keyCycle = keyCycle, intervalField = intervalField, holdField = holdField, gateCycle = gateCycle, badge = badge, toggle = toggle, } end --============================================================================== -- GUI: GAME PROFILE --============================================================================== activePage = pages[3] sectionTitle("Game profile", 10) local profileCard = card(11, 130) local profileBtn = create("TextButton", { Size = UDim2.new(1, -28, 0, 32), Position = UDim2.new(0, 14, 0, 12), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = "APPLY BEYBLADE X-BATTLES PROFILE", TextColor3 = TEXT, TextSize = 11, }, profileCard) corner(profileBtn, 7) stroke(profileBtn, ACCENT, 1) local profileNote = create("TextLabel", { Size = UDim2.new(1, -28, 0, 58), Position = UDim2.new(0, 14, 0, 50), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "Read from this game's own battle HUD: R is SKILL, F is SUB_SKILL, E is SHOOT, T is camera. The profile fires R only when an enemy is in range and the skill's CoolTime is 0, and leaves F off because this game also binds F to COLLECTION. Rebind any row with the key button.", TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, }, profileCard) --============================================================================== -- GUI: SCHEDULER CARD --============================================================================== sectionTitle("Scheduler", 12) local schedCard = card(13, 176) labelRow(schedCard, "mode", 14) local modeCycle = makeCycle(schedCard, 14, MODE_VALUES, function() return Config.mode end, function(value) Config.mode = value for _, entry in ipairs(Keys) do entry.learned = entry.interval end end) labelRow(schedCard, "jitter (0 = none)", 44) local jitterField jitterField = makeNumber(schedCard, 44, function() return Config.jitter end, function(value) Config.jitter = value jitterField.refresh() end, 0, 2, 0.01, "s") labelRow(schedCard, "adaptive min", 74) local minField minField = makeNumber(schedCard, 74, function() return Config.adaptiveMin end, function(value) Config.adaptiveMin = value if Config.adaptiveMax < value then Config.adaptiveMax = value end minField.refresh() end, 0.05, 30, 0.05, "s") labelRow(schedCard, "adaptive max", 104) local maxField maxField = makeNumber(schedCard, 104, function() return Config.adaptiveMax end, function(value) Config.adaptiveMax = value if Config.adaptiveMin > value then Config.adaptiveMin = value end maxField.refresh() end, 0.1, 60, 0.1, "s") create("TextLabel", { Size = UDim2.new(1, -28, 0, 16), Position = UDim2.new(0, 14, 0, 130), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "adaptive clamps the learned interval between min and max", TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, }, schedCard) --============================================================================== -- GUI: SMART DETECT CARD --============================================================================== sectionTitle("Smart detect", 14) local smartCard = card(15, 330) labelRow(smartCard, "smart gates", 14, TEXT, true) makeToggle(smartCard, 12, function() return Config.smartDetect end, function(value) Config.smartDetect = value end) labelRow(smartCard, "prompt fallback", 46, MUTED) makeToggle(smartCard, 44, function() return Config.promptFallback end, function(value) Config.promptFallback = value end) labelRow(smartCard, "enemy range", 78, MUTED) local enemyRangeField enemyRangeField = makeNumber(smartCard, 78, function() return Config.enemyRange end, function(value) Config.enemyRange = value enemyRangeField.refresh() end, 1, 250, 5, "st") labelRow(smartCard, "bey models", 110, MUTED) makeToggle(smartCard, 108, function() return Config.scanBeyModels end, function(value) Config.scanBeyModels = value Scan.at = 0 end) labelRow(smartCard, "auto pause", 142, MUTED) makeToggle(smartCard, 140, function() return Config.autoPause end, function(value) Config.autoPause = value Engine.lastSeenAt = os.clock() Engine.autoPaused = false end) labelRow(smartCard, "battle only", 174, MUTED) makeToggle(smartCard, 172, function() return Config.battleOnly end, function(value) Config.battleOnly = value end) create("TextLabel", { Size = UDim2.new(1, -28, 0, 84), Position = UDim2.new(0, 14, 0, 208), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "Enemy gate fires only while a hostile bey is within range, so specials land on an engage instead of on an empty stadium (teams respected in 2v2). Bey models adds unowned models named bey/blade/spinner/gyro as targets, so AI tops count too. Auto pause stops when no bey has been near for 6s and starts again on contact. Prompt gate needs ProximityPrompts, which this game barely uses, and falls back to blind pressing if none ever appear.", TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, }, smartCard) --============================================================================== -- GUI: STATS CARD --============================================================================== activePage = pages[4] sectionTitle("Telemetry", 16) local statsCard = card(17, 176) local statHolders = {} local function statCell(x, y, title) create("TextLabel", { Size = UDim2.new(0, 92, 0, 14), Position = UDim2.new(0, x, 0, y), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = string.upper(title), TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 9, TextXAlignment = Enum.TextXAlignment.Left, }, statsCard) local value = create("TextLabel", { Size = UDim2.new(0, 100, 0, 18), Position = UDim2.new(0, x, 0, y + 13), BackgroundTransparency = 1, Font = Enum.Font.GothamBold, Text = "-", TextColor3 = TEXT, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Left, }, statsCard) statHolders[title] = value return value end statCell(14, 12, "presses") statCell(128, 12, "avg gap") statCell(242, 12, "cool") statCell(14, 56, "slot 1") statCell(128, 56, "slot 2") statCell(242, 56, "enemy") local lastLabel = create("TextLabel", { Size = UDim2.new(1, -28, 0, 18), Position = UDim2.new(0, 14, 0, 92), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "last: -", TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextTruncate = Enum.TextTruncate.AtEnd, }, statsCard) local buildLabel = create("TextLabel", { Size = UDim2.new(1, -28, 0, 28), Position = UDim2.new(0, 14, 0, 114), BackgroundTransparency = 1, Font = Enum.Font.Gotham, Text = "state ?", TextColor3 = Color3.fromRGB(110, 116, 132), TextSize = 10, TextXAlignment = Enum.TextXAlignment.Left, TextWrapped = true, TextTruncate = Enum.TextTruncate.AtEnd, }, statsCard) --============================================================================== -- GUI: FOOTER --============================================================================== local footer = create("Frame", { Name = "Footer", Size = UDim2.new(0, 132, 0, 92), Position = UDim2.new(0, 0, 1, -92), BackgroundColor3 = PANEL, BorderSizePixel = 0, }, window) corner(footer, 14) gradient(footer, Color3.fromRGB(24, 26, 35), Color3.fromRGB(12, 13, 19), 90) local divider = create("Frame", { Size = UDim2.new(1, -28, 0, 1), Position = UDim2.new(0, 14, 0, 0), BackgroundColor3 = LINE, BorderSizePixel = 0, }, footer) gradient(divider, ACCENT2, ACCENT, 0) local runBtn = create("TextButton", { Size = UDim2.new(0, 100, 0, 30), Position = UDim2.new(0, 16, 0, 12), BackgroundColor3 = ACCENT, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamBold, Text = "START", TextColor3 = Color3.fromRGB(10, 26, 16), TextSize = 13, }, footer) corner(runBtn, 8) local saveBtn = create("TextButton", { Size = UDim2.new(0, 46, 0, 26), Position = UDim2.new(0, 16, 0, 50), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamMedium, Text = "SAVE", TextColor3 = MUTED, TextSize = 12, }, footer) corner(saveBtn, 8) stroke(saveBtn, LINE, 1) gradient(saveBtn, PANEL3, PANEL, 90) local loadBtn = create("TextButton", { Size = UDim2.new(0, 46, 0, 26), Position = UDim2.new(0, 70, 0, 50), BackgroundColor3 = PANEL2, BorderSizePixel = 0, AutoButtonColor = false, Font = Enum.Font.GothamMedium, Text = "LOAD", TextColor3 = MUTED, TextSize = 12, }, footer) corner(loadBtn, 8) stroke(loadBtn, LINE, 1) gradient(loadBtn, PANEL3, PANEL, 90) --============================================================================== -- GUI BEHAVIOUR --============================================================================== local function renderRunState() if Config.running then runBtn.Text = "STOP" runBtn.BackgroundColor3 = DANGER runBtn.TextColor3 = Color3.fromRGB(40, 12, 12) stateLabel.Text = "RUNNING" stateLabel.TextColor3 = ACCENT dot.BackgroundColor3 = ACCENT dotGlow.BackgroundColor3 = ACCENT dotGlow.BackgroundTransparency = 0.82 else runBtn.Text = "START" runBtn.BackgroundColor3 = ACCENT runBtn.TextColor3 = Color3.fromRGB(10, 26, 16) stateLabel.Text = "STOPPED" stateLabel.TextColor3 = TEXT dot.BackgroundColor3 = DANGER dotGlow.BackgroundColor3 = DANGER dotGlow.BackgroundTransparency = 0.82 end end local function toast(message) stateLabel.Text = message task.delay(2, function() if screen.Parent then renderRunState() end end) end runBtn.MouseButton1Click:Connect(function() Engine.autoPaused = false setRunning(not Config.running) renderRunState() end) runBtn.MouseEnter:Connect(function() TweenService:Create(runBtn, TweenInfo.new(0.12), { BackgroundColor3 = Config.running and Color3.fromRGB(255, 130, 130) or Color3.fromRGB(120, 235, 164), }):Play() end) runBtn.MouseLeave:Connect(function() TweenService:Create(runBtn, TweenInfo.new(0.12), { BackgroundColor3 = Config.running and DANGER or ACCENT, }):Play() end) closeBtn.MouseButton1Click:Connect(function() setRunning(false) screen:Destroy() if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" and env.__SmartKeys == screen then env.__SmartKeys = nil end end end) closeBtn.MouseEnter:Connect(function() closeBtn.BackgroundColor3 = DANGER closeBtn.TextColor3 = Color3.fromRGB(40, 12, 12) end) closeBtn.MouseLeave:Connect(function() closeBtn.BackgroundColor3 = PANEL2 closeBtn.TextColor3 = MUTED end) -- drag ----------------------------------------------------------------------- local dragging = false local dragStart = nil local startPos = nil header.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then dragging = true dragStart = input.Position startPos = window.Position input.Changed:Connect(function() if input.UserInputState == Enum.UserInputState.End then dragging = false end end) end end) UserInputService.InputChanged:Connect(function(input) if not dragging or not dragStart or not startPos then return end if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then local delta = input.Position - dragStart window.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y ) shadow.Position = UDim2.new( startPos.X.Scale, startPos.X.Offset + delta.X, startPos.Y.Scale, startPos.Y.Offset + delta.Y + 6 ) end end) -- CONFIG EDITOR (page 5): data-driven rows, every control writes straight into -- Config and the loops read Config live, so a change applies on the next press. activePage = pages[5] local CFG_GROUPS = { { "Timing", 20, 21, 200, { { "jitter", "jitter", 0, 1, 0.01, "s" }, { "min interval", "adaptiveMin", 0.1, 30, 0.1, "s" }, { "max interval", "adaptiveMax", 0.1, 60, 0.1, "s" }, { "learn step", "learnStep", 0.01, 2, 0.01, "s" }, { "probe window", "probeWindow", 0.1, 2, 0.01, "s" }, { "release pad", "releasePad", 0, 60, 1, " studs" }, } }, { "Brain", 22, 23, 150, { { "lead time", "leadTime", 0, 1.5, 0.01, "s" }, { "brain range", "brainRange", 5, 120, 1, " studs" }, { "enemy range", "enemyRange", 5, 120, 1, " studs" }, { "aggression", "aggression", 0.25, 3, 0.05, "x" }, } }, { "Switches", 24, 25, 300, { { "smart detect", "smartDetect" }, { "prompt fallback", "promptFallback" }, { "scan bey models", "scanBeyModels" }, { "battle only", "battleOnly" }, { "auto pause", "autoPause" }, { "adapt type", "adaptType" }, { "burst window", "burstWindow" }, { "icon types", "iconTypes" }, { "counter moves", "counterMoves" }, } }, } for _, group in ipairs(CFG_GROUPS) do sectionTitle(group[1], group[2]) local box = card(group[3], group[4]) for i, row in ipairs(group[5]) do local y = 12 + (i - 1) * 32 local key = row[2] labelRow(box, row[1], y) if row[3] then makeNumber(box, y, function() return Config[key] end, function(value) Config[key] = value end, row[3], row[4], row[5], row[6]) else makeToggle(box, y - 1, function() return Config[key] end, function(value) Config[key] = value end) end end end activePage = pages[1] -- hotkey --------------------------------------------------------------------- local capturing = false local function renderHotkey() hotkeyBtn.Text = capturing and "press key" or Config.hotkey.Name hotkeyBtn.TextColor3 = capturing and WARN or MUTED end hotkeyBtn.MouseButton1Click:Connect(function() capturing = true renderHotkey() end) UserInputService.InputBegan:Connect(function(input, gameProcessed) if capturing then if input.UserInputType == Enum.UserInputType.Keyboard then Config.hotkey = input.KeyCode capturing = false renderHotkey() end return end if gameProcessed then return end if input.KeyCode == Config.hotkey then Engine.autoPaused = false setRunning(not Config.running) renderRunState() end end) -- persistence ---------------------------------------------------------------- local SAVE_FOLDER = "SmartKeys" local SAVE_FILE = "SmartKeys/config.json" local function hasFileApi() return type(writefile) == "function" and type(readfile) == "function" and type(isfile) == "function" end local function serialize() return { mode = Config.mode, jitter = Config.jitter, adaptiveMin = Config.adaptiveMin, adaptiveMax = Config.adaptiveMax, smartDetect = Config.smartDetect, promptFallback = Config.promptFallback, enemyRange = Config.enemyRange, scanBeyModels = Config.scanBeyModels, releasePad = Config.releasePad, autoPause = Config.autoPause, battleOnly = Config.battleOnly, adaptType = Config.adaptType, burstWindow = Config.burstWindow, aggression = Config.aggression, brainRange = Config.brainRange, leadTime = Config.leadTime, myType = Config.myType, iconTypes = Config.iconTypes, hotkey = Config.hotkey.Name, keys = { F = { enabled = Keys[1].enabled, key = Keys[1].keyCode.Name, interval = Keys[1].interval, hold = Keys[1].hold, gate = Keys[1].gate, }, R = { enabled = Keys[2].enabled, key = Keys[2].keyCode.Name, interval = Keys[2].interval, hold = Keys[2].hold, gate = Keys[2].gate, }, }, } end local function applyConfig(data) if type(data) ~= "table" then return end if data.mode == "Adaptive" or data.mode == "Fixed" then Config.mode = data.mode end Config.jitter = tonumber(data.jitter) or Config.jitter Config.adaptiveMin = tonumber(data.adaptiveMin) or Config.adaptiveMin Config.adaptiveMax = tonumber(data.adaptiveMax) or Config.adaptiveMax if type(data.smartDetect) == "boolean" then Config.smartDetect = data.smartDetect end if type(data.promptFallback) == "boolean" then Config.promptFallback = data.promptFallback end if tonumber(data.enemyRange) then Config.enemyRange = math.clamp(tonumber(data.enemyRange), 1, 250) end if tonumber(data.releasePad) then Config.releasePad = math.clamp(tonumber(data.releasePad), 0, 100) end if type(data.scanBeyModels) == "boolean" then Config.scanBeyModels = data.scanBeyModels end if type(data.autoPause) == "boolean" then Config.autoPause = data.autoPause end if type(data.battleOnly) == "boolean" then Config.battleOnly = data.battleOnly end if type(data.adaptType) == "boolean" then Config.adaptType = data.adaptType end if type(data.burstWindow) == "boolean" then Config.burstWindow = data.burstWindow end if tonumber(data.aggression) then Config.aggression = math.clamp(tonumber(data.aggression), 0.25, 3) end if tonumber(data.brainRange) then Config.brainRange = math.clamp(tonumber(data.brainRange), 5, 200) end if tonumber(data.leadTime) then Config.leadTime = math.clamp(tonumber(data.leadTime), 0, 1.5) end if type(data.myType) == "string" then for _, valid in ipairs({ "auto", "attack", "defense", "stamina", "balance" }) do if valid == data.myType then Config.myType = data.myType end end end if type(data.iconTypes) == "boolean" then Config.iconTypes = data.iconTypes ICON_ROLE_CACHE = {} ICON_ASSET_ROLES = nil ICON_ASSET_CODE_CACHE = {} end if type(data.hotkey) == "string" then local ok, code = pcall(function() return Enum.KeyCode[data.hotkey] end) if ok and code then Config.hotkey = code end end if type(data.keys) == "table" then for _, entry in ipairs(Keys) do local saved = data.keys[entry.name] if type(saved) == "table" then if type(saved.enabled) == "boolean" then entry.enabled = saved.enabled end entry.interval = math.clamp(tonumber(saved.interval) or entry.interval, 0.1, 30) entry.hold = math.clamp(tonumber(saved.hold) or entry.hold, 0, 2) if type(saved.key) == "string" then local keyOk, code = pcall(function() return Enum.KeyCode[saved.key] end) if keyOk and code and VIRTUAL_KEY[code.Name] then entry.keyCode = code end end entry.learned = entry.interval if type(saved.gate) == "string" then for _, valid in ipairs(GATE_VALUES) do if valid == saved.gate then entry.gate = saved.gate end end end end end end for _, entry in ipairs(Keys) do if entry.ui then entry.ui.intervalField.refresh() entry.ui.holdField.refresh() entry.ui.gateCycle.render() entry.ui.keyCycle.render() entry.ui.titleLabel.Text = "KEY " .. entry.keyCode.Name entry.ui.toggle.render(false) end end modeCycle.render() jitterField.refresh() minField.refresh() maxField.refresh() enemyRangeField.refresh() if aggressionField then aggressionField.refresh() end if Brain.onUpdate then Brain.onUpdate() end renderHotkey() end -- game profiles --------------------------------------------------------------- local function applyBeybladeProfile() -- read from this game's own battle HUD: R = SKILL, F = SUB_SKILL, E = SHOOT. -- An earlier guess (E/R special, F unbound) came from a different Beyblade -- game and was wrong here. Skills only matter in contact range. applyConfig({ mode = "Fixed", jitter = 0, smartDetect = true, promptFallback = true, enemyRange = 40, -- beys here ARE the players' characters, so model scanning is pure noise scanBeyModels = false, releasePad = 10, autoPause = true, battleOnly = true, adaptType = true, burstWindow = true, aggression = 1.2, brainRange = 45, leadTime = 0.22, myType = "auto", iconTypes = true, -- verified bindings: R = SKILL, F = SUB_SKILL, E = SHOOT -- 0.4s poll + the cooldown gate means it fires the moment the skill is up -- R (SKILL) on; F (SUB_SKILL) bound but starts OFF: this game also binds F -- to COLLECTION, so blind F presses can open a menu mid-fight. keys = { -- slot 1 = R (SKILL) on the brain gate: it fires only when the matchup -- model says the moment is right, not on a blind poll F = { enabled = true, interval = 0.4, hold = 0.05, gate = "Brain", key = "R" }, R = { enabled = false, interval = 0.4, hold = 0.05, gate = "Enemy+Skill", key = "F" }, }, }) profileNote.Text = "Applied: slot 1 = R (SKILL) on the brain gate - it reads your bit/blade role and the opponent's, tracks how fast they are closing, and fires when the matchup says so (attack bursts, stamina counters, defense answers an approach). Slot 2 is bound to F (SUB_SKILL) but starts OFF because this game also binds F to COLLECTION." toast("beyblade profile applied") end profileBtn.MouseButton1Click:Connect(applyBeybladeProfile) saveBtn.MouseButton1Click:Connect(function() if not hasFileApi() then toast("this executor has no file api") return end local ok = pcall(function() if type(isfolder) == "function" and type(makefolder) == "function" and not isfolder(SAVE_FOLDER) then makefolder(SAVE_FOLDER) end writefile(SAVE_FILE, HttpService:JSONEncode(serialize())) end) toast(ok and "settings saved" or "save failed") end) loadBtn.MouseButton1Click:Connect(function() if not hasFileApi() then toast("this executor has no file api") return end local ok, data = pcall(function() if not isfile(SAVE_FILE) then return nil end return HttpService:JSONDecode(readfile(SAVE_FILE)) end) if ok and data then applyConfig(data) toast("settings loaded") else toast("no saved settings") end end) -- match / lobby watcher ------------------------------------------------------- -- "in a battle" is not a state the game exposes, but it is observable: a bey -- (player or AI) close to you is the fight. No bey for 6 seconds is the lobby. Engine.lastSeenAt = os.clock() Engine.autoPaused = false task.spawn(function() while screen.Parent do task.wait(0.4) if not screen.Parent then return end if not Config.autoPause then continue end -- refresh the model cache, then judge by whichever signal this game has local ok, target, dist = pcall(nearestEnemy, math.huge) if not ok then continue end local beyDist, beyCount = nearestBeyDistance() local reach = Config.enemyRange + 15 local near if beyCount > 0 then -- standalone bey models exist: only a bey counts as a battle near = beyDist <= reach else -- the bey is the character here, so an opponent character is the signal near = target ~= nil and dist ~= math.huge and dist <= reach end if near then Engine.lastSeenAt = os.clock() if Engine.autoPaused and not Config.running then Engine.autoPaused = false setRunning(true) renderRunState() toast("battle detected - started") end elseif Config.running and not Engine.autoPaused and (os.clock() - Engine.lastSeenAt) > 6 then Engine.autoPaused = true setRunning(false) renderRunState() toast("no bey nearby - paused") end end end) -- brain ticker ---------------------------------------------------------------- -- Runs even while stopped so the card is a live readout; only the gates care. task.spawn(function() while screen.Parent do task.wait(0.07) local ok = pcall(function() readScore() readRoundState() brainSense() Brain.my = myBeyInfo() Brain.opp = opponentBeyInfo() Brain.my.role = stableRole("my", Brain.my.role) Brain.opp.role = stableRole("opp", Brain.opp.role) brainDecide() if Brain.onUpdate then Brain.onUpdate() end end) if not ok then -- a broken sensor must never silence the keys local target = nearestEnemy(Config.enemyRange) Brain.action = target and "fire" or "hold" Brain.state = "fallback" Brain.reason = "sensor error" end end end) -- stats ticker --------------------------------------------------------------- local function updateTelemetry() local avgGap = 0 if Engine.gapCount > 0 then avgGap = Engine.gapSum / Engine.gapCount end statHolders["presses"].Text = tostring(Engine.sessionPresses) statHolders["avg gap"].Text = string.format("%.2fs", avgGap) local ready, coolText = cooldownState(Keys[1].keyCode.Name) if ready == nil then statHolders["cool"].Text = coolText or "n/a" statHolders["cool"].TextColor3 = MUTED elseif ready then statHolders["cool"].Text = coolText or "ready" statHolders["cool"].TextColor3 = ACCENT else statHolders["cool"].Text = coolText or "cooling" statHolders["cool"].TextColor3 = WARN end statHolders["slot 1"].Text = string.format("%d / %d", Keys[1].presses, Keys[1].skipped) statHolders["slot 2"].Text = string.format("%d / %d", Keys[2].presses, Keys[2].skipped) local nearest, enemyDist = nearestEnemy(math.huge) if enemyDist == math.huge then statHolders["enemy"].Text = "none" statHolders["enemy"].TextColor3 = MUTED else statHolders["enemy"].Text = string.format("%.0f st", enemyDist) statHolders["enemy"].TextColor3 = (nearest ~= nil) and ACCENT or MUTED end if Config.running then local lines = {} for _, entry in ipairs(Keys) do local badge = entry.ui and entry.ui.badge if badge then badge.Text = entry.status badge.TextColor3 = entry.status == "pressing" and ACCENT or (string.sub(entry.status, 1, 7) == "skipped" and WARN or MUTED) end table.insert( lines, string.format("%s: %s%.2fs", entry.keyCode.Name, entry.enabled and "" or "(off) ", effectiveInterval(entry)) ) end detailLabel.Text = table.concat(lines, " ") else for _, entry in ipairs(Keys) do if entry.ui then entry.ui.badge.Text = "idle" entry.ui.badge.TextColor3 = MUTED end end detailLabel.Text = string.format("hotkey %s | %d presses this session", Config.hotkey.Name, Engine.sessionPresses) end -- beyblade live card local battleNow = inBattle() if battleNow == true then beyPillText.Text = "IN BATTLE" beyPillText.TextColor3 = ACCENT beyPill.BackgroundColor3 = Color3.fromRGB(24, 52, 40) elseif battleNow == false then beyPillText.Text = "HUB / LOBBY" beyPillText.TextColor3 = WARN beyPill.BackgroundColor3 = Color3.fromRGB(54, 43, 26) else beyPillText.Text = "UNKNOWN" beyPillText.TextColor3 = MUTED beyPill.BackgroundColor3 = PANEL2 end local scoreNow = readScore() beyScore.Text = scoreNow or "-" local readyNow, _, ratioNow = cooldownState(Keys[1].keyCode.Name) local charge = 1 if ratioNow ~= nil then charge = 1 - ratioNow elseif readyNow == false then charge = 0 end beyFill.Size = UDim2.new(math.clamp(charge, 0, 1), 0, 1, 0) beyFill.BackgroundColor3 = charge > 0.95 and ACCENT or WARN if ratioNow ~= nil then beyPct.Text = string.format("%.0f%%", ratioNow * 100) beyPct.TextColor3 = ratioNow > 0.05 and WARN or ACCENT else beyPct.Text = readyNow == true and "READY" or (readyNow == false and "COOL" or "-") beyPct.TextColor3 = readyNow == true and ACCENT or MUTED end local mineNow = myBeyName() beyYou.Text = "you: " .. (mineNow or "-") local oppText = "-" local mineSquash = mineNow and squash(mineNow) or nil for _, item in ipairs(readBuilds()) do local bladeName = shortId(item.blade, "Blade_") local bladeKey = squash(bladeName) if not mineSquash or bladeKey == "" or not string.find(mineSquash, bladeKey, 1, true) then oppText = string.format( "%s %s %s", bladeName, shortId(item.ratchet, "Rachet_"), shortId(item.bit, "Bit_") ) break end end beyOpp.Text = "opp: " .. oppText lastLabel.Text = "last: " .. Engine.lastAction -- build + battle state, read from the game's own data local builds = readBuilds() local labels = {} for index, item in ipairs(builds) do table.insert( labels, string.format("%s %s %s", shortId(item.blade, "Blade_"), shortId(item.ratchet, "Rachet_"), shortId(item.bit, "Bit_")) ) if index >= 2 then break end end local battle = inBattle() local prefix = battle == true and "IN BATTLE" or (battle == false and "LOBBY" or "state ?") local score = readScore() if score then prefix = prefix .. " " .. score end local mine = myBeyName() if mine then table.insert(labels, 1, "you: " .. mine) end if #labels == 0 then buildLabel.Text = prefix .. " | no bey data" else buildLabel.Text = prefix .. " | " .. table.concat(labels, " / ") end end task.spawn(function() while screen.Parent do local ok = pcall(updateTelemetry) if not ok then break end task.wait(0.15) end end) --============================================================================== -- AUTO START (settings are already at defaults; press RSHIFT to run) --============================================================================== renderRunState() renderHotkey() if Backend == "none" then stateLabel.Text = "NO INPUT BACKEND" stateLabel.TextColor3 = DANGER detailLabel.Text = "your executor exposes neither keypress nor VirtualInputManager" end