-- ACX Studio: Complete Horizontal Sleek Hub (Auto Farm, Quests, Teleports, Merchants, Rewards, Summon, Traits, Units, Raids/Stages & Auto-Exec) local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local UserInputService = game:GetService("UserInputService") local VirtualInputManager = game:GetService("VirtualInputManager") local CollectionService = game:GetService("CollectionService") local TeleportService = game:GetService("TeleportService") local HttpService = game:GetService("HttpService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") local EXISTING_GUI_NAME = "PotassiumAutoFarmUI" do local env = (getgenv and getgenv()) or _G if type(env.__ACX_SHUTDOWN) == "function" then pcall(env.__ACX_SHUTDOWN) end end for _, c in ipairs({ gethui and gethui() or nil, game:GetService("CoreGui"), PlayerGui }) do if c then local o = c:FindFirstChild(EXISTING_GUI_NAME) if o then o:Destroy() end end end local function safeRequire(inst) if not inst then return nil end local ok, res = pcall(require, inst) return ok and res or nil end local Shared, Config, Client = ReplicatedStorage:FindFirstChild("Shared"), ReplicatedStorage:FindFirstChild("Config"), ReplicatedStorage:FindFirstChild("Client") local ClientServices = Client and Client:FindFirstChild("services") local ClientDataService = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientDataService")) local ClientChampionAbilityService = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientChampionAbilityService")) local ClientHubWarpService = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientHubWarpService")) local ClientLobbyService = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientLobbyService")) local ClientMatchResultsService = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientMatchResultsService")) local TraitDefs = safeRequire(Shared and Shared:FindFirstChild("TraitDefs")) local CharacterDefs = safeRequire(Shared and Shared:FindFirstChild("CharacterDefs")) local ItemDefs = safeRequire(Shared and Shared:FindFirstChild("ItemDefs")) local BannerRules = safeRequire(Shared and Shared:FindFirstChild("BannerRules")) local ChampionRanking = safeRequire(Shared and Shared:FindFirstChild("ChampionRanking")) local ChampionLevelCap = safeRequire(Shared and Shared:FindFirstChild("ChampionLevelCap")) local HubWarpShared = safeRequire(Shared and Shared:FindFirstChild("HubWarp")) local ChestClaimants = safeRequire(Shared and Shared:FindFirstChild("ChestClaimants")) local QuestLogic = safeRequire(Shared and Shared:FindFirstChild("QuestLogic")) local BannerConfig = safeRequire(Config and Config:FindFirstChild("BannerConfig")) local RarityConfig = safeRequire(Config and Config:FindFirstChild("RarityConfig")) local LevelConfig = safeRequire(Config and Config:FindFirstChild("LevelConfig")) local EquipSlotsConfig = safeRequire(Config and Config:FindFirstChild("EquipSlotsConfig")) local QuestsConfig = safeRequire(Config and Config:FindFirstChild("Quests")) local MerchantCatalog = safeRequire(Config and Config:FindFirstChild("MerchantCatalog")) local RaidRunConfig = safeRequire(Config and Config:FindFirstChild("RaidRun")) local MissionsConfig = safeRequire(Config and Config:FindFirstChild("Missions")) local OverworldMode = safeRequire(Config and Config:FindFirstChild("OverworldMode")) local ECS = { world = safeRequire(Shared and Shared:FindFirstChild("ecs") and Shared.ecs:FindFirstChild("world")), Components = safeRequire(Shared and Shared:FindFirstChild("Components")), TeamUtils = safeRequire(Shared and Shared:FindFirstChild("utils") and Shared.utils:FindFirstChild("TeamUtils")), Packs = safeRequire(Shared and Shared:FindFirstChild("combat") and Shared.combat:FindFirstChild("Packs")), replicator = safeRequire(Client and Client:FindFirstChild("replicator")), HostileFocus = safeRequire(Client and Client:FindFirstChild("HostileFocus")), } local function getLocalPlayerEcsEntity() if not ECS.world or not ECS.Components or not ECS.Components.Player then return nil end for e, p in ECS.world:query(ECS.Components.Player) do if p == LocalPlayer then return e end end return nil end local function scanEcsUnits() local hostiles, champions, packByModel = {}, {}, {} if not ECS.world or not ECS.Components or not ECS.Components.CharacterModel or not ECS.Components.Team then return hostiles, champions, packByModel end local lpEnt = getLocalPlayerEcsEntity() for e, mdl in ECS.world:query(ECS.Components.CharacterModel):with(ECS.Components.Team) do local sealed = ECS.Components.Sealed and ECS.world:has(e, ECS.Components.Sealed) local targetable = ECS.Components.Targetable and ECS.world:has(e, ECS.Components.Targetable) local isHostile = lpEnt and ECS.TeamUtils and ECS.TeamUtils.areEntitiesHostile and ECS.TeamUtils.areEntitiesHostile(lpEnt, e) if isHostile then if targetable and not sealed then hostiles[mdl] = e if ECS.Packs and ECS.Packs.packOf then packByModel[mdl] = ECS.Packs.packOf(e) end end else champions[mdl] = e end end return hostiles, champions, packByModel end -- Exclude all Champion models (your own & other players') from enemy & drop targeting local CHAMPION_MODEL_NAMES = {} if CharacterDefs and CharacterDefs.ids then local okIds, ids = pcall(CharacterDefs.ids) if okIds and type(ids) == "table" then for _, cid in ipairs(ids) do CHAMPION_MODEL_NAMES[cid] = true local okD, def = pcall(CharacterDefs.get, cid) if okD and type(def) == "table" and def.shinyModel then CHAMPION_MODEL_NAMES[def.shinyModel] = true end end end end local function isChampionModel(model) if not model then return false end local hostiles, champions = scanEcsUnits() if hostiles[model] then return false end if champions[model] then return true end return CHAMPION_MODEL_NAMES[model.Name] == true end local function getDataSnapshot() if not ClientDataService or not ClientDataService.GetStore then return nil end local ok, store = pcall(ClientDataService.GetStore) if not ok or not store then return nil end local okG, snap = pcall(function() return store:get() end) return okG and snap or nil end local function getDefaultBoonPriority() local order = {} if RaidRunConfig and RaidRunConfig.getBoonIds then local ok, ids = pcall(RaidRunConfig.getBoonIds) if ok and type(ids) == "table" then for _, id in ipairs(ids) do table.insert(order, id) end end end if #order == 0 then order = { "second_wind", "giant_slayer", "showdown", "grievous_wounds", "double_dose", "no_respite", "killer_instinct", "mend", "overload", "quickcast", "elemental_fury", "hold_the_line", "shatter", "deadeye", "finisher", "behind_the_shield", "triage" } end return order end local CHOICES = { RANGE = { {label="Unlimited",value=0}, {label="Nearest 50",value=50}, {label="Nearest 100",value=100}, {label="Nearest 250",value=250}, {label="Nearest 500",value=500} }, MOVE = { {label="Tween (Smooth)",value="Tween"}, {label="Instant TP",value="Instant"} }, SPEED = { {label="Slow (45)",value=45}, {label="Normal (90)",value=90}, {label="Fast (140)",value=140}, {label="Turbo (220)",value=220} }, ABILITY_INTERVAL = { {label="250 ms",value=0.25}, {label="500 ms",value=0.5}, {label="1.0 s",value=1.0}, {label="1.5 s",value=1.5}, {label="2.0 s",value=2.0}, {label="3.0 s",value=3.0}, {label="5.0 s",value=5.0} }, PULL_COUNT = { {label="1x Pull",value=1}, {label="5x Pull",value=5}, {label="10x Pull",value=10} }, PULL_DELAY = { {label="100 ms (Max)",value=0.1}, {label="200 ms",value=0.2}, {label="350 ms",value=0.35}, {label="600 ms",value=0.6} }, BOOSTER = { {label="None",value="none"}, {label="Luck Booster",value="luck_booster"}, {label="Super Luck Booster",value="super_luck_booster"}, {label="Ultra Luck Booster",value="ultra_luck_booster"} }, TRAIT_SLOT = { {label="Slot 1 Only",value=1}, {label="Slot 2 Only",value=2}, {label="Both Slots (1 & 2)",value=0} }, TOKEN_RESERVE = { {label="No Reserve (0)",value=0}, {label="Reserve 10",value=10}, {label="Reserve 25",value=25}, {label="Reserve 50",value=50}, {label="Reserve 100",value=100} }, TP_CATEGORY = { {label="Worlds",value="Worlds"}, {label="Champion City Hub",value="Hub"}, {label="NPCs",value="NPCs"}, {label="Boss Gates",value="BossGates"}, {label="Banners",value="Banners"}, {label="Merchants",value="Merchants"}, {label="Machines",value="Machines"} }, MERCHANT_CURRENCY = { {label="Gold (Gold Merchant)",value="GoldMerchant"}, {label="Raid Medals (Raid Merchant)",value="RaidMerchant"}, {label="Comet Shards (Shard Merchant)",value="ShardMerchant"}, {label="Defense Crystals (Defense Merchant)",value="DefenseMerchant"} }, REWARD_SOURCE = { {label="Daily Bonus",value="daily_bonus"}, {label="Milestones",value="milestones"}, {label="Season Pass",value="season_pass"}, {label="Countdown Pack",value="countdown_pack"}, {label="Free Store Claims",value="free_store"}, {label="Discoveries",value="discoveries"}, {label="Optional Gifts (Removes F2P)",value="gifts"} }, AFTER_MATCH_VOTE = { {label="Retry",value="retry"}, {label="Next",value="next"}, {label="Return to Lobby",value="lobby"} }, RETURN_SERVER_MODE = { {label="Lobby (Normal)",value="lobby"}, {label="Previous Server Before Run",value="previous"}, {label="Saved Private Server",value="saved"} }, SLOT_KEYCODES = { Enum.KeyCode.One, Enum.KeyCode.Two, Enum.KeyCode.Three, Enum.KeyCode.Four, Enum.KeyCode.Five, Enum.KeyCode.Six, Enum.KeyCode.Seven, Enum.KeyCode.Eight, Enum.KeyCode.Nine, Enum.KeyCode.Zero }, } local state = { running = true, activeTab = "Farm", farmSubTab = "Combat", raidsSubTab = "Raid", autoFarm = false, autoClick = true, autoAbilities = false, abilitySlots = { [1]=true,[2]=true,[3]=true,[4]=true,[5]=true,[6]=true,[7]=false,[8]=false,[9]=false,[10]=false }, questPriority = false, moveMode = "Tween", autoWorldTravel = true, autoRetreatOnStop = true, farmWorld = "Current", maxRange = 0, tweenSpeed = 90, offsetZ = 6, offsetY = 0, engageRange = 18, abilityInterval = 1.0, lastAbilityTime = 0, lastTravelAttempt = 0, selectedEnemies = {}, activeTween = nil, currentTarget = nil, clickedTarget = nil, autoOpenChests = false, openKeyChests = false, lastChestCheck = 0, autoGetQuests = false, fullAutoQuest = false, includeDailyQuests = false, includeStageQuests = false, autoClaimFinishedQuests = true, autoNpcTravel = true, questMap = "Current", selectedQuestlines = {}, questCheckInterval = 12, lastQuestCheck = 0, lastClaimQuestCheck = 0, isDoingQuestAction = false, autoBoss = false, bossWorld = "Current", autoRepairGate = true, autoChallengeBoss = true, autoOpenChest = true, bossCooldownEnd = 0, isDoingBossRun = false, autoCollectDrops = true, dropsCollected = 0, dropTotals = {}, dropLogs = {}, onDropLogUpdated = nil, tpCategory = "Worlds", autoBuyMerchants = false, selectedMerchants = { GoldMerchant=false, RaidMerchant=false, ShardMerchant=false, DefenseMerchant=false }, selectedMerchantItems = {}, lastMerchantCheck = 0, autoClaimRewards = false, rewardSources = { daily_bonus=true, milestones=true, season_pass=true, countdown_pack=true, free_store=true, discoveries=true, gifts=false }, lastRewardCheck = 0, autoSummon = false, summonBanner = "alien", summonCount = 10, summonBooster = "none", summonDelay = 0.1, skipAnimation = true, stopSummonTargets = {}, autoLockHigh = true, autoDismantle = false, dismantleRarities = { Common=true, Rare=true }, lastSummonTime = 0, autoTraitReroll = false, traitUnitUid = nil, traitSlot = 1, targetTraits = {}, traitSafetyGuard = true, traitMinTokens = 0, lastTraitTime = 0, unitSelectedUid = nil, unitFeedFruit = "auto", unitBulkRarities = { Common=true, Rare=true }, unitShinyGuard = true, autoEquipBestBase = false, lastEquipCheck = 0, autoRaid = false, raidBaseId = "offered", raidTier = 1, raidAutoStart = true, raidAutoEngage = true, autoVoteBoons = true, autoReadyNextStage = true, boonPriority = getDefaultBoonPriority(), lastRaidAction = 0, lastIntermissionVoted = "", autoStage = false, stageMissionId = "alien_rescue", stageAutoStart = true, stageAutoEngage = true, autoSkipCutscenes = true, afterMatchVote = "retry", lastCutsceneSkip = 0, returnServerMode = "lobby", savedServerPlaceId = 0, savedServerJobId = "", preRunPlaceId = 0, preRunJobId = "", pendingPostRunReturn = false, autoReturnPostRun = true, lastReturnAttempt = 0, autoExecuteOnTeleport = false, queuedTeleportHook = false, antiAfk = true, connections = {}, } -- Persistence & Auto-Execute on Teleport local CFG_FOLDER, CFG_PATH = "ACXStudio", "ACXStudio/config.json" local PERSIST_KEYS = { "activeTab","farmSubTab","raidsSubTab","autoFarm","autoClick","autoAbilities","abilitySlots","questPriority","moveMode", "autoWorldTravel","autoRetreatOnStop","farmWorld","maxRange","tweenSpeed","abilityInterval","selectedEnemies", "autoOpenChests","openKeyChests","autoGetQuests","fullAutoQuest","includeDailyQuests","includeStageQuests", "autoClaimFinishedQuests","autoNpcTravel","questMap","selectedQuestlines","autoBoss","bossWorld","autoRepairGate", "autoChallengeBoss","autoOpenChest","autoCollectDrops","selectedMerchants","selectedMerchantItems","autoBuyMerchants", "autoClaimRewards","rewardSources","autoSummon","summonBanner","summonCount","summonBooster","summonDelay","skipAnimation", "stopSummonTargets","autoLockHigh","autoDismantle","dismantleRarities","traitUnitUid","traitSlot","targetTraits", "traitSafetyGuard","traitMinTokens","unitSelectedUid","unitFeedFruit","unitBulkRarities","unitShinyGuard","autoEquipBestBase", "autoRaid","raidBaseId","raidTier","raidAutoStart","raidAutoEngage","autoVoteBoons","autoReadyNextStage","boonPriority","antiAfk", "autoStage","stageMissionId","stageAutoStart","stageAutoEngage","autoSkipCutscenes","afterMatchVote", "returnServerMode","savedServerPlaceId","savedServerJobId","preRunPlaceId","preRunJobId","pendingPostRunReturn", "autoReturnPostRun","autoExecuteOnTeleport", } local function saveConfig() if not writefile then return false, "writefile unavailable" end if makefolder then pcall(makefolder, CFG_FOLDER) end local out = {} if isfile and readfile and isfile(CFG_PATH) then local okR, raw = pcall(readfile, CFG_PATH) if okR and type(raw) == "string" and raw ~= "" then local okD, dec = pcall(HttpService.JSONDecode, HttpService, raw) if okD and type(dec) == "table" then out = dec end end end for _, k in ipairs(PERSIST_KEYS) do out[k] = state[k] end local ok, enc = pcall(HttpService.JSONEncode, HttpService, out) if not ok then return false, tostring(enc) end return pcall(writefile, CFG_PATH, enc) end local function loadConfig() if not (isfile and readfile and isfile(CFG_PATH)) then return false end local okR, raw = pcall(readfile, CFG_PATH) if not okR or type(raw) ~= "string" or raw == "" then return false end local okD, dec = pcall(HttpService.JSONDecode, HttpService, raw) if not okD or type(dec) ~= "table" then return false end for _, k in ipairs(PERSIST_KEYS) do if dec[k] ~= nil then state[k] = dec[k] end end if type(state.abilitySlots) == "table" then local fixed = {} for k, v in pairs(state.abilitySlots) do local n = tonumber(k) if n then fixed[n] = (v == true) end end for i = 1, 10 do if fixed[i] == nil then fixed[i] = (i <= 6) end end state.abilitySlots = fixed end if type(state.boonPriority) ~= "table" or #state.boonPriority == 0 then state.boonPriority = getDefaultBoonPriority() end return true end loadConfig() -- Anti-AFK (Idled hook + periodic VirtualUser/VIM heartbeat) do local function pulseAntiAfk() if not state.antiAfk then return end local okVU, vu = pcall(game.GetService, game, "VirtualUser") if okVU and vu then pcall(function() vu:CaptureController() vu:ClickButton2(Vector2.new()) end) elseif VirtualInputManager then pcall(function() VirtualInputManager:SendKeyEvent(true, Enum.KeyCode.RightControl, false, game) task.wait(0.03) VirtualInputManager:SendKeyEvent(false, Enum.KeyCode.RightControl, false, game) end) end end table.insert(state.connections, LocalPlayer.Idled:Connect(pulseAntiAfk)) task.spawn(function() while state.running do task.wait(120) if state.running and state.antiAfk then pulseAntiAfk() end end end) end local function queueTeleportReload() local qFunc = queue_on_teleport or queueonteleport or (syn and syn.queue_on_teleport) if not qFunc then return false end local env = (getgenv and getgenv()) or _G local key = tostring(game.PlaceId) .. ":" .. tostring(game.JobId) if env.__ACX_TP_KEY == key then return true end env.__ACX_TP_KEY = key return pcall(qFunc, [[task.spawn(function() repeat task.wait(0.25) until game:IsLoaded() local lp = game:GetService("Players").LocalPlayer or game:GetService("Players").PlayerAdded:Wait() if not lp.Character then lp.CharacterAdded:Wait() end task.wait(1.0) local src = nil if isfile and readfile and isfile("ACXStudio/autofarm_main.luau") then src = readfile("ACXStudio/autofarm_main.luau") else local okH, body = pcall(function() return game:HttpGet("https://raw.githubusercontent.com/zck1412/Anime-Champ/refs/heads/main/autofarm_main.luau") end) if okH and type(body) == "string" and #body > 100 then src = body end end if src then local fn = loadstring(src) if fn then pcall(fn) end end end)]]) end local function syncAutoExecuteSetup() saveConfig() if state.autoExecuteOnTeleport and not state.queuedTeleportHook then state.queuedTeleportHook = true queueTeleportReload() table.insert(state.connections, LocalPlayer.OnTeleport:Connect(function() saveConfig() if state.autoExecuteOnTeleport then queueTeleportReload() end end)) end end if state.autoExecuteOnTeleport then task.defer(syncAutoExecuteSetup) end -- Common Helpers local function getCharacterParts() local char = LocalPlayer.Character if not char then return nil, nil, nil end local hum = char:FindFirstChildOfClass("Humanoid") local hrp = char:FindFirstChild("HumanoidRootPart") if not hum or not hrp or hum.Health <= 0 then return nil, nil, nil end return char, hum, hrp end local function isEnemyAlive(model) if not model or not model.Parent or Players:GetPlayerFromCharacter(model) or isChampionModel(model) or model:FindFirstAncestor("Geometry") then return false end local hum = model:FindFirstChildOfClass("Humanoid") local hrp = model:FindFirstChild("HumanoidRootPart") or model.PrimaryPart return hum ~= nil and hrp ~= nil and hum.Health > 0 end local function resolveWorldName(worldValue) return (not worldValue or worldValue == "Current") and (LocalPlayer:GetAttribute("OverworldWorldId") or "All") or worldValue end local function isModelInWorld(model, worldName) if not worldName or worldName == "All" then return true end local maps = workspace:FindFirstChild("Maps") local mapModel = maps and maps:FindFirstChild(worldName) if not mapModel then return true end local hrp = model:IsA("BasePart") and model or (model:FindFirstChild("HumanoidRootPart") or (model:IsA("Model") and model.PrimaryPart)) if not hrp then return false end local ok, cf, size = pcall(function() return mapModel:GetBoundingBox() end) if ok and cf and size then local rel = cf:PointToObjectSpace(hrp.Position) return math.abs(rel.X) <= (size.X * 0.5 + 150) and math.abs(rel.Z) <= (size.Z * 0.5 + 150) end return (hrp.Position - mapModel:GetPivot().Position).Magnitude <= 1200 end local function cancelActiveTween() if state.activeTween then pcall(function() state.activeTween:Cancel() end) state.activeTween = nil end end local function moveToCFrame(hrp, targetCFrame, waitUntilDone) if state.moveMode == "Instant" then cancelActiveTween() hrp.CFrame = targetCFrame return end local dist = (hrp.Position - targetCFrame.Position).Magnitude if dist < 2 then cancelActiveTween() hrp.CFrame = targetCFrame return end local dur = math.clamp(dist / math.max(state.tweenSpeed, 10), 0.05, 8) cancelActiveTween() local tw = TweenService:Create(hrp, TweenInfo.new(dur, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), { CFrame = targetCFrame }) state.activeTween = tw tw:Play() if waitUntilDone then tw.Completed:Wait() end end local function retreatUnits() if not state.autoRetreatOnStop then return end local net = ReplicatedStorage:FindFirstChild("Network") local r = net and net:FindFirstChild("RetreatUnits") if r and r:IsA("RemoteEvent") then pcall(function() r:FireServer() end) end end local function ensureWorldTravel(targetWorld, statusLabel) if not state.autoWorldTravel or not targetWorld or targetWorld == "All" then return end if LocalPlayer:GetAttribute("OverworldWorldId") == targetWorld or (os.clock() - state.lastTravelAttempt) < 3 then return end state.lastTravelAttempt = os.clock() local net = ReplicatedStorage:FindFirstChild("Network") local tr = net and net:FindFirstChild("Overworld_Travel") if tr and tr:IsA("RemoteFunction") then if statusLabel then statusLabel.Text = " Traveling to " .. targetWorld .. "..." end pcall(function() tr:InvokeServer(targetWorld) end) task.wait(1.2) end end local function triggerPrompt(prompt) if not prompt or not prompt.Parent then return end if fireproximityprompt then pcall(fireproximityprompt, prompt) else pcall(function() prompt:InputHoldBegin() task.wait(math.max(prompt.HoldDuration, 0.05)) prompt:InputHoldEnd() end) end end local function clickGuiButton(btn) if not btn or not btn:IsA("GuiButton") then return false end if firesignal then pcall(firesignal, btn.Activated) pcall(firesignal, btn.MouseButton1Click) return true end return false end local function getPromptPosition(prompt) local p = prompt.Parent if p:IsA("BasePart") then return p.Position end if p:IsA("Attachment") and p.Parent:IsA("BasePart") then return p.Parent.Position end if p:IsA("Model") then return p:GetPivot().Position end return nil end local function findInstancePosition(inst) if not inst then return nil end if inst:IsA("BasePart") then return inst.Position end if inst:IsA("Model") then return inst:GetPivot().Position end local p = inst:FindFirstChildWhichIsA("BasePart", true) return p and p.Position or nil end local function worldOfInstance(inst) local maps = workspace:FindFirstChild("Maps") if not maps or not inst then return nil end local cur = inst while cur and cur.Parent do if cur.Parent == maps then return cur.Name end cur = cur.Parent end return nil end local function formatSeconds(sec) sec = math.max(0, math.floor(sec)) local m, s = math.floor(sec / 60), sec % 60 return m > 0 and string.format("%dm %02ds", m, s) or string.format("%ds", s) end local function getWorldChoices() local opts = { {label="Current World",value="Current"}, {label="All Worlds",value="All"} } local maps = workspace:FindFirstChild("Maps") if maps then for _, m in ipairs(maps:GetChildren()) do table.insert(opts, {label=m.Name,value=m.Name}) end end return opts end local function getRarityChoices() local order = (RarityConfig and RarityConfig.ORDER) or { "Common","Rare","Epic","Legendary","Mythic","Secret" } local out = {} for _, r in ipairs(order) do local d = (RarityConfig and RarityConfig.getDisplayName and RarityConfig.getDisplayName(r)) or r table.insert(out, { label = d, value = r }) end return out end local function getBannerChoices() local ids = (BannerRules and BannerRules.orderedIds and BannerRules.orderedIds()) or { "alien","pirate","ninja","city" } local out = {} for _, id in ipairs(ids) do local cfg = BannerConfig and BannerConfig[id] table.insert(out, { label = ((cfg and cfg.displayName) or id) .. " (" .. id .. ")", value = id }) end return out end local function getTraitChoices() local out = {} for _, id in ipairs((TraitDefs and TraitDefs.ids and TraitDefs.ids()) or {}) do local def = TraitDefs.get and TraitDefs.get(id) table.insert(out, { label = string.format("%s [%s]", (def and def.displayName) or id, (def and def.rarity) or ""), value = id }) end table.sort(out, function(a, b) return a.label < b.label end) return out end local function getAbilitySlotChoices() local out = {} for i = 1, 10 do table.insert(out, { label = "Slot " .. i, value = i }) end return out end -- Safe Chests (Anti-Robux Guard + Optional Key Chests) local function isChestEligible(chestInst, allowKeyChests) if not chestInst or not chestInst.Parent then return false, nil, false end local chestId = chestInst:GetAttribute("ChestId") if not chestId then return false, nil, false end if ChestClaimants and ChestClaimants.mayClaim then if not ChestClaimants.mayClaim(chestInst:GetAttribute(ChestClaimants.ATTRIBUTE), LocalPlayer.UserId) then return false, chestId, false end end local keyId = chestInst:GetAttribute((ChestClaimants and ChestClaimants.KEY_ATTRIBUTE) or "LockKeyItemId") if keyId ~= nil and tostring(keyId) ~= "" then if not allowKeyChests then return false, chestId, true end local snap = getDataSnapshot() local cnt = (snap and snap.Items and snap.Items[keyId]) or 0 local freeAttr = chestInst:GetAttribute((ChestClaimants and ChestClaimants.FREE_ATTRIBUTE) or "LockFreeUserIds") if not (ChestClaimants and ChestClaimants.opensFor and ChestClaimants.opensFor(freeAttr, LocalPlayer.UserId, cnt)) then return false, chestId, true -- Anti-Robux Guard: NEVER open if opensFor is false end end return true, chestId, (keyId ~= nil) end local function openEligibleChests(worldFilter, allowKeyChests, statusLabel) local net = ReplicatedStorage:FindFirstChild("Network") local openRemote = net and net:FindFirstChild("OpenChest") if not openRemote then return 0 end local opened = 0 for _, inst in ipairs(CollectionService:GetTagged("Chest")) do if (not worldFilter or worldFilter == "All" or isModelInWorld(inst, worldFilter)) then local ok, cid, isKey = isChestEligible(inst, allowKeyChests) if ok then local _, _, hrp = getCharacterParts() local pos = findInstancePosition(inst) if hrp and pos then if statusLabel then statusLabel.Text = string.format(" Opening %sChest: %s", isKey and "Key " or "", tostring(cid)) end if (hrp.Position - pos).Magnitude > 14 then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,4), pos), true) task.wait(0.1) end pcall(function() openRemote:FireServer(cid) end) opened = opened + 1 task.wait(0.25) end end end end return opened end -- Champions, Summon, Traits, Units local function getChampionInfo(champId) if CharacterDefs and CharacterDefs.get then local ok, def = pcall(CharacterDefs.get, champId) if ok and def then return def.displayName or champId, def.rarity or "Common" end end return tostring(champId), "Common" end local function getEquippedSet(snap) local s = {} for _, uid in pairs((snap and snap.EquippedChampions) or {}) do s[uid] = true end return s end local function getChampionChoices() local snap = getDataSnapshot() if not snap or not snap.Champions then return {} end local eq, out = getEquippedSet(snap), {} for uid, ch in pairs(snap.Champions) do local nm, rar = getChampionInfo(ch.id) local lvl = (LevelConfig and LevelConfig.resolve) and LevelConfig.resolve(ch).level or 1 local tags = {} if eq[uid] then table.insert(tags, "EQ") end if ch.locked then table.insert(tags, "LOCK") end if ch.shiny then table.insert(tags, "SHINY") end local tStr = #tags > 0 and (" [" .. table.concat(tags, ",") .. "]") or "" table.insert(out, { label = string.format("%s Lv.%d %d* (%s)%s [%s/%s]", nm, lvl, ch.stars or 0, rar, tStr, tostring((ch.traits and ch.traits[1]) or "-"), tostring((ch.traits and ch.traits[2]) or "-")), value = uid, level = lvl }) end table.sort(out, function(a, b) return a.level ~= b.level and a.level > b.level or a.label < b.label end) return out end local function getSelectedChampionLabel(uid) if not uid then return "Select Champion" end local snap = getDataSnapshot() local ch = snap and snap.Champions and snap.Champions[uid] if not ch then return "Select Champion" end local nm, rar = getChampionInfo(ch.id) local lvl = (LevelConfig and LevelConfig.resolve) and LevelConfig.resolve(ch).level or 1 return string.format("%s Lv.%d (%s)", nm, lvl, rar) end local function getBannerPoolChoices() local out = {} if BannerRules and BannerRules.poolIds then local ok, pool = pcall(BannerRules.poolIds, state.summonBanner) if ok and type(pool) == "table" then for _, cid in ipairs(pool) do local n, r = getChampionInfo(cid) table.insert(out, { label = string.format("%s [%s]", n, r), value = cid }) end end end return out end local function getFruitChoices() local out = { { label = "Auto (Best Available)", value = "auto" } } if ItemDefs and ItemDefs.ids then for _, id in ipairs(ItemDefs.ids()) do if ItemDefs.isFeedable and ItemDefs.isFeedable(id) then local d = ItemDefs.get(id) table.insert(out, { label = (d and d.displayName) or id, value = id }) end end end return out end local function lockHighRarityAndShiny() local snap = getDataSnapshot() if not snap or not snap.Champions then return 0 end local locks, cnt = {}, 0 for uid, ch in pairs(snap.Champions) do if not ch.locked then local _, rar = getChampionInfo(ch.id) if ch.shiny == true or rar == "Mythic" or rar == "Secret" then locks[uid] = true cnt = cnt + 1 end end end if cnt > 0 then local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("SetChampionLocks") if rem then pcall(function() rem:InvokeServer(locks) end) end end return cnt end local function dismantleByRarity(raritySet, shinyGuard, statusLabel) local snap = getDataSnapshot() if not snap or not snap.Champions then return 0 end local eq, uids = getEquippedSet(snap), {} for uid, ch in pairs(snap.Champions) do if not ch.locked and not eq[uid] and not (shinyGuard and ch.shiny == true) then local _, rar = getChampionInfo(ch.id) if raritySet[rar] then table.insert(uids, uid) end end end if #uids > 0 then local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("DismantleChampions") if rem then local ok, res = pcall(function() return rem:InvokeServer(uids) end) if ok and res and res.success and statusLabel then statusLabel.Text = string.format(" Dismantled %d champion(s)", #uids) return #uids end end end return 0 end local function bulkLockByRarity(raritySet, lockState, statusLabel) local snap = getDataSnapshot() if not snap or not snap.Champions then return 0 end local locks, cnt = {}, 0 for uid, ch in pairs(snap.Champions) do local _, rar = getChampionInfo(ch.id) if raritySet[rar] and (ch.locked == true) ~= lockState then locks[uid] = lockState cnt = cnt + 1 end end if cnt > 0 then local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("SetChampionLocks") if rem then local ok, res = pcall(function() return rem:InvokeServer(locks) end) if ok and res and res.success and statusLabel then statusLabel.Text = string.format(" %s %d champion(s)", lockState and "Locked" or "Unlocked", cnt) end end end return cnt end local function equipBestBaseStatsAction(statusLabel, silent) local snap = getDataSnapshot() if not snap or not snap.Champions or not ChampionRanking or not EquipSlotsConfig then return end local baseChamps = {} for uid, ch in pairs(snap.Champions) do local cl = table.clone(ch) cl.total_xp = 0 baseChamps[uid] = cl end local slots = EquipSlotsConfig.resolve(snap) local cur = snap.EquippedChampions or {} local best = ChampionRanking.pickBest(baseChamps, slots, cur) if not best then return end local same = (#best == #cur) if same then local curSet = {} for _, u in ipairs(cur) do curSet[u] = true end for _, u in ipairs(best) do if not curSet[u] then same = false break end end end if same then if not silent and statusLabel then statusLabel.Text = " Units: Already wearing best base team!" end return end local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("SetEquippedChampions") if rem then rem:FireServer(best) if statusLabel then local names = {} for _, u in ipairs(best) do local c = snap.Champions[u] if c then table.insert(names, (getChampionInfo(c.id))) end end statusLabel.Text = " Base Best (" .. #best .. "): " .. table.concat(names, ", ") end end end local function dismissBannerCutsceneOverlay() for _, gui in ipairs(PlayerGui:GetChildren()) do if gui:IsA("ScreenGui") and gui.Enabled and gui.Name ~= EXISTING_GUI_NAME then local gL = gui.Name:lower() if gL:find("summon") or gL:find("unlock") or gL:find("reveal") then local anyBtn = false for _, b in ipairs(gui:GetDescendants()) do if b:IsA("GuiButton") and b.Visible then local t = b:IsA("TextButton") and b.Text:lower() or "" if t == "" or t:find("skip") or t:find("continue") or t:find("tap") or t:find("close") then if clickGuiButton(b) then anyBtn = true end end end end if not anyBtn then for _, child in ipairs(gui:GetChildren()) do if child:IsA("GuiObject") and child.Visible then pcall(function() VirtualInputManager:SendMouseButtonEvent(400,300,0,true,game,1) VirtualInputManager:SendMouseButtonEvent(400,300,0,false,game,1) end) break end end end end end end end local function runOneSummon(statusLabel) local pullRemote = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("PullFromBanner") if not pullRemote then return end local boosterArg = (state.summonBooster ~= "none") and state.summonBooster or nil if boosterArg then local s = getDataSnapshot() if ((s and s.Items and s.Items[boosterArg]) or 0) <= 0 then boosterArg = nil end end local ok, res = pcall(function() return pullRemote:InvokeServer(state.summonBanner, state.summonCount, boosterArg) end) if not ok or type(res) ~= "table" then if statusLabel then statusLabel.Text = " Summon failed" end return end if not res.success then if statusLabel then statusLabel.Text = " Summon: " .. tostring(res.reason or res.error or "stopped") end state.autoSummon = false return end if state.skipAnimation then dismissBannerCutsceneOverlay() end local stopHit, pulled = nil, 0 for _, entry in ipairs(res.champions or res.pulls or res.results or {}) do pulled = pulled + 1 local cid = (type(entry) == "table" and entry.id) or entry if cid and state.stopSummonTargets[cid] then stopHit = getChampionInfo(cid) end end if state.autoLockHigh then lockHighRarityAndShiny() end if state.autoEquipBestBase then equipBestBaseStatsAction(statusLabel, true) end if state.autoDismantle and next(state.dismantleRarities) ~= nil then dismantleByRarity(state.dismantleRarities, true, nil) end if stopHit then state.autoSummon = false if statusLabel then statusLabel.Text = " Summon: Got target " .. stopHit .. "!" end elseif statusLabel then statusLabel.Text = string.format(" Summoned %dx (%d new)", state.summonCount, pulled) end end local function runTraitRerollStep(statusLabel) local uid = state.traitUnitUid if not uid then if statusLabel then statusLabel.Text = " Traits: Select a champion first" end state.autoTraitReroll = false return end if next(state.targetTraits) == nil then if statusLabel then statusLabel.Text = " Traits: Select target traits" end state.autoTraitReroll = false return end local snap = getDataSnapshot() local ch = snap and snap.Champions and snap.Champions[uid] if not ch then if statusLabel then statusLabel.Text = " Traits: Champion not found" end state.autoTraitReroll = false return end local tokens = (snap.Items and snap.Items.trait_tokens) or 0 if tokens <= state.traitMinTokens or tokens < 1 then if statusLabel then statusLabel.Text = string.format(" Traits: Reached reserve (%d left)", tokens) end state.autoTraitReroll = false return end local traits = ch.traits or {} local function kept(s) local tr = traits[s] if tr and state.targetTraits[tr] then return true end if tr and state.traitSafetyGuard and TraitDefs and TraitDefs.get then local def = TraitDefs.get(tr) if def and (def.rarity == "Mythic" or def.rarity == "Secret") then return true end end return false end local slotToRoll if state.traitSlot == 1 or state.traitSlot == 2 then if kept(state.traitSlot) then if statusLabel then statusLabel.Text = string.format(" Traits: Slot %d kept (%s)", state.traitSlot, tostring(traits[state.traitSlot])) end state.autoTraitReroll = false return end slotToRoll = state.traitSlot else if not kept(1) then slotToRoll = 1 elseif not kept(2) then slotToRoll = 2 else if statusLabel then statusLabel.Text = " Traits: Both slots kept!" end state.autoTraitReroll = false return end end local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("RerollChampionTrait") if not rem then return end local ok, res = pcall(function() return rem:InvokeServer(uid, tostring(slotToRoll)) end) if ok and type(res) == "table" and res.success then local rId = res.trait or res.traitId or "?" if statusLabel then statusLabel.Text = string.format(" Trait Slot %d -> %s (%d left)", slotToRoll, tostring(rId), tokens - 1) end if state.targetTraits[rId] and state.traitSlot ~= 0 then state.autoTraitReroll = false if statusLabel then statusLabel.Text = " Traits: HIT " .. tostring(rId) .. "!" end end else state.autoTraitReroll = false if statusLabel then statusLabel.Text = " Traits stopped: " .. tostring(ok and (res and res.reason) or res) end end end local function feedChampionAction(toCap, statusLabel) local uid = state.unitSelectedUid if not uid then if statusLabel then statusLabel.Text = " Units: Select a champion first" end return end local snap = getDataSnapshot() local ch = snap and snap.Champions and snap.Champions[uid] if not ch then return end local items, fruitOrder = snap.Items or {}, {} if state.unitFeedFruit == "auto" then for _, c in ipairs(getFruitChoices()) do if c.value ~= "auto" and (items[c.value] or 0) > 0 then local fDef = ItemDefs.getFood(c.value) table.insert(fruitOrder, { id = c.value, xp = (fDef and fDef.xp) or 1, count = items[c.value] }) end end table.sort(fruitOrder, function(a, b) return a.xp > b.xp end) elseif (items[state.unitFeedFruit] or 0) > 0 then local fDef = ItemDefs.getFood(state.unitFeedFruit) table.insert(fruitOrder, { id = state.unitFeedFruit, xp = (fDef and fDef.xp) or 1, count = items[state.unitFeedFruit] }) end if #fruitOrder == 0 then if statusLabel then statusLabel.Text = " Units: No fruits available" end return end local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("FeedChampion") if not rem then return end if not toCap then local ok, res = pcall(function() return rem:InvokeServer(uid, { [fruitOrder[1].id] = 1 }) end) if statusLabel then statusLabel.Text = (ok and res and res.success) and (" Units: Fed 1x " .. fruitOrder[1].id) or (" Feed: " .. tostring(res and res.reason or "max/failed")) end return end local maxLvl = (ChampionLevelCap and ChampionLevelCap.forChampion) and ChampionLevelCap.forChampion(snap, ch) or 100 local capXP = (LevelConfig and LevelConfig.xpForLevel) and LevelConfig.xpForLevel(maxLvl) or 999999999 local need = capXP - (ch.total_xp or 0) if need <= 0 then if statusLabel then statusLabel.Text = " Units: Already at Lv." .. maxLvl .. " cap!" end return end local bag = {} for _, f in ipairs(fruitOrder) do if need <= 0 then break end local take = math.min(f.count, math.ceil(need / math.max(f.xp, 1))) if take > 0 then bag[f.id] = take need = need - (take * f.xp) end end local ok, res = pcall(function() return rem:InvokeServer(uid, bag) end) if statusLabel then statusLabel.Text = (ok and res and res.success) and " Units: Fed to cap!" or (" Feed cap: " .. tostring(res and res.reason or "failed")) end end local function autoFillAscendAction(statusLabel) local uid = state.unitSelectedUid if not uid then return end local snap = getDataSnapshot() local target = snap and snap.Champions and snap.Champions[uid] if not target then return end local eq, mats = getEquippedSet(snap), {} for mUid, ch in pairs(snap.Champions) do if mUid ~= uid and not ch.locked and not eq[mUid] and not (state.unitShinyGuard and ch.shiny) and ch.id == target.id then table.insert(mats, mUid) end end if #mats == 0 then if statusLabel then statusLabel.Text = " Ascend: No unlocked dupes" end return end local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("FuseChampion") if rem then local ok, res = pcall(function() return rem:InvokeServer(uid, mats) end) if statusLabel then statusLabel.Text = (ok and res and res.success) and string.format(" Ascended (%d dupes)!", #mats) or (" Ascend: " .. tostring(res and res.reason or "failed")) end end end local function evolveChampionAction(statusLabel) local uid = state.unitSelectedUid if not uid then return end local rem = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("EvolveChampion") if rem then local ok, res = pcall(function() return rem:InvokeServer(uid) end) if statusLabel then statusLabel.Text = (ok and res and res.success) and " Units: Evolved!" or (" Evolve: " .. tostring(res and res.reason or "not ready")) end end end -- Drops & Network Listeners local function recordDrop(itemName, amount, source) local key, qty = tostring(itemName or "Drop"), tonumber(amount) or 1 state.dropTotals[key] = (state.dropTotals[key] or 0) + qty table.insert(state.dropLogs, 1, string.format("[%s] +%d %s (%s)", os.date("%H:%M:%S"), qty, key, source or "Drop")) if #state.dropLogs > 80 then table.remove(state.dropLogs) end if state.onDropLogUpdated then task.defer(state.onDropLogUpdated) end end local function isFieldDropInstance(inst) if not inst or not inst.Parent or Players:GetPlayerFromCharacter(inst) or isChampionModel(inst) or inst:FindFirstChildOfClass("Humanoid") then return false end if inst:GetAttribute("DropId") ~= nil or inst:GetAttribute("ItemId") ~= nil then return true end local n = inst.Name:lower() return (n:find("drop") or n:find("orb") or n:find("loot") or n:find("gem") or n:find("coin") or n:find("shard")) and (inst:IsA("Model") or inst:IsA("BasePart")) end local seenDrops = setmetatable({}, { __mode = "k" }) local function collectFieldDrop(inst) if not state.autoCollectDrops or not isFieldDropInstance(inst) or (seenDrops[inst] and (os.clock() - seenDrops[inst]) < 4) then return end seenDrops[inst] = os.clock() local _, _, hrp = getCharacterParts() if not hrp then return end local cr = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("ClaimDrop") if cr and cr:IsA("RemoteEvent") then pcall(function() cr:FireServer(inst:GetAttribute("DropId") or inst:GetAttribute("Id") or inst.Name) end) pcall(function() cr:FireServer(inst) end) end local part = inst:IsA("BasePart") and inst or (inst:IsA("Model") and (inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart"))) if part and firetouchinterest then pcall(function() firetouchinterest(hrp, part, 0) firetouchinterest(hrp, part, 1) end) end for _, d in ipairs(inst:GetDescendants()) do if d:IsA("ProximityPrompt") and d.Enabled then triggerPrompt(d) end end state.dropsCollected = state.dropsCollected + 1 recordDrop(inst.Name, 1, "Field") end local function scanAndCollectFieldDrops() if not state.autoCollectDrops then return end for _, c in ipairs({ workspace, workspace:FindFirstChild("Effects") }) do if c then for _, ch in ipairs(c:GetChildren()) do if isFieldDropInstance(ch) then collectFieldDrop(ch) end end end end end do local net = ReplicatedStorage:FindFirstChild("Network") if net then local cd = net:FindFirstChild("OverworldBoss_ChestCooldown") if cd and cd:IsA("RemoteEvent") then table.insert(state.connections, cd.OnClientEvent:Connect(function(a1, a2) local secs = type(a1)=="number" and a1 or (type(a2)=="number" and a2) or (type(a1)=="table" and (a1.remaining or a1.cooldown or a1.seconds or a1.duration)) if secs and secs > 0 then state.bossCooldownEnd = (secs > 1000000000) and (os.clock() + math.max(0, secs - os.time())) or (os.clock() + secs) end end)) end local aw = net:FindFirstChild("AwardDrops") if aw and aw:IsA("RemoteEvent") then table.insert(state.connections, aw.OnClientEvent:Connect(function(p) if type(p) == "table" then for k, v in pairs(p) do if type(v) == "number" then recordDrop(k, v, "Award") elseif type(v) == "table" then recordDrop(v.id or v.name or v.itemId or tostring(k), v.amount or v.count or 1, "Award") end end elseif p ~= nil then recordDrop(tostring(p), 1, "Award") end end)) end local rs = net:FindFirstChild("ResourcesGet_Show") if rs and rs:IsA("RemoteEvent") then table.insert(state.connections, rs.OnClientEvent:Connect(function(a1, a2) if type(a1) == "table" then for k, v in pairs(a1) do recordDrop(type(v)=="table" and (v.name or v.id or tostring(k)) or k, type(v)=="table" and (v.amount or v.count or 1) or v, "Resource") end elseif type(a1) == "string" then recordDrop(a1, tonumber(a2) or 1, "Resource") end end)) end local xp = net:FindFirstChild("KillXP_Gained") if xp and xp:IsA("RemoteEvent") then table.insert(state.connections, xp.OnClientEvent:Connect(function(amt) if type(amt) == "number" and amt > 0 then recordDrop("XP", amt, "Kill") end end)) end end for _, c in ipairs({ workspace, workspace:FindFirstChild("Effects") }) do if c then table.insert(state.connections, c.ChildAdded:Connect(function(ch) if state.autoCollectDrops and isFieldDropInstance(ch) then task.defer(collectFieldDrop, ch) end end)) end end end -- Instant Teleports (Worlds, Hub Warps, NPCs, Boss Gates, Banners, Merchants, Machines) local function getTeleportDestinations(category) local out = {} if category == "Worlds" then local worlds = (OverworldMode and OverworldMode.getReleasedWorlds and OverworldMode.getReleasedWorlds()) or {} if #worlds > 0 then for _, w in ipairs(worlds) do table.insert(out, { label = (w.displayName or w.id) .. " (" .. w.id .. ")", value = w.id, kind = "world", worldId = w.id }) end elseif workspace:FindFirstChild("Maps") then for _, m in ipairs(workspace.Maps:GetChildren()) do table.insert(out, { label = m.Name, value = m.Name, kind = "world", worldId = m.Name }) end end elseif category == "Hub" and HubWarpShared then if HubWarpShared.cityDestinations then local ok, list = pcall(HubWarpShared.cityDestinations) if ok and type(list) == "table" then for _, d in ipairs(list) do local id = type(d) == "table" and d.id or tostring(d) table.insert(out, { label = type(d) == "table" and (d.label or id) or id, value = id, kind = "hub", warpId = id }) end end end if HubWarpShared.worldDestinations then local ok, list = pcall(HubWarpShared.worldDestinations) if ok and type(list) == "table" then for _, d in ipairs(list) do local id = type(d) == "table" and d.id or tostring(d) table.insert(out, { label = "World: " .. id, value = "world:" .. id, kind = "hub", warpId = id }) end end end elseif category == "NPCs" then for _, inst in ipairs(CollectionService:GetTagged("Npc")) do table.insert(out, { label = string.format("%s [%s]", inst:GetAttribute("NpcId") or inst.Name, worldOfInstance(inst) or "?"), value = inst:GetFullName(), kind = "inst", instance = inst, worldId = worldOfInstance(inst) or "?" }) end elseif category == "BossGates" then for _, inst in ipairs(CollectionService:GetTagged("BossGate")) do local w = inst:GetAttribute("WorldId") or worldOfInstance(inst) or "?" table.insert(out, { label = "Boss Gate [" .. tostring(w) .. "]", value = inst:GetFullName(), kind = "inst", instance = inst, worldId = w }) end elseif category == "Banners" then for _, inst in ipairs(CollectionService:GetTagged("Banner")) do local w = worldOfInstance(inst) or "?" table.insert(out, { label = string.format("%s [%s]", inst.Name, w), value = inst:GetFullName(), kind = "inst", instance = inst, worldId = w }) end elseif category == "Merchants" then local seen = {} for _, inst in ipairs(CollectionService:GetTagged("Npc")) do local nid = tostring(inst:GetAttribute("NpcId") or inst.Name) if nid:lower():find("merchant") then local w = worldOfInstance(inst) or "?" if not seen[nid .. "@" .. w] then seen[nid .. "@" .. w] = true table.insert(out, { label = string.format("%s [%s]", nid, w), value = inst:GetFullName(), kind = "inst", instance = inst, worldId = w }) end end end elseif category == "Machines" then for _, inst in ipairs(CollectionService:GetTagged("LobbyMachine")) do local w = worldOfInstance(inst) or "champion_city" table.insert(out, { label = string.format("%s [%s]", inst.Name, w), value = inst:GetFullName(), kind = "inst", instance = inst, worldId = w }) end end table.sort(out, function(a, b) return a.label < b.label end) return out end local function executeTeleport(entry, statusLabel) if not entry then if statusLabel then statusLabel.Text = " Teleport: Select a destination" end return end local net = ReplicatedStorage:FindFirstChild("Network") if entry.kind == "world" then local tr = net and net:FindFirstChild("Overworld_Travel") if tr and tr:IsA("RemoteFunction") then if statusLabel then statusLabel.Text = " Warping -> " .. entry.worldId end pcall(function() tr:InvokeServer(entry.worldId) end) end elseif entry.kind == "hub" then local ok = ClientHubWarpService and ClientHubWarpService.Warp and pcall(ClientHubWarpService.Warp, entry.warpId) if not ok then local hw = net and net:FindFirstChild("HubWarp_Request") if hw and hw:IsA("RemoteFunction") then pcall(function() hw:InvokeServer(entry.warpId) end) end end if statusLabel then statusLabel.Text = " Hub Warp -> " .. tostring(entry.warpId) end elseif entry.kind == "inst" and entry.instance and entry.instance.Parent then if entry.worldId and entry.worldId ~= "?" and LocalPlayer:GetAttribute("OverworldWorldId") ~= entry.worldId then local tr = net and net:FindFirstChild("Overworld_Travel") if tr and tr:IsA("RemoteFunction") then pcall(function() tr:InvokeServer(entry.worldId) end) task.wait(1.0) end end local pos = findInstancePosition(entry.instance) local _, _, hrp = getCharacterParts() if pos and hrp then cancelActiveTween() hrp.CFrame = CFrame.new(pos + Vector3.new(0, 3, 4)) if statusLabel then statusLabel.Text = " Teleported -> " .. entry.label end end end end -- Auto Buy Merchants local function getMerchantItemChoices() local seen, out = {}, {} if not MerchantCatalog or not MerchantCatalog.getAll then return out end for mId, m in pairs(MerchantCatalog.getAll()) do for _, off in ipairs(m.offers or {}) do if off.itemId and not seen[off.itemId] then seen[off.itemId] = true local d = ItemDefs and ItemDefs.get and ItemDefs.get(off.itemId) table.insert(out, { label = string.format("%s (%s)", (d and d.displayName) or off.itemId, m.displayName or mId), value = off.itemId }) end end end table.sort(out, function(a, b) return a.label < b.label end) return out end local function runAutoBuyMerchants(statusLabel, manual) if not MerchantCatalog or not MerchantCatalog.getAll then return 0 end local buyRemote = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("PurchaseMerchantOffer") local snap = getDataSnapshot() if not buyRemote or not snap then return 0 end local hasM, hasI = next(state.selectedMerchants) ~= nil, next(state.selectedMerchantItems) ~= nil if not hasM and not manual then return 0 end local bought, now = 0, workspace:GetServerTimeNow() local weekNum = (QuestsConfig and QuestsConfig.dailyWeekOf) and QuestsConfig.dailyWeekOf(now) or 0 for mId, m in pairs(MerchantCatalog.getAll()) do if (not hasM or state.selectedMerchants[mId]) and MerchantCatalog.isOpen(m, now) then local bal = (snap.Items and snap.Items[m.currencyId]) or 0 for idx, off in ipairs(m.offers or {}) do if (not hasI or state.selectedMerchantItems[off.itemId]) and MerchantCatalog.isOfferUnlocked(off, snap.ClearedBosses or {}) then local pack = (MerchantCatalog.getPackSize and MerchantCatalog.getPackSize(off)) or (off.packSize or 1) local wRec = snap.MerchantWeeklyBuys and MerchantCatalog.weeklyKey and snap.MerchantWeeklyBuys[MerchantCatalog.weeklyKey(mId, off.itemId)] local maxQty = (MerchantCatalog.weeklyLeft and MerchantCatalog.weeklyLeft(off, wRec, weekNum)) or 999 local price = (MerchantCatalog.getTotalPrice and MerchantCatalog.getTotalPrice(off, pack)) or (off.price or 999999) if price > 0 and bal >= price and maxQty >= pack then local packs = math.min(math.floor(bal / price), math.floor(maxQty / pack)) local qty = packs * pack if qty > 0 then local ok, res = pcall(function() return buyRemote:InvokeServer(mId, idx, qty) end) if ok and res == true then bought = bought + qty bal = bal - (packs * price) end end end end end end end if statusLabel and (bought > 0 or manual) then statusLabel.Text = bought > 0 and (" Merchants: Bought " .. bought .. "x") or " Merchants: Nothing affordable" end return bought end -- Auto Claim Rewards & Batch Code Redeemer local function runAutoClaimRewards(statusLabel, manual) local net, snap = ReplicatedStorage:FindFirstChild("Network"), getDataSnapshot() if not net or not snap then return 0 end local claimed, src = 0, state.rewardSources local function inv(name, ...) local r = net:FindFirstChild(name) if r and r:IsA("RemoteFunction") then local args = { ... } local ok, res = pcall(function() return r:InvokeServer(table.unpack(args)) end) if ok and (res == true or (type(res) == "number" and res > 0)) then claimed = claimed + 1 return true end end return false end if src.daily_bonus and snap.DailyBonusClaimed == false then inv("ClaimDailyBonus") end if src.milestones then inv("ClaimAllMilestones") end if src.season_pass then inv("ClaimAllSeasonPass") if snap.SeasonPass and type(snap.SeasonPass.repeatables) == "table" then for rk in pairs(snap.SeasonPass.repeatables) do inv("ClaimSeasonRepeatable", rk) end end end if src.countdown_pack and snap.CountdownPack and next(snap.CountdownPack) ~= nil then local r = net:FindFirstChild("CountdownPack_Claim") if r and r:IsA("RemoteEvent") then pcall(function() r:FireServer() end) claimed = claimed + 1 end end if src.free_store and snap.FreeClaims then for key, can in pairs(snap.FreeClaims) do if can == true and not (snap.PurchasedPacks and snap.PurchasedPacks[key]) then inv("ClaimFreeProduct", key) end end end if src.discoveries then inv("ClaimAllDiscoveries") end if src.gifts and snap.Gifts then for gUid in pairs(snap.Gifts) do inv("ClaimGift", gUid) end end if statusLabel and (claimed > 0 or manual) then statusLabel.Text = claimed > 0 and (" Rewards: Claimed " .. claimed .. "!") or " Rewards: None ready" end return claimed end local function redeemCodesBatch(rawText, statusLabel, resultLbl) if not rawText or rawText == "" then if resultLbl then resultLbl.Text = "Enter codes first" end return end local r = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("RedeemCode") if not r then if resultLbl then resultLbl.Text = "RedeemCode remote missing" end return end local codes, okC, failC = {}, 0, 0 for tok in rawText:gmatch("[^%s,;]+") do table.insert(codes, tok) end for _, code in ipairs(codes) do local ok, res = pcall(function() return r:InvokeServer(code) end) if ok and (res == true or res == "ok" or res == "success" or res == "redeemed") then okC = okC + 1 else failC = failC + 1 end task.wait(0.25) end local msg = string.format("Redeemed %d / Failed %d (Total %d)", okC, failC, #codes) if resultLbl then resultLbl.Text = msg end if statusLabel then statusLabel.Text = " Codes: " .. msg end end -- Quests & Combat Logic local STOP_WORDS = { defeat=true, kill=true, slay=true, collect=true, gather=true, from=true, an=true, a=true, the=true, of=true, ["in"]=true, gems=true, coins=true, drops=true, enemies=true, mobs=true, find=true, repair=true, talk=true, speak=true, meet=true, visit=true, complete=true, clear=true, stage=true, boss=true, turn=true, claim=true, ["return"]=true, orders=true, notes=true } local function extractKeywords(text) local kws = {} local cl = text:lower():gsub("<[^>]+>", " "):gsub("%d+/%d+", " "):gsub("[^%a%d%s]", " ") for w in cl:gmatch("%S+") do if #w >= 3 and not STOP_WORDS[w] then kws[w] = true if w:sub(-1) == "s" and #w > 3 then kws[w:sub(1, -2)] = true end end end return kws end local function classifyObjective(text) local cur, req = text:match("(%d+)%s*/%s*(%d+)") local l = text:lower() if (cur and req and tonumber(cur) >= tonumber(req)) or l:find("turn in") or l:find("claim") or l:find("completed") or l:find("ready") then return "turn_in" end if l:find("repair") or l:find("fix") then return "repair" elseif l:find("level up") or l:find("feed") or l:find("fruit") then return "feed" elseif l:find("equip") then return "equip" elseif l:find("talk") or l:find("speak") or l:find("meet") or l:find("visit") or l:find("return to") then return "meet_npc" elseif l:find("find") or l:find("search") or l:find("inspect") or l:find("locate") or l:find("seals") or l:find("map piece") then return "find" elseif l:find("stage") or l:find("raid") or l:find("defense") or l:find("dungeon") or l:find("wave") or l:find("chase") or l:find("corner") or l:find("rescue") or l:find("drill") then return "stage" elseif l:find("boss") or l:find("emperor") or l:find("portal") then return "boss" end return "combat" end local function parseQuestObjectives() local list, allKws = {}, {} local hud = PlayerGui:FindFirstChild("HUD") local rows = hud and hud:FindFirstChild("QuestTracker") and hud.QuestTracker:FindFirstChild("Rows") if not rows then return list, allKws end for _, row in ipairs(rows:GetChildren()) do if row:IsA("GuiObject") and row.Visible then local qId = row.Name local isDaily = ((QuestsConfig and QuestsConfig.isDailyId and QuestsConfig.isDailyId(qId)) or qId:lower():find("daily")) ~= nil if isDaily and not state.includeDailyQuests then continue end local heading, lines = "", row:FindFirstChild("Lines") local hLbl = lines and lines:FindFirstChild("Kicker") and lines.Kicker:FindFirstChild("Heading") and lines.Kicker.Heading:FindFirstChild("Text") if hLbl and hLbl:IsA("TextLabel") then heading = hLbl.Text:gsub("<[^>]+>", "") end local aBtn = lines and lines:FindFirstChild("ActionRow") and lines.ActionRow:FindFirstChild("Action") and lines.ActionRow.Action:FindFirstChild("Button") for _, desc in ipairs(row:GetDescendants()) do if desc:IsA("TextLabel") and desc.Name == "Text" and desc.Parent and desc.Parent.Name == "Line" and desc.Text ~= "" then local cleanText = desc.Text:gsub("<[^>]+>", "") local lBtn = desc.Parent:FindFirstChild("Action") and desc.Parent.Action:FindFirstChild("Button") local kws = extractKeywords(cleanText) for k in pairs(kws) do allKws[k] = true end table.insert(list, { questId=qId, isDaily=isDaily, heading=heading, headingKeywords=extractKeywords(heading), text=cleanText, kind=classifyObjective(cleanText), keywords=kws, actionBtn=lBtn or aBtn }) end end end end return list, allKws end local function autoClaimFinishedQuestsAction() local snap, net = getDataSnapshot(), ReplicatedStorage:FindFirstChild("Network") local claimRemote = net and net:FindFirstChild("ClaimQuest") if not snap or not QuestLogic or not QuestsConfig or not claimRemote then return 0 end local ctx, claimed = QuestLogic.contextOf(snap), 0 for qId in pairs(snap.QuestProgress or {}) do local isD = (QuestsConfig.isDailyId and QuestsConfig.isDailyId(qId)) or tostring(qId):lower():find("daily") if (not isD or state.includeDailyQuests) and QuestLogic.getQuestState then local st = QuestLogic.getQuestState(qId, ctx) if st == "ready" or st == "ready_to_claim" or st == "complete" or st == "claimable" then local ok, res = pcall(function() return claimRemote:InvokeServer(qId) end) if ok and res then claimed = claimed + 1 end end end end return claimed end local function scanQuestItemChoices() local out, seen = {}, {} local function add(qi) if seen[qi] then return end seen[qi] = true local qid = qi:GetAttribute("QuestItemId") or qi.Name local w = worldOfInstance(qi) or "?" table.insert(out, { label = string.format("%s [%s]", tostring(qid), w), value = qi:GetFullName(), instance = qi, worldId = w }) end for _, qi in ipairs(CollectionService:GetTagged("QuestItem")) do add(qi) end if workspace:FindFirstChild("Maps") then for _, d in ipairs(workspace.Maps:GetDescendants()) do if d:GetAttribute("QuestItemId") ~= nil then add(d) end end end table.sort(out, function(a, b) return a.label < b.label end) return out end local function getMatchScore(name, keywords) local l, sc = name:lower(), 0 for kw in pairs(keywords) do if l:find(kw, 1, true) then sc = sc + 1 end end return sc end local function findMatchingSpawnCampPositions(keywords, worldName) local maps = workspace:FindFirstChild("Maps") if not maps then return {} end local matches = {} for _, mm in ipairs(maps:GetChildren()) do if not worldName or worldName == "All" or mm.Name == worldName then local ef = mm:FindFirstChild("Enemies") if ef then local mw = mm.Name:lower() for _, cp in ipairs(ef:GetChildren()) do if cp:IsA("BasePart") then local cs = getMatchScore((cp.Name .. " " .. tostring(cp:GetAttribute("CampId") or "")):lower(), keywords) if cs > 0 then table.insert(matches, { position=cp.Position, campName=cp.Name, score=cs + (keywords[mw] and 1 or 0) }) end end end end end end table.sort(matches, function(a, b) return a.score > b.score end) return matches end local function collectEnemyModels() local seen, out = {}, {} local hostiles = scanEcsUnits() for mdl in pairs(hostiles) do if isEnemyAlive(mdl) and not seen[mdl] then seen[mdl] = true table.insert(out, mdl) end end for _, child in ipairs(workspace:GetChildren()) do if child:IsA("Model") and not seen[child] and isEnemyAlive(child) then seen[child] = true table.insert(out, child) end end return out end local function scanEnemyChoices() local _, _, hrp = getCharacterParts() local origin, maxR, wn = hrp and hrp.Position, state.maxRange, resolveWorldName(state.farmWorld) local counts = {} for _, ch in ipairs(collectEnemyModels()) do if isModelInWorld(ch, wn) then local tHRP = ch:FindFirstChild("HumanoidRootPart") or ch.PrimaryPart if not origin or maxR == 0 or (tHRP and (tHRP.Position - origin).Magnitude <= maxR) then counts[ch.Name] = (counts[ch.Name] or 0) + 1 end end end local list = {} for n, c in pairs(counts) do table.insert(list, { label = string.format("%s (%d)", n, c), value = n }) end table.sort(list, function(a, b) return a.value < b.value end) return list end local function getBestTarget(originPos, overrideKeywords, allowFallback) local maxR, wn = state.maxRange, resolveWorldName(state.farmWorld) local _, qKws = parseQuestObjectives() if overrideKeywords then qKws = overrideKeywords end local hasQ, useQ = next(qKws) ~= nil, state.questPriority or (overrideKeywords ~= nil) local candidates = collectEnemyModels() if useQ and hasQ then local camps = findMatchingSpawnCampPositions(qKws, wn) if #camps > 0 then local bestM, bestD = nil, math.huge for _, camp in ipairs(camps) do for _, child in ipairs(candidates) do local tH = child:FindFirstChild("HumanoidRootPart") or child.PrimaryPart if tH and (tH.Position - camp.position).Magnitude <= 35 then local d = (tH.Position - originPos).Magnitude if d < bestD then bestD = d bestM = child end end end end if bestM then return bestM, bestD, true, nil end return nil, math.huge, true, camps[1] end end local bQM, bQD, bQS, bSM, bSD = nil, math.huge, 0, nil, math.huge for _, child in ipairs(candidates) do if isModelInWorld(child, wn) then local tH = child:FindFirstChild("HumanoidRootPart") or child.PrimaryPart local dist = (tH.Position - originPos).Magnitude if maxR == 0 or dist <= maxR then if useQ and hasQ then local qs = getMatchScore(child.Name, qKws) if qs > 0 and (qs > bQS or (qs == bQS and dist < bQD)) then bQS = qs bQD = dist bQM = child end end if state.selectedEnemies[child.Name] and dist < bSD then bSD = dist bSM = child end end end end if useQ and bQM then return bQM, bQD, true, nil end if allowFallback == false then return nil, math.huge, false, nil end return bSM, bSD, false, nil end local function leftClickEnemy(targetHRP) local cam = workspace.CurrentCamera if not cam or not targetHRP then return end local sp, onScr = cam:WorldToViewportPoint(targetHRP.Position) if not onScr or sp.Z <= 0 then cam.CFrame = CFrame.lookAt(cam.CFrame.Position, targetHRP.Position) task.wait(0.03) sp = cam:WorldToViewportPoint(targetHRP.Position) end local x, y = math.floor(sp.X), math.floor(sp.Y) pcall(function() VirtualInputManager:SendMouseMoveEvent(x, y, game) task.wait(0.03) VirtualInputManager:SendMouseButtonEvent(x, y, 0, true, game, 1) task.wait(0.05) VirtualInputManager:SendMouseButtonEvent(x, y, 0, false, game, 1) end) end local function engageEnemyModel(model, targetHRP) local engagedByEcs = false if model and ECS.world and ECS.replicator then local hostiles, _, packByModel = scanEcsUnits() if hostiles[model] then local pack = packByModel[model] local srv = pack and ECS.replicator.get_server_entity and ECS.replicator:get_server_entity(pack) if srv then local alreadyFocused = false if ECS.HostileFocus and ECS.HostileFocus.resolve then local okH, hf = pcall(ECS.HostileFocus.resolve) if okH and hf and hf.packSet and hf.packSet[pack] then alreadyFocused = true end end local net = ReplicatedStorage:FindFirstChild("Network") local ep = net and net:FindFirstChild("EngagePack") if ep then engagedByEcs = true if (not alreadyFocused) or (os.clock() - (state.lastEngagePackAt or 0)) >= 1.5 then state.lastEngagePackAt = os.clock() pcall(function() ep:FireServer(srv) end) end end end end end if (not engagedByEcs) and state.autoClick and targetHRP then leftClickEnemy(targetHRP) end end local function useChampionAbilities() for slot = 1, 10 do if state.abilitySlots[slot] then local ok = ClientChampionAbilityService and ClientChampionAbilityService.ActivateBySlotIndex and pcall(ClientChampionAbilityService.ActivateBySlotIndex, slot) if not ok then local kc = CHOICES.SLOT_KEYCODES[slot] if kc then pcall(function() VirtualInputManager:SendKeyEvent(true, kc, false, game) task.wait(0.02) VirtualInputManager:SendKeyEvent(false, kc, false, game) end) end end end end end local function scanQuestNPCs(mapFilter) local maps = workspace:FindFirstChild("Maps") if not maps then return {} end local res = {} for _, mm in ipairs(maps:GetChildren()) do if mapFilter == "All" or mm.Name == mapFilter then local nf = mm:FindFirstChild("NPCs") or mm:FindFirstChild("Npcs") if nf then for _, npc in ipairs(nf:GetChildren()) do for _, d in ipairs(npc:GetDescendants()) do if d:IsA("ProximityPrompt") and (d.ActionText or ""):lower():find("talk") then local dn = (d.ObjectText ~= "" and d.ObjectText) or npc.Name table.insert(res, { key=mm.Name..":"..npc.Name, mapName=mm.Name, npcName=npc.Name, displayName=dn, model=npc, prompt=d }) break end end end end end end table.sort(res, function(a, b) return a.mapName ~= b.mapName and a.mapName < b.mapName or a.displayName < b.displayName end) return res end local function scanQuestlineChoices() local out = {} for _, e in ipairs(scanQuestNPCs(resolveWorldName(state.questMap))) do table.insert(out, { label = string.format("%s [%s]", e.displayName, e.mapName), value = e.key }) end return out end local function advanceQuestDialogueUI() for _ = 1, 6 do local clicked = false for _, gui in ipairs(PlayerGui:GetChildren()) do if gui:IsA("ScreenGui") and gui.Enabled and gui.Name ~= EXISTING_GUI_NAME then local gL = gui.Name:lower() if gL:find("talk") or gL:find("quest") or gL:find("mission") or gL:find("scene") or gL:find("dialog") then for _, btn in ipairs(gui:GetDescendants()) do if btn:IsA("GuiButton") and btn.Visible then local txt = btn:IsA("TextButton") and btn.Text:lower() or ((btn:FindFirstChildOfClass("TextLabel") and btn:FindFirstChildOfClass("TextLabel").Text:lower()) or "") if txt:find("accept") or txt:find("claim") or txt:find("continue") or txt:find("next") or txt:find("start") or txt:find("ok") then if clickGuiButton(btn) then clicked = true end end end end end end end if not clicked then break end task.wait(0.25) end end local function findBestPromptInWorld(keywords, actionHint) local wn = LocalPlayer:GetAttribute("OverworldWorldId") or "All" local root = (workspace:FindFirstChild("Maps") and workspace.Maps:FindFirstChild(wn)) or workspace local bestP, bestS = nil, -1 for _, d in ipairs(root:GetDescendants()) do if d:IsA("ProximityPrompt") and d.Enabled then local act, obj = (d.ActionText or ""):lower(), (d.ObjectText or ""):lower() local pn = (d.Parent and d.Parent.Name:lower() or "") .. " " .. ((d.Parent and d.Parent.Parent and d.Parent.Parent.Name:lower()) or "") local sc = getMatchScore(act .. " " .. obj .. " " .. pn, keywords) + ((actionHint and act:find(actionHint, 1, true)) and 3 or 0) if sc > bestS then bestS = sc bestP = d end end end return bestP, bestS end local function runAutoGetQuests(statusLabel) if state.isDoingQuestAction then return end state.isDoingQuestAction = true pcall(function() local wm = resolveWorldName(state.questMap) if state.questMap == "All" and OverworldMode and OverworldMode.getReleasedWorlds and state.autoNpcTravel then local tr = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("Overworld_Travel") for _, w in ipairs(OverworldMode.getReleasedWorlds()) do if tr and tr:IsA("RemoteFunction") then local okT, resT = pcall(function() return tr:InvokeServer(w.id) end) if okT and resT ~= false then task.wait(0.8) end end end end local snapQ = getDataSnapshot() local clearedBosses = (snapQ and snapQ.ClearedBosses) or {} local claimedLines = (snapQ and snapQ.ClaimedQuestlines) or {} local unlockedWorlds = { hub=true, alien=true, pirate=clearedBosses.alien==true, ninja=clearedBosses.pirate==true, city=clearedBosses.ninja==true } local npcs, hasF, targets = scanQuestNPCs(wm), next(state.selectedQuestlines) ~= nil, {} for _, e in ipairs(npcs) do if (not hasF or state.selectedQuestlines[e.key]) and (state.questMap ~= "All" or unlockedWorlds[e.mapName] ~= false) then table.insert(targets, e) end end if #targets == 0 then if statusLabel then statusLabel.Text = " Quests: No matching NPCs" end return end local net = ReplicatedStorage:FindFirstChild("Network") local accR, clR = net and net:FindFirstChild("AcceptNpcQuest"), net and net:FindFirstChild("ClaimQuest") local function nextQuestForNpc(nid) if not QuestsConfig or not QuestsConfig.getAllLines then return nil end local okL, lines = pcall(QuestsConfig.getAllLines) if not okL or type(lines) ~= "table" then return nil end for _, ln in ipairs(lines) do local matchG = (ln.defaultGiver == nid) if not matchG and type(ln.givers) == "table" then for _, g in ipairs(ln.givers) do if g == nid then matchG = true break end end end if matchG and type(ln.quests) == "table" then local nx = (claimedLines[ln.id] or 0) + 1 if ln.quests[nx] and not (snapQ and snapQ.QuestProgress and snapQ.QuestProgress[ln.quests[nx]]) then return ln.quests[nx] end end end return nil end for _, entry in ipairs(targets) do if not state.running then break end local npcId = entry.model and (entry.model:GetAttribute("NpcId") or entry.npcName) or entry.npcName local nextQid = nextQuestForNpc(npcId) if nextQid and accR and accR:IsA("RemoteFunction") then if state.autoNpcTravel then ensureWorldTravel(entry.mapName, statusLabel) end local okA, resA = pcall(function() return accR:InvokeServer(npcId, nextQid) end) if okA and resA then if statusLabel then statusLabel.Text = " Accepted: " .. tostring(nextQid) end task.wait(0.25) else local _, _, hrp = getCharacterParts() if hrp and entry.model and entry.model.Parent then if state.autoNpcTravel then local p = entry.model:GetPivot().Position moveToCFrame(hrp, CFrame.lookAt(p + Vector3.new(0,0,5), p), true) task.wait(0.15) end if statusLabel then statusLabel.Text = " Quests: Talking to " .. entry.displayName end triggerPrompt(entry.prompt) task.wait(0.35) advanceQuestDialogueUI() if clR and clR:IsA("RemoteFunction") then pcall(function() clR:InvokeServer(npcId) end) end pcall(function() accR:InvokeServer(npcId, nextQid) end) task.wait(0.3) end end end end if statusLabel then statusLabel.Text = " Quests: NPC check complete" end end) state.isDoingQuestAction = false end local function executeFullQuestObjective(obj, statusLabel) local _, _, hrp = getCharacterParts() if not hrp then return false end local net = ReplicatedStorage:FindFirstChild("Network") if obj.kind == "turn_in" then statusLabel.Text = " Quest [Turn In]: " .. (obj.heading ~= "" and obj.heading or obj.text) local clR = net and net:FindFirstChild("ClaimQuest") if obj.questId and clR then pcall(function() clR:InvokeServer(obj.questId) end) end if obj.actionBtn then clickGuiButton(obj.actionBtn) task.wait(0.4) end local bestN, bestS = nil, 0 for _, e in ipairs(scanQuestNPCs(LocalPlayer:GetAttribute("OverworldWorldId") or "All")) do local sc = getMatchScore(e.displayName .. " " .. e.npcName, obj.headingKeywords) + getMatchScore(e.displayName .. " " .. e.npcName, obj.keywords) if sc > bestS then bestS = sc bestN = e end end if bestN then local p = bestN.model:GetPivot().Position moveToCFrame(hrp, CFrame.lookAt(p + Vector3.new(0,0,5), p), true) task.wait(0.15) triggerPrompt(bestN.prompt) task.wait(0.35) advanceQuestDialogueUI() local nid, accR = bestN.model:GetAttribute("NpcId") or bestN.npcName, net and net:FindFirstChild("AcceptNpcQuest") if clR then pcall(function() clR:InvokeServer(nid) end) end if accR then pcall(function() accR:InvokeServer(nid) end) end task.wait(0.4) return true end elseif obj.kind == "equip" then local snap = getDataSnapshot() local rem = net and net:FindFirstChild("SetEquippedChampions") if snap and snap.Champions and rem and CharacterDefs and CharacterDefs.get then local wantEl = nil for _, el in ipairs({"Nature","Fire","Spark","Water","Light","Dark","Normal"}) do if obj.text:lower():find(el:lower(), 1, true) then wantEl = el break end end if wantEl then local pickUid = nil for uid, ch in pairs(snap.Champions) do local okD, def = pcall(CharacterDefs.get, ch.id) if okD and def and def.element == wantEl then pickUid = uid break end end if pickUid then local eq = table.clone(snap.EquippedChampions or {}) local already = false for _, u in ipairs(eq) do if u == pickUid then already = true break end end if not already then if #eq > 0 then eq[#eq] = pickUid else eq[1] = pickUid end rem:FireServer(eq) if statusLabel then statusLabel.Text = " Quest [Equip]: " .. wantEl end task.wait(0.4) return true end end end end elseif obj.kind == "feed" then local snap = getDataSnapshot() local items = (snap and snap.Items) or {} local uid, bestLv = nil, math.huge for _, cUid in ipairs((snap and snap.EquippedChampions) or {}) do local ch = snap.Champions and snap.Champions[cUid] local lv = (ch and ch.level) or 1 if lv < bestLv then bestLv = lv uid = cUid end end if not uid and snap and snap.Champions then for cUid, ch in pairs(snap.Champions) do local lv = ch.level or 1 if lv < bestLv then bestLv = lv uid = cUid end end end local rem = net and net:FindFirstChild("FeedChampion") if uid and rem and ItemDefs and ItemDefs.isFeedable then for _, c in ipairs(getFruitChoices()) do if c.value ~= "auto" and (items[c.value] or 0) > 0 then if statusLabel then statusLabel.Text = " Quest [Feed]: " .. c.value end local ok, res = pcall(function() return rem:InvokeServer(uid, { [c.value] = 1 }) end) if ok and res and res.success then task.wait(0.35) return true end end end end elseif obj.kind == "repair" then local qCfg = QuestsConfig and QuestsConfig.getQuest and QuestsConfig.getQuest(obj.questId) local rId = qCfg and qCfg.objectives and qCfg.objectives[1] and qCfg.objectives[1].repairId local repR = net and net:FindFirstChild("RepairObject") if rId and repR then local okR, resR = pcall(function() return repR:InvokeServer(rId) end) if okR and resR then task.wait(0.4) return true end end local pr, sc = findBestPromptInWorld(obj.keywords, "repair") if pr and sc > 0 then local pos = getPromptPosition(pr) if pos then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,5), pos), true) task.wait(0.15) triggerPrompt(pr) task.wait(0.5) return true end end elseif obj.kind == "meet_npc" then local bestN, bestS = nil, 0 for _, e in ipairs(scanQuestNPCs(LocalPlayer:GetAttribute("OverworldWorldId") or "All")) do local sc = getMatchScore(e.displayName .. " " .. e.npcName, obj.keywords) if sc > bestS then bestS = sc bestN = e end end if bestN then local p = bestN.model:GetPivot().Position moveToCFrame(hrp, CFrame.lookAt(p + Vector3.new(0,0,5), p), true) task.wait(0.15) triggerPrompt(bestN.prompt) local mr = net and net:FindFirstChild("MeetNpc") if mr then pcall(function() mr:FireServer(bestN.model:GetAttribute("NpcId") or bestN.npcName) end) end task.wait(0.35) advanceQuestDialogueUI() return true end elseif obj.kind == "find" then for _, qi in ipairs(CollectionService:GetTagged("QuestItem")) do local qid = tostring(qi:GetAttribute("QuestItemId") or qi.Name) if getMatchScore(qid, obj.keywords) > 0 then local pos = findInstancePosition(qi) if pos then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,4), pos), true) task.wait(0.15) for _, pr in ipairs(qi:GetDescendants()) do if pr:IsA("ProximityPrompt") and pr.Enabled then triggerPrompt(pr) end end local fi = net and net:FindFirstChild("FindQuestItem") if fi then local okQ = obj.questId and pcall(function() return fi:InvokeServer(obj.questId) end) if not okQ then pcall(function() fi:InvokeServer(qid) end) end end task.wait(0.4) return true end end end local pr, sc = findBestPromptInWorld(obj.keywords, nil) if pr and sc > 0 then local pos = getPromptPosition(pr) if pos then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,4), pos), true) task.wait(0.15) triggerPrompt(pr) task.wait(0.4) return true end elseif obj.actionBtn then clickGuiButton(obj.actionBtn) task.wait(1.0) return true end elseif obj.kind == "boss" then if getBestTarget(hrp.Position, obj.keywords, false) then return false end local tw = LocalPlayer:GetAttribute("OverworldWorldId") or "alien" local gate = workspace:FindFirstChild("Maps") and workspace.Maps:FindFirstChild(tw) and workspace.Maps[tw]:FindFirstChild("BossGate") if gate and net then local repR, cb = net:FindFirstChild("RepairObject"), net:FindFirstChild("ChallengeBoss") if repR then pcall(function() repR:InvokeServer(gate:GetAttribute("RepairId") or (tw .. "_boss_portal")) end) end if cb then local okB, resB = pcall(function() return cb:InvokeServer(tw) end) if okB and resB then task.wait(1.2) return true end end end local pr, sc = findBestPromptInWorld(obj.keywords, "boss") if pr and sc > 0 then local pos = getPromptPosition(pr) if pos then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,5), pos), true) task.wait(0.15) triggerPrompt(pr) task.wait(0.5) return true end end elseif obj.kind == "stage" and state.includeStageQuests then local qCfg = QuestsConfig and QuestsConfig.getQuest and QuestsConfig.getQuest(obj.questId) local mid = qCfg and qCfg.objectives and qCfg.objectives[1] and qCfg.objectives[1].missionId if mid and net then recordPreRunServer() if ClientLobbyService and ClientLobbyService.OpenMission then pcall(ClientLobbyService.OpenMission, mid) end if net:FindFirstChild("Lobby_SetChosenMission") then pcall(function() net.Lobby_SetChosenMission:FireServer(mid) end) end task.wait(0.25) if ClientLobbyService and ClientLobbyService.ToggleReady then pcall(ClientLobbyService.ToggleReady) elseif net:FindFirstChild("Lobby_SetReady") then pcall(function() net.Lobby_SetReady:FireServer(true) end) end if statusLabel then statusLabel.Text = " Quest [Stage]: " .. tostring(mid) end task.wait(1.0) return true elseif obj.actionBtn then clickGuiButton(obj.actionBtn) task.wait(1.0) return true end end return false end local function runOverworldBossCycle(statusLabel) if state.isDoingBossRun then return end state.isDoingBossRun = true pcall(function() local tw = resolveWorldName(state.bossWorld) if tw == "All" then tw = LocalPlayer:GetAttribute("OverworldWorldId") or "alien" end local gate = workspace:FindFirstChild("Maps") and workspace.Maps:FindFirstChild(tw) and workspace.Maps[tw]:FindFirstChild("BossGate") if not gate then statusLabel.Text = " Boss: No BossGate in " .. tw return end local rp, cp = nil, nil for _, d in ipairs(gate:GetDescendants()) do if d:IsA("ProximityPrompt") then if d.Name:lower():find("repair") or (d.ActionText or ""):lower():find("repair") then rp = d else cp = d end end end local _, _, hrp = getCharacterParts() if not hrp then return end ensureWorldTravel(tw, statusLabel) if state.autoOpenChest then openEligibleChests(tw, state.openKeyChests, statusLabel) end if os.clock() < state.bossCooldownEnd then statusLabel.Text = " Boss: Cooldown " .. formatSeconds(state.bossCooldownEnd - os.clock()) return end if state.autoRepairGate and rp and rp.Enabled then local repR = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("RepairObject") local rid = gate:GetAttribute("RepairId") or (tw .. "_boss_portal") if repR then pcall(function() repR:InvokeServer(rid) end) end local pos = getPromptPosition(rp) if pos then moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,5), pos), true) task.wait(0.15) triggerPrompt(rp) task.wait(0.8) end end if state.autoChallengeBoss and cp and cp.Enabled then local pos = getPromptPosition(cp) if pos then statusLabel.Text = " Boss: Challenging..." moveToCFrame(hrp, CFrame.lookAt(pos + Vector3.new(0,0,5), pos), true) task.wait(0.15) local cb = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("ChallengeBoss") if cb then pcall(function() cb:InvokeServer(tw) end) else triggerPrompt(cp) end task.wait(1.5) local bossM = getBestTarget(pos, extractKeywords(cp.ActionText or "boss"), false) if not bossM then bossM = select(1, findNearestInstanceEnemy(pos)) end if bossM then local clicked = false while state.running and state.autoBoss and isEnemyAlive(bossM) do local _, _, cH = getCharacterParts() local bH = bossM:FindFirstChild("HumanoidRootPart") or bossM.PrimaryPart if cH and bH then local gCF = CFrame.lookAt((bH.CFrame * CFrame.new(0, state.offsetY, state.offsetZ)).Position, bH.Position) local dist = (cH.Position - bH.Position).Magnitude if not clicked then moveToCFrame(cH, gCF, false) if dist <= state.engageRange or state.moveMode == "Instant" then cancelActiveTween() engageEnemyModel(bossM, bH) clicked = true end else statusLabel.Text = " Boss: Fighting " .. bossM.Name engageEnemyModel(bossM, bH) if state.autoAbilities and (os.clock() - state.lastAbilityTime) >= state.abilityInterval then state.lastAbilityTime = os.clock() useChampionAbilities() end end end task.wait(0.15) end if state.autoOpenChest then task.wait(0.8) openEligibleChests(tw, state.openKeyChests, statusLabel) end end end end end) state.isDoingBossRun = false end -- Raids, Boons, Stages, Return Server local function getRaidChoices() local out = { { label = "Today's Offered (Auto)", value = "offered" } } if RaidRunConfig and RaidRunConfig.getBaseIds then local ok, ids = pcall(RaidRunConfig.getBaseIds) if ok and type(ids) == "table" then for _, id in ipairs(ids) do local b = RaidRunConfig.getBase and RaidRunConfig.getBase(id) table.insert(out, { label = (b and b.displayName) or id, value = id }) end end end return out end local function getRaidTierChoices() local out = { { label = "Intro (Tier 0)", value = 0 } } for i = 1, 15 do table.insert(out, { label = "Tier " .. i, value = i }) end return out end local function getStageMissionChoices() local out = {} if MissionsConfig and MissionsConfig.getAll then local ok, allM = pcall(MissionsConfig.getAll) if ok and type(allM) == "table" then for _, m in ipairs(allM) do table.insert(out, { label = string.format("%s [%s]", tostring(m.name or m.title or m.id), tostring(m.world or m.worldId or "?")), value = m.id }) end end end table.sort(out, function(a, b) return a.label < b.label end) return out end local function recordPreRunServer() state.preRunPlaceId, state.preRunJobId = game.PlaceId, game.JobId saveConfig() end local function returnToCustomServer(statusLabel) if state.returnServerMode == "lobby" or (os.clock() - state.lastReturnAttempt) < 12 then return false end local tpId, tjId = 0, "" if state.returnServerMode == "previous" then tpId, tjId = state.preRunPlaceId, state.preRunJobId elseif state.returnServerMode == "saved" then tpId, tjId = state.savedServerPlaceId, state.savedServerJobId end if tpId <= 0 or tjId == "" or (tpId == game.PlaceId and tjId == game.JobId) then return false end state.lastReturnAttempt = os.clock() state.pendingPostRunReturn = false if state.autoExecuteOnTeleport then queueTeleportReload() end saveConfig() if statusLabel then statusLabel.Text = " Returning to custom server..." end pcall(function() TeleportService:TeleportToPlaceInstance(tpId, tjId, LocalPlayer) end) return true end local function findNearestInstanceEnemy(originPos) local hostiles = scanEcsUnits() local bestM, bestD = nil, math.huge for mdl in pairs(hostiles) do if mdl.Parent and isEnemyAlive(mdl) then local h = mdl:FindFirstChild("HumanoidRootPart") or mdl.PrimaryPart if h then local d = (h.Position - originPos).Magnitude if d < bestD then bestD = d bestM = mdl end end end end if bestM then return bestM, bestD end for _, c in ipairs({ workspace, workspace:FindFirstChild("Maps") }) do if c then for _, inst in ipairs(c:GetDescendants()) do if inst:IsA("Model") and isEnemyAlive(inst) then local h = inst:FindFirstChild("HumanoidRootPart") or inst.PrimaryPart if h then local d = (h.Position - originPos).Magnitude if d < bestD then bestD = d bestM = inst end end end end end end return bestM, bestD end local function engageWaveEnemy(target, statusLabel, prefix) local _, _, hrp = getCharacterParts() if not hrp or not target then return end local tH = target:FindFirstChild("HumanoidRootPart") or target.PrimaryPart if not tH then return end local goalCF = CFrame.lookAt((tH.CFrame * CFrame.new(0, state.offsetY, state.offsetZ)).Position, tH.Position) local dist = (hrp.Position - tH.Position).Magnitude if dist > state.engageRange then moveToCFrame(hrp, goalCF, false) end if dist <= state.engageRange or state.moveMode == "Instant" then cancelActiveTween() engageEnemyModel(target, tH) if state.autoAbilities and (os.clock() - state.lastAbilityTime) >= state.abilityInterval then state.lastAbilityTime = os.clock() useChampionAbilities() end else engageEnemyModel(target, tH) end if statusLabel then pcall(function() statusLabel.Text = string.format(" %s %s (%.1f)", prefix, tostring(target and target.Name or "?"), dist or 0) end) end end local function handleRaidIntermission(statusLabel) local attr = LocalPlayer:GetAttribute("RaidIntermission") if type(attr) ~= "string" or attr == "" then return false end local net = ReplicatedStorage:FindFirstChild("Network") if state.lastIntermissionVoted == attr then if state.autoReadyNextStage and net and net:FindFirstChild("Raid_ReadyNextStage") then pcall(function() net.Raid_ReadyNextStage:FireServer() end) end return true end local ok, data = pcall(HttpService.JSONDecode, HttpService, attr) if not ok or type(data) ~= "table" then return false end local cards = data.cards or data.options or data.choices or {} if state.autoVoteBoons and #cards > 0 then local bestCid, bestRk, rankMap = nil, math.huge, {} for i, id in ipairs(state.boonPriority) do rankMap[id] = i end for _, c in ipairs(cards) do local cid = type(c) == "table" and (c.id or c.boonId) or c local rk = rankMap[cid] or 999 if rk < bestRk then bestRk = rk bestCid = cid end end if bestCid and net and net:FindFirstChild("Raid_VoteCard") then pcall(function() net.Raid_VoteCard:FireServer(bestCid) end) state.lastIntermissionVoted = attr if statusLabel then statusLabel.Text = " Boon Voted: " .. tostring(bestCid) end end end if state.autoReadyNextStage and net and net:FindFirstChild("Raid_ReadyNextStage") then task.wait(0.25) pcall(function() net.Raid_ReadyNextStage:FireServer() end) end return true end local function skipStageCutscenesStep() local net = ReplicatedStorage:FindFirstChild("Network") local cont = net and net:FindFirstChild("StageScene_Continue") local anyG = false for _, gui in ipairs(PlayerGui:GetChildren()) do if gui:IsA("ScreenGui") and gui.Enabled and gui.Name ~= EXISTING_GUI_NAME then local gL = gui.Name:lower() if gL:find("talk") or gL:find("dialogue") or gL:find("scene") or gL:find("missiontalk") then local subVis = false for _, ch in ipairs(gui:GetChildren()) do if ch:IsA("GuiObject") and ch.Visible then subVis = true break end end if subVis then anyG = true for _, b in ipairs(gui:GetDescendants()) do if b:IsA("GuiButton") and b.Visible then clickGuiButton(b) end end end end end end if anyG and (os.clock() - state.lastCutsceneSkip) >= 0.35 then state.lastCutsceneSkip = os.clock() local cds = safeRequire(ClientServices and ClientServices:FindFirstChild("ClientDialogueService")) if cds and cds.Advance then pcall(cds.Advance) end if cont then pcall(function() cont:FireServer() end) end end end local function handleMatchResultsVote(statusLabel, voteOverride) local visible = false for _, g in ipairs(PlayerGui:GetChildren()) do if g:IsA("ScreenGui") and g.Enabled and g.Name:lower():find("matchresult") then local root = g:FindFirstChild("MatchResultsRoot") local panel = root and root:FindFirstChild("MatchResults") if panel and panel:IsA("GuiObject") then if panel.Visible then visible = true break end else for _, ch in ipairs(g:GetChildren()) do if ch:IsA("GuiObject") and ch.Visible then visible = true break end end if visible then break end end end end if not visible and ClientMatchResultsService and ClientMatchResultsService.HasMatchResults and ClientMatchResultsService.MatchOngoing then local okM, ready = pcall(function() local Fu = safeRequire(ReplicatedStorage:FindFirstChild("Packages") and ReplicatedStorage.Packages:FindFirstChild("Fusion")) return Fu and Fu.peek and Fu.peek(ClientMatchResultsService.HasMatchResults) and (not Fu.peek(ClientMatchResultsService.MatchOngoing)) end) if okM and ready then visible = true end end if not visible then state.matchVoteCastAt = 0 return false end if ClientMatchResultsService and ClientMatchResultsService.MatchOngoing then local okO, ongoing = pcall(function() local Fu = safeRequire(ReplicatedStorage:FindFirstChild("Packages") and ReplicatedStorage.Packages:FindFirstChild("Fusion")) return Fu and Fu.peek and Fu.peek(ClientMatchResultsService.MatchOngoing) end) if okO and ongoing then return false end end if state.returnServerMode ~= "lobby" and state.autoReturnPostRun and returnToCustomServer(statusLabel) then return true end if state.matchVoteCastAt and (os.clock() - state.matchVoteCastAt) < 20 then return true end state.matchVoteCastAt = os.clock() local opt = voteOverride or state.afterMatchVote or "retry" if ClientMatchResultsService and ClientMatchResultsService.SetVote then pcall(ClientMatchResultsService.SetVote, opt) else local vr = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("MatchResults_SetVote") if vr then pcall(function() vr:FireServer(opt, true) end) end end if statusLabel then pcall(function() statusLabel.Text = " Match Vote: " .. opt end) end return true end local function stepAutoRaidAndStage(statusLabel) local gm = workspace:GetAttribute("GamemodeId") or "overworld" if state.autoSkipCutscenes and (gm == "stage" or gm == "raid") then skipStageCutscenesStep() end if gm == "raid" or gm == "stage" then if not state.pendingPostRunReturn then state.pendingPostRunReturn = true saveConfig() end end if gm == "raid" and state.autoRaid then if handleRaidIntermission(statusLabel) or handleMatchResultsVote(statusLabel) then return end if state.raidAutoEngage then local nw = ReplicatedStorage:FindFirstChild("Network") and ReplicatedStorage.Network:FindFirstChild("Defense_RequestNextWave") if nw and (os.clock() - state.lastRaidAction) >= 3 then state.lastRaidAction = os.clock() pcall(function() nw:FireServer() end) end local _, _, hrp = getCharacterParts() if hrp then local t = findNearestInstanceEnemy(hrp.Position) if t then engageWaveEnemy(t, statusLabel, "[Raid]") end end end return end if gm == "stage" and (state.autoStage or (state.fullAutoQuest and state.includeStageQuests)) then local voteOverride = state.autoStage and nil or "lobby" if handleMatchResultsVote(statusLabel, voteOverride) then return end if state.stageAutoEngage or state.fullAutoQuest then local _, _, hrp = getCharacterParts() if hrp then local t = findNearestInstanceEnemy(hrp.Position) if t then engageWaveEnemy(t, statusLabel, "[Stage]") end end end return end if gm == "overworld" then if state.pendingPostRunReturn and state.autoReturnPostRun and state.returnServerMode ~= "lobby" then if returnToCustomServer(statusLabel) then return end end if (os.clock() - state.lastRaidAction) < 3.5 then return end state.lastRaidAction = os.clock() local net = ReplicatedStorage:FindFirstChild("Network") if state.autoRaid and state.raidAutoStart and net then recordPreRunServer() local base = state.raidBaseId if base == "offered" and RaidRunConfig and RaidRunConfig.offeredPairs and QuestsConfig and QuestsConfig.dailyCurrentDay then local okP, pL = pcall(function() return RaidRunConfig.offeredPairs(QuestsConfig.dailyCurrentDay()) end) base = (okP and pL and pL[1] and pL[1].baseId) or "marines" end if net:FindFirstChild("Lobby_SetChosenChallenge") then pcall(function() net.Lobby_SetChosenChallenge:FireServer(base, state.raidTier) end) end task.wait(0.25) if ClientLobbyService and ClientLobbyService.ToggleReady then pcall(ClientLobbyService.ToggleReady) elseif net:FindFirstChild("Lobby_SetReady") then pcall(function() net.Lobby_SetReady:FireServer(true) end) end if statusLabel then statusLabel.Text = string.format(" [Raid] Queuing %s (T%d)", tostring(base), state.raidTier) end elseif (state.autoStage or (state.fullAutoQuest and state.includeStageQuests)) and state.stageAutoStart and net then local mId = state.autoStage and state.stageMissionId or nil if not mId and QuestsConfig and QuestsConfig.getQuest then local snap = getDataSnapshot() for qId, prog in pairs((snap and snap.QuestProgress) or {}) do local okQ, qDef = pcall(QuestsConfig.getQuest, qId) local objs = okQ and type(qDef) == "table" and qDef.objectives if type(objs) == "table" then for idx, ob in ipairs(objs) do if ob.kind == "mission" and ob.missionId and ((prog.counts and prog.counts[idx]) or 0) < (ob.target or 1) then mId = ob.missionId break end end end if not mId and okQ and type(qDef) == "table" and QuestsConfig.missionOf then local okM, mo = pcall(QuestsConfig.missionOf, qDef) if okM and mo and ((prog.counts and prog.counts[1]) or 0) < 1 then mId = mo end end if mId then break end end end if mId then recordPreRunServer() if ClientLobbyService and ClientLobbyService.OpenMission then pcall(ClientLobbyService.OpenMission, mId) end if net:FindFirstChild("Lobby_SetChosenMission") then pcall(function() net.Lobby_SetChosenMission:FireServer(mId) end) end task.wait(0.25) if ClientLobbyService and ClientLobbyService.ToggleReady then pcall(ClientLobbyService.ToggleReady) elseif net:FindFirstChild("Lobby_SetReady") then pcall(function() net.Lobby_SetReady:FireServer(true) end) end if statusLabel then pcall(function() statusLabel.Text = " [Stage] Queuing " .. tostring(mId) end) end end end end end -- ============================================================================ -- SLEEK 9-TAB HORIZONTAL UI -- ============================================================================ local THEME = { bg = Color3.fromRGB(14, 16, 22), sidebar = Color3.fromRGB(20, 23, 31), card = Color3.fromRGB(26, 30, 40), control = Color3.fromRGB(35, 40, 53), border = Color3.fromRGB(52, 60, 78), accent = Color3.fromRGB(59, 130, 246), green = Color3.fromRGB(34, 150, 88), red = Color3.fromRGB(190, 58, 62), amber = Color3.fromRGB(205, 130, 40), purple = Color3.fromRGB(139, 92, 246), text = Color3.fromRGB(238, 242, 250), muted = Color3.fromRGB(148, 158, 178), } local function addCorner(inst, r) Instance.new("UICorner", inst).CornerRadius = UDim.new(0, r or 6) return inst end local function addStroke(inst, c) local s = Instance.new("UIStroke", inst) s.Color = c or THEME.border s.Thickness = 1 return s end local function mkLbl(parent, pos, size, text, col, sz, wrap, font, alignX) local l = Instance.new("TextLabel") l.Position, l.Size, l.BackgroundTransparency = pos, size, 1 l.Text, l.TextColor3 = text, col or THEME.text l.Font, l.TextSize = font or Enum.Font.Gotham, sz or 11 l.TextWrapped = wrap == true l.TextXAlignment = alignX or Enum.TextXAlignment.Left l.TextYAlignment = wrap and Enum.TextYAlignment.Top or Enum.TextYAlignment.Center l.Parent = parent return l end local parentGui = nil do local okCG, cg = pcall(function() return game:GetService("CoreGui") end) if okCG and cg then parentGui = cg end if not parentGui then parentGui = (gethui and gethui()) or PlayerGui end end local screenGui = Instance.new("ScreenGui") screenGui.Name = EXISTING_GUI_NAME screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling if not pcall(function() screenGui.Parent = parentGui end) or not screenGui.Parent then screenGui.Parent = PlayerGui end local WINDOW_W, WINDOW_H = 650, 382 local mainFrame = Instance.new("Frame") mainFrame.Name = "MainFrame" mainFrame.Size, mainFrame.Position = UDim2.fromOffset(WINDOW_W, WINDOW_H), UDim2.new(0.5, -WINDOW_W * 0.5, 0.5, -WINDOW_H * 0.5) mainFrame.BackgroundColor3, mainFrame.BorderSizePixel, mainFrame.Parent = THEME.bg, 0, screenGui addCorner(mainFrame, 10) addStroke(mainFrame) local header = Instance.new("Frame") header.Size, header.BackgroundColor3, header.BorderSizePixel, header.Parent = UDim2.new(1, 0, 0, 36), THEME.sidebar, 0, mainFrame addCorner(header, 10) mkLbl(header, UDim2.fromOffset(14, 0), UDim2.new(0, 220, 1, 0), "ACX Studio | All-In-One Hub", THEME.text, 13, false, Enum.Font.GothamBold) local statusBadge = mkLbl(header, UDim2.fromOffset(238, 7), UDim2.new(1, -310, 0, 22), " Idle", THEME.muted, 11) statusBadge.BackgroundTransparency, statusBadge.BackgroundColor3, statusBadge.TextTruncate = 0, THEME.bg, Enum.TextTruncate.AtEnd addCorner(statusBadge, 6) local function mkHeadBtn(txt, xOff, bg) local b = Instance.new("TextButton") b.Size, b.Position, b.BackgroundColor3, b.Text, b.TextColor3 = UDim2.fromOffset(24, 24), UDim2.new(1, xOff, 0, 6), bg, txt, Color3.fromRGB(255,255,255) b.Font, b.TextSize, b.Parent = Enum.Font.GothamBold, 12, header addCorner(b, 6) return b end local minBtn, closeBtn = mkHeadBtn("-", -60, THEME.control), mkHeadBtn("X", -30, THEME.red) local contentRoot = Instance.new("Frame") contentRoot.Position, contentRoot.Size, contentRoot.BackgroundTransparency, contentRoot.Parent = UDim2.fromOffset(0, 36), UDim2.new(1, 0, 1, -36), 1, mainFrame local sidebar = Instance.new("ScrollingFrame") sidebar.Position, sidebar.Size, sidebar.BackgroundColor3, sidebar.BorderSizePixel = UDim2.fromOffset(10, 8), UDim2.new(0, 102, 1, -18), THEME.sidebar, 0 sidebar.ScrollBarThickness, sidebar.AutomaticCanvasSize, sidebar.CanvasSize, sidebar.Parent = 3, Enum.AutomaticSize.Y, UDim2.fromOffset(0,0), contentRoot addCorner(sidebar, 8) addStroke(sidebar) local sbLayout = Instance.new("UIListLayout", sidebar) sbLayout.Padding = UDim.new(0, 4) sbLayout.SortOrder = Enum.SortOrder.LayoutOrder local sbPad = Instance.new("UIPadding", sidebar) sbPad.PaddingTop, sbPad.PaddingBottom, sbPad.PaddingLeft, sbPad.PaddingRight = UDim.new(0,7), UDim.new(0,7), UDim.new(0,7), UDim.new(0,7) local pageHolder = Instance.new("Frame") pageHolder.Position, pageHolder.Size, pageHolder.BackgroundTransparency, pageHolder.Parent = UDim2.fromOffset(122, 8), UDim2.new(1, -132, 1, -18), 1, contentRoot local activePopup = nil local function closeActiveDropdown() if activePopup then activePopup:Destroy() activePopup = nil end end local function createCard(parent, pos, size, scrollable) local c = Instance.new(scrollable and "ScrollingFrame" or "Frame") c.Position, c.Size, c.BackgroundColor3, c.BorderSizePixel, c.Parent = pos, size, THEME.card, 0, parent if scrollable then c.ScrollBarThickness = 4 c.AutomaticCanvasSize = Enum.AutomaticSize.Y c.CanvasSize = UDim2.fromOffset(0,0) end addCorner(c, 8) addStroke(c) return c end local function createToggleRow(parent, labelText, pos, size, initialVal, accentColor, onChange) local val = initialVal local btn = Instance.new("TextButton") btn.Position, btn.Size, btn.BackgroundColor3, btn.Text, btn.Parent = pos, size, THEME.control, "", parent addCorner(btn, 6) local lbl = mkLbl(btn, UDim2.fromOffset(10, 0), UDim2.new(1, -48, 1, 0), labelText, THEME.text, 11, false, Enum.Font.GothamSemibold) lbl.TextTruncate = Enum.TextTruncate.AtEnd local pill = Instance.new("Frame") pill.Size, pill.Position, pill.BorderSizePixel, pill.Parent = UDim2.fromOffset(34, 16), UDim2.new(1, -42, 0.5, -8), 0, btn addCorner(pill, 8) local knob = Instance.new("Frame") knob.Size, knob.BackgroundColor3, knob.BorderSizePixel, knob.Parent = UDim2.fromOffset(12, 12), Color3.fromRGB(245,247,252), 0, pill addCorner(knob, 8) local function ref() pill.BackgroundColor3 = val and (accentColor or THEME.green) or Color3.fromRGB(60, 66, 82) knob.Position = val and UDim2.fromOffset(20, 2) or UDim2.fromOffset(2, 2) end ref() btn.MouseButton1Click:Connect(function() val = not val ref() onChange(val) if state.autoExecuteOnTeleport then saveConfig() end end) return { button = btn, setValue = function(v) val = v ref() end } end local function createPrimaryButton(parent, text, pos, size, color, onClick) local btn = Instance.new("TextButton") btn.Position, btn.Size, btn.BackgroundColor3, btn.Text, btn.TextColor3 = pos, size, color or THEME.accent, text, Color3.fromRGB(255,255,255) btn.Font, btn.TextSize, btn.Parent = Enum.Font.GothamBold, 11, parent addCorner(btn, 7) if onClick then btn.MouseButton1Click:Connect(onClick) end return btn end local function createStateButton(parent, prefix, pos, size, stateKey, onAfter) local b b = createPrimaryButton(parent, prefix .. ": " .. (state[stateKey] and "ON" or "OFF"), pos, size, state[stateKey] and THEME.green or THEME.red, function() state[stateKey] = not state[stateKey] b.Text = prefix .. ": " .. (state[stateKey] and "ON" or "OFF") b.BackgroundColor3 = state[stateKey] and THEME.green or THEME.red if onAfter then onAfter(state[stateKey]) end if state.autoExecuteOnTeleport then saveConfig() end end) return b end local function createDropdown(opts) local hb = Instance.new("TextButton") hb.Position, hb.Size, hb.BackgroundColor3, hb.Text, hb.Parent = opts.pos, opts.size, THEME.control, "", opts.parent addCorner(hb, 6) addStroke(hb) mkLbl(hb, UDim2.fromOffset(10, 0), UDim2.new(0.40, 0, 1, 0), opts.title, THEME.muted, 11, false, Enum.Font.GothamSemibold) local valLbl = mkLbl(hb, UDim2.new(0.40, 0, 0, 0), UDim2.new(0.60, -24, 1, 0), opts.getDisplayText(), THEME.text, 11, false, Enum.Font.GothamBold, Enum.TextXAlignment.Right) valLbl.TextTruncate = Enum.TextTruncate.AtEnd mkLbl(hb, UDim2.new(1, -20, 0, 0), UDim2.fromOffset(16, opts.size.Y.Offset), "v", THEME.muted, 11, false, Enum.Font.GothamBold) local function isSel(v) if opts.isSelected then return opts.isSelected(v) end if opts.setTable then return opts.setTable[v] == true end if opts.stateKey then return state[opts.stateKey] == v end return false end local function doToggle(v, item) if opts.onToggle then opts.onToggle(v, item) elseif opts.setTable then opts.setTable[v] = not (opts.setTable[v] == true) or nil elseif opts.stateKey then state[opts.stateKey] = v end end local function updateText() valLbl.Text = opts.getDisplayText() end hb.MouseButton1Click:Connect(function() local owner = tostring(opts.title) .. "_" .. math.floor(hb.AbsolutePosition.X) .. "_" .. math.floor(hb.AbsolutePosition.Y) if activePopup and activePopup:GetAttribute("Owner") == owner then closeActiveDropdown() return end closeActiveDropdown() local items, ap, as = opts.getItems(), hb.AbsolutePosition, hb.AbsoluteSize local rowH, tbH = 24, opts.multi and 28 or 0 local listH = math.min(165, math.max(rowH, #items * (rowH + 3) + 6)) local popupH = tbH + listH + 4 local popup = Instance.new("Frame") popup:SetAttribute("Owner", owner) popup.Size = UDim2.fromOffset(math.max(as.X, 235), popupH) local viewH = (screenGui.AbsoluteSize and screenGui.AbsoluteSize.Y > 0) and screenGui.AbsoluteSize.Y or (mainFrame.AbsolutePosition.Y + WINDOW_H + 180) popup.Position = UDim2.fromOffset(ap.X, math.min(ap.Y + as.Y + 4, math.max(12, viewH - popupH - 8))) popup.BackgroundColor3, popup.BorderSizePixel, popup.ZIndex, popup.Parent = Color3.fromRGB(22,26,36), 0, 50, screenGui addCorner(popup, 7) addStroke(popup, THEME.accent) activePopup = popup local scrollTop, renderItems = 2 if opts.multi then local bar = Instance.new("Frame") bar.Position, bar.Size, bar.BackgroundTransparency, bar.ZIndex, bar.Parent = UDim2.fromOffset(4,4), UDim2.new(1,-8,0,22), 1, 51, popup local function mBtn(t, xs, ws, bg, cb) local b = Instance.new("TextButton") b.Position, b.Size, b.BackgroundColor3, b.Text, b.TextColor3, b.Font, b.TextSize, b.ZIndex, b.Parent = UDim2.new(xs,0,0,0), UDim2.new(ws,-2,1,0), bg, t, THEME.text, Enum.Font.GothamSemibold, 10, 52, bar addCorner(b, 4) b.MouseButton1Click:Connect(cb) end mBtn("Refresh", 0, 0.34, THEME.accent, function() items = opts.getItems() renderItems() end) mBtn("Select All", 0.34, 0.34, THEME.control, function() if opts.onSelectAll then opts.onSelectAll(items) elseif opts.setTable then for _, it in ipairs(items) do opts.setTable[it.value] = true end end updateText() renderItems() if state.autoExecuteOnTeleport then saveConfig() end end) mBtn("Clear", 0.68, 0.32, THEME.control, function() if opts.onClear then opts.onClear() elseif opts.setTable then table.clear(opts.setTable) end updateText() renderItems() if state.autoExecuteOnTeleport then saveConfig() end end) scrollTop = 30 end local sc = Instance.new("ScrollingFrame") sc.Position, sc.Size, sc.BackgroundTransparency, sc.BorderSizePixel, sc.ScrollBarThickness, sc.ZIndex, sc.Parent = UDim2.fromOffset(4, scrollTop), UDim2.new(1,-8,1,-scrollTop-4), 1, 0, 4, 51, popup local lay = Instance.new("UIListLayout", sc) lay.Padding, lay.SortOrder = UDim.new(0, 3), Enum.SortOrder.LayoutOrder renderItems = function() for _, c in ipairs(sc:GetChildren()) do if c:IsA("TextButton") or c:IsA("TextLabel") then c:Destroy() end end if #items == 0 then local el = mkLbl(sc, UDim2.new(), UDim2.new(1,-4,0,24), "No items found", THEME.muted, 11) el.ZIndex = 52 else for i, item in ipairs(items) do local s = isSel(item.value) local ib = Instance.new("TextButton") ib.Size, ib.LayoutOrder, ib.BackgroundColor3 = UDim2.new(1,-6,0,rowH), i, s and Color3.fromRGB(36,95,68) or THEME.control ib.Text = opts.multi and string.format(" %s %s", s and "[x]" or "[ ]", item.label) or (" " .. item.label) ib.TextColor3, ib.Font, ib.TextSize, ib.TextTruncate, ib.TextXAlignment, ib.ZIndex, ib.Parent = THEME.text, s and Enum.Font.GothamBold or Enum.Font.Gotham, 11, Enum.TextTruncate.AtEnd, Enum.TextXAlignment.Left, 52, sc addCorner(ib, 5) ib.MouseButton1Click:Connect(function() doToggle(item.value, item) updateText() if state.autoExecuteOnTeleport then saveConfig() end if opts.multi then renderItems() else closeActiveDropdown() end end) end end sc.CanvasSize = UDim2.fromOffset(0, lay.AbsoluteContentSize.Y + 4) end renderItems() end) return { refresh = updateText } end local pages, tabButtons = {}, {} local function createTab(name, order) local p = Instance.new("Frame") p.Size, p.BackgroundTransparency, p.Visible, p.Parent = UDim2.new(1,0,1,0), 1, (name == state.activeTab), pageHolder pages[name] = p local b = Instance.new("TextButton") b.Size, b.LayoutOrder, b.BackgroundColor3, b.Text, b.TextColor3, b.Font, b.TextSize, b.Parent = UDim2.new(1,0,0,30), order, (name == state.activeTab) and THEME.accent or THEME.control, name, THEME.text, Enum.Font.GothamBold, 11, sidebar addCorner(b, 6) tabButtons[name] = b b.MouseButton1Click:Connect(function() closeActiveDropdown() state.activeTab = name for tn, pg in pairs(pages) do pg.Visible = (tn == name) end for tn, bt in pairs(tabButtons) do bt.BackgroundColor3 = (tn == name) and THEME.accent or THEME.control end end) return p end createTab("Farm",1) createTab("Quests",2) createTab("World",3) createTab("Rewards",4) createTab("Summon",5) createTab("Traits",6) createTab("Units",7) createTab("Raids",8) createTab("Config",9) local function makeSubTabBtn(parent, holder, btnMap, viewMap, key, label, idx, total, activeK, cb) local v = Instance.new("Frame") v.Position, v.Size, v.BackgroundTransparency, v.Visible, v.Parent = UDim2.fromOffset(0,32), UDim2.new(1,0,1,-32), 1, (key==activeK), holder viewMap[key] = v local w = 1 / total local b = Instance.new("TextButton") b.Position, b.Size, b.BackgroundColor3, b.Text, b.TextColor3, b.Font, b.TextSize, b.Parent = UDim2.new((idx-1)*w, idx>1 and 2 or 0, 0, 0), UDim2.new(w, (idx>1 and idx0 and ("<= "..state.maxRange) or "Unlimited" end }) createDropdown({ parent=farmL, title="Move", pos=UDim2.fromOffset(8,148), size=UDim2.new(1,-16,0,28), multi=false, stateKey="moveMode", getItems=function() return CHOICES.MOVE end, getDisplayText=function() return state.moveMode=="Instant" and "Instant TP" or "Tween" end }) createDropdown({ parent=farmL, title="Speed", pos=UDim2.fromOffset(8,182), size=UDim2.new(1,-16,0,28), multi=false, stateKey="tweenSpeed", getItems=function() return CHOICES.SPEED end, getDisplayText=function() return state.tweenSpeed.." /s" end }) uiRefs.questPreviewLbl = mkLbl(farmL, UDim2.fromOffset(10,216), UDim2.new(1,-20,0,44), "Quest: (none detected)", Color3.fromRGB(147,197,253), 11, true) createToggleRow(farmR, "Left-Click Attack", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,30), state.autoClick, THEME.green, function(v) state.autoClick=v end) createToggleRow(farmR, "Auto Abilities", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,30), state.autoAbilities, THEME.green, function(v) state.autoAbilities=v end) uiRefs.abilitySlotDropdown = createDropdown({ parent=farmR, title="Ability Slots", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=true, getItems=getAbilitySlotChoices, isSelected=function(v) return state.abilitySlots[v]==true end, onToggle=function(v) state.abilitySlots[v]=not(state.abilitySlots[v]==true) end, onSelectAll=function() for i=1,10 do state.abilitySlots[i]=true end end, onClear=function() for i=1,10 do state.abilitySlots[i]=false end end, getDisplayText=function() local t={} for i=1,10 do if state.abilitySlots[i] then table.insert(t,tostring(i)) end end return #t==0 and "None" or (#t==10 and "All (1-10)" or table.concat(t,",")) end, }) createDropdown({ parent=farmR, title="Cast Delay", pos=UDim2.fromOffset(8,114), size=UDim2.new(1,-16,0,28), multi=false, stateKey="abilityInterval", getItems=function() return CHOICES.ABILITY_INTERVAL end, getDisplayText=function() return string.format("%.2fs", state.abilityInterval) end }) createToggleRow(farmR, "Quest Priority Mode", UDim2.fromOffset(8,148), UDim2.new(1,-16,0,30), state.questPriority, THEME.amber, function(v) state.questPriority=v end) createToggleRow(farmR, "Auto World Travel", UDim2.fromOffset(8,184), UDim2.new(1,-16,0,30), state.autoWorldTravel, THEME.green, function(v) state.autoWorldTravel=v end) createToggleRow(farmR, "Retreat on Stop", UDim2.fromOffset(8,220), UDim2.new(1,-16,0,30), state.autoRetreatOnStop, THEME.green, function(v) state.autoRetreatOnStop=v end) local bL, bR = createCard(fBossV, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(fBossV, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createStateButton(bL, "Auto Overworld Boss", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "autoBoss", function(on) if not on then cancelActiveTween() retreatUnits() statusBadge.Text=" Idle" end end) uiRefs.bossWorldDropdown = createDropdown({ parent=bL, title="Boss World", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="bossWorld", getItems=getWorldChoices, getDisplayText=function() return state.bossWorld=="Current" and ("Current ("..resolveWorldName("Current")..")") or state.bossWorld end }) createPrimaryButton(bL, "Run Boss Cycle Now", UDim2.fromOffset(8,80), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(runOverworldBossCycle, statusBadge) end) local bCd = mkLbl(bL, UDim2.fromOffset(8,118), UDim2.new(1,-16,0,32), " Cooldown: Ready!", Color3.fromRGB(115,225,145), 11, false, Enum.Font.GothamBold) bCd.BackgroundTransparency, bCd.BackgroundColor3 = 0, THEME.bg addCorner(bCd, 6) uiRefs.bossCooldownLabel = bCd createToggleRow(bR, "Auto Repair Gate", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,30), state.autoRepairGate, THEME.green, function(v) state.autoRepairGate=v end) createToggleRow(bR, "Auto Challenge Boss", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,30), state.autoChallengeBoss, THEME.green, function(v) state.autoChallengeBoss=v end) createToggleRow(bR, "Auto Open Boss Chest", UDim2.fromOffset(8,80), UDim2.new(1,-16,0,30), state.autoOpenChest, THEME.green, function(v) state.autoOpenChest=v end) createToggleRow(bR, "Auto Open Chests (Anti-Robux)", UDim2.fromOffset(8,118), UDim2.new(1,-16,0,30), state.autoOpenChests, THEME.green, function(v) state.autoOpenChests=v end) createToggleRow(bR, "Optional Key Chests (Safe)", UDim2.fromOffset(8,154), UDim2.new(1,-16,0,30), state.openKeyChests, THEME.amber, function(v) state.openKeyChests=v end) createPrimaryButton(bR, "Open Eligible Chests Now", UDim2.fromOffset(8,192), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(function() local n=openEligibleChests(resolveWorldName(state.farmWorld), state.openKeyChests, statusBadge) if n==0 then statusBadge.Text=" Chests: None ready (Robux guarded)" end end) end) local dropsCard = createCard(fDropV, UDim2.fromOffset(0,0), UDim2.new(1,0,1,0)) createToggleRow(dropsCard, "Auto Collect Field Drops", UDim2.fromOffset(8,8), UDim2.new(0.54,-8,0,30), state.autoCollectDrops, THEME.green, function(v) state.autoCollectDrops=v end) createPrimaryButton(dropsCard, "Collect Now", UDim2.new(0.54,4,0,8), UDim2.new(0.23,-4,0,30), THEME.accent, scanAndCollectFieldDrops) local dropSummaryLabel = mkLbl(dropsCard, UDim2.fromOffset(8,44), UDim2.new(1,-16,0,24), " Session Totals: None yet", Color3.fromRGB(147,197,253), 11, false, Enum.Font.GothamSemibold) dropSummaryLabel.BackgroundTransparency, dropSummaryLabel.BackgroundColor3, dropSummaryLabel.TextTruncate = 0, THEME.bg, Enum.TextTruncate.AtEnd addCorner(dropSummaryLabel, 6) local dropScroll = Instance.new("ScrollingFrame", dropsCard) dropScroll.Position, dropScroll.Size, dropScroll.BackgroundColor3, dropScroll.BorderSizePixel, dropScroll.ScrollBarThickness, dropScroll.CanvasSize = UDim2.fromOffset(8,74), UDim2.new(1,-16,1,-82), THEME.bg, 0, 5, UDim2.fromOffset(0,0) addCorner(dropScroll, 6) local dropLayout = Instance.new("UIListLayout", dropScroll) dropLayout.Padding, dropLayout.SortOrder = UDim.new(0,2), Enum.SortOrder.LayoutOrder local dPad = Instance.new("UIPadding", dropScroll) dPad.PaddingTop, dPad.PaddingLeft, dPad.PaddingRight = UDim.new(0,4), UDim.new(0,8), UDim.new(0,8) uiRefs.rebuildDropLogUI = function() local parts = {} for k, v in pairs(state.dropTotals) do table.insert(parts, string.format("%s: +%d", k, v)) end table.sort(parts) dropSummaryLabel.Text = #parts > 0 and (" " .. table.concat(parts, " | ")) or " Session Totals: None yet" for _, c in ipairs(dropScroll:GetChildren()) do if c:IsA("TextLabel") then c:Destroy() end end for i, ln in ipairs(state.dropLogs) do local l = mkLbl(dropScroll, UDim2.new(), UDim2.new(1,-6,0,16), ln, THEME.text, 11, false, Enum.Font.Code) l.LayoutOrder=i l.TextTruncate=Enum.TextTruncate.AtEnd end dropScroll.CanvasSize = UDim2.fromOffset(0, dropLayout.AbsoluteContentSize.Y + 8) end state.onDropLogUpdated = uiRefs.rebuildDropLogUI createPrimaryButton(dropsCard, "Clear Log", UDim2.new(0.77,4,0,8), UDim2.new(0.23,-12,0,30), THEME.control, function() table.clear(state.dropTotals) table.clear(state.dropLogs) state.dropsCollected=0 uiRefs.rebuildDropLogUI() end) end -- 2. QUESTS PAGE do local qL, qR = createCard(pages.Quests, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0), true), createCard(pages.Quests, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0), true) createStateButton(qL, "Full Auto Quest", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "fullAutoQuest", function(on) if not on then cancelActiveTween() state.currentTarget=nil state.clickedTarget=nil retreatUnits() statusBadge.Text=" Idle" end end) uiRefs.questMapDropdown = createDropdown({ parent=qL, title="Quest Map", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="questMap", getItems=getWorldChoices, getDisplayText=function() return state.questMap=="Current" and ("Current ("..resolveWorldName("Current")..")") or state.questMap end }) uiRefs.questlineDropdown = createDropdown({ parent=qL, title="Questlines", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.selectedQuestlines, getItems=scanQuestlineChoices, getDisplayText=function() local c=0 for _ in pairs(state.selectedQuestlines) do c=c+1 end return c==0 and "All in Map" or (c.." selected") end }) createPrimaryButton(qL, "Get / Turn-In Quests Now", UDim2.fromOffset(8,114), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(runAutoGetQuests, statusBadge) end) createToggleRow(qL, "Auto Claim Finished Quests", UDim2.fromOffset(8,150), UDim2.new(1,-16,0,30), state.autoClaimFinishedQuests, THEME.green, function(v) state.autoClaimFinishedQuests=v end) local selQuestItem = nil createDropdown({ parent=qL, title="Quest Item", pos=UDim2.fromOffset(8,186), size=UDim2.new(1,-16,0,28), multi=false, getItems=scanQuestItemChoices, isSelected=function(v) return selQuestItem and selQuestItem.value==v end, onToggle=function(v,it) selQuestItem=it end, getDisplayText=function() return selQuestItem and selQuestItem.label or "Pick Quest Item" end }) createPrimaryButton(qL, "TP to Selected Quest Item", UDim2.fromOffset(8,220), UDim2.new(1,-16,0,28), THEME.purple, function() task.spawn(function() local items=scanQuestItemChoices() local t=selQuestItem or items[1] if t then executeTeleport({kind="inst",instance=t.instance,worldId=t.worldId,label=t.label}, statusBadge) else statusBadge.Text=" Quests: No Quest Items spawned" end end) end) createToggleRow(qR, "Auto Get Quests (NPCs)", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,30), state.autoGetQuests, THEME.green, function(v) state.autoGetQuests=v end) createToggleRow(qR, "Include Daily Quests", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,30), state.includeDailyQuests, THEME.amber, function(v) state.includeDailyQuests=v end) createToggleRow(qR, "Include Stage Quests", UDim2.fromOffset(8,80), UDim2.new(1,-16,0,30), state.includeStageQuests, THEME.amber, function(v) state.includeStageQuests=v end) createToggleRow(qR, "Auto NPC Travel", UDim2.fromOffset(8,116), UDim2.new(1,-16,0,30), state.autoNpcTravel, THEME.green, function(v) state.autoNpcTravel=v end) mkLbl(qR, UDim2.fromOffset(10,156), UDim2.new(1,-20,0,110), "Checks active QuestTracker first; if none accepted, travels to NPCs to accept. Completes kill, collect, find, meet NPC, repair, boss & optional daily/stage quests.", THEME.muted, 11, true) end -- 3. WORLD PAGE (Teleports & Auto Merchants) do local wL, wR = createCard(pages.World, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.World, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0), true) local selTp, tpDestDrop = nil, nil createDropdown({ parent=wL, title="TP Group", pos=UDim2.fromOffset(8,10), size=UDim2.new(1,-16,0,30), multi=false, getItems=function() return CHOICES.TP_CATEGORY end, isSelected=function(v) return state.tpCategory==v end, onToggle=function(v) state.tpCategory=v selTp=nil if tpDestDrop then tpDestDrop.refresh() end end, getDisplayText=function() return state.tpCategory end }) tpDestDrop = createDropdown({ parent=wL, title="Location", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,30), multi=false, getItems=function() return getTeleportDestinations(state.tpCategory) end, isSelected=function(v) return selTp and selTp.value==v end, onToggle=function(_,it) selTp=it end, getDisplayText=function() return selTp and selTp.label or "Select Location" end }) createPrimaryButton(wL, "Instant Teleport Now", UDim2.fromOffset(8,84), UDim2.new(1,-16,0,32), THEME.accent, function() task.spawn(executeTeleport, selTp, statusBadge) end) uiRefs.worldInfoLbl = mkLbl(wL, UDim2.fromOffset(10,126), UDim2.new(1,-20,0,90), "World: -\nMode: -", Color3.fromRGB(147,197,253), 11, true) createToggleRow(wR, "Auto Buy Merchants", UDim2.fromOffset(8,10), UDim2.new(1,-16,0,32), state.autoBuyMerchants, THEME.green, function(v) state.autoBuyMerchants=v end) createDropdown({ parent=wR, title="Merchants", pos=UDim2.fromOffset(8,48), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.selectedMerchants, getItems=function() return CHOICES.MERCHANT_CURRENCY end, getDisplayText=function() local c=0 for _,v in pairs(state.selectedMerchants) do if v then c=c+1 end end return c==0 and "None" or (c.." merchant(s)") end }) createDropdown({ parent=wR, title="Offer Items", pos=UDim2.fromOffset(8,82), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.selectedMerchantItems, getItems=getMerchantItemChoices, getDisplayText=function() local c=0 for _ in pairs(state.selectedMerchantItems) do c=c+1 end return c==0 and "All Unlocked" or (c.." item(s)") end }) createPrimaryButton(wR, "Buy Affordable Offers Now", UDim2.fromOffset(8,118), UDim2.new(1,-16,0,30), THEME.green, function() task.spawn(runAutoBuyMerchants, statusBadge, true) end) uiRefs.merchBalanceLbl = mkLbl(wR, UDim2.fromOffset(10,156), UDim2.new(1,-20,0,72), "Gold: 0 | Medals: 0\nShards: 0 | Defense: 0", THEME.muted, 11, true) end -- 4. REWARDS PAGE do local rwL, rwR = createCard(pages.Rewards, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.Rewards, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createToggleRow(rwL, "Auto Claim Rewards", UDim2.fromOffset(8,10), UDim2.new(1,-16,0,32), state.autoClaimRewards, THEME.green, function(v) state.autoClaimRewards=v end) createDropdown({ parent=rwL, title="Sources", pos=UDim2.fromOffset(8,48), size=UDim2.new(1,-16,0,30), multi=true, setTable=state.rewardSources, getItems=function() return CHOICES.REWARD_SOURCE end, getDisplayText=function() local c=0 for _,v in pairs(state.rewardSources) do if v then c=c+1 end end return c.." enabled" end }) createPrimaryButton(rwL, "Claim All Selected Now", UDim2.fromOffset(8,86), UDim2.new(1,-16,0,32), THEME.accent, function() task.spawn(runAutoClaimRewards, statusBadge, true) end) mkLbl(rwL, UDim2.fromOffset(10,126), UDim2.new(1,-20,0,110), "Daily Bonus, Milestones, Season Pass, Countdown Pack, Free Store Claims, Discoveries & Optional Gifts (off by default to protect F2P status).", THEME.muted, 11, true) mkLbl(rwR, UDim2.fromOffset(10,8), UDim2.new(1,-20,0,20), "Code Redeemer (Single or Batch):", THEME.text, 11, false, Enum.Font.GothamBold) local codeBox = Instance.new("TextBox", rwR) codeBox.Position, codeBox.Size, codeBox.BackgroundColor3, codeBox.TextColor3 = UDim2.fromOffset(8,32), UDim2.new(1,-16,0,130), THEME.bg, THEME.text codeBox.PlaceholderText, codeBox.PlaceholderColor3, codeBox.Text, codeBox.Font, codeBox.TextSize = "Enter 1 code or multiple (newline / comma)...", THEME.muted, "", Enum.Font.Code, 11 codeBox.MultiLine, codeBox.ClearTextOnFocus, codeBox.TextWrapped, codeBox.TextXAlignment, codeBox.TextYAlignment = true, false, true, Enum.TextXAlignment.Left, Enum.TextYAlignment.Top addCorner(codeBox, 6) local codeResLbl = mkLbl(rwR, UDim2.fromOffset(10,204), UDim2.new(1,-20,0,32), "Ready to redeem", Color3.fromRGB(147,197,253), 11, true) createPrimaryButton(rwR, "Redeem Code(s)", UDim2.fromOffset(8,168), UDim2.new(0.65,-10,0,30), THEME.green, function() task.spawn(redeemCodesBatch, codeBox.Text, statusBadge, codeResLbl) end) createPrimaryButton(rwR, "Clear", UDim2.new(0.65,2,0,168), UDim2.new(0.35,-10,0,30), THEME.control, function() codeBox.Text="" codeResLbl.Text="Cleared" end) end -- 5. SUMMON PAGE do local sL, sR = createCard(pages.Summon, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.Summon, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) uiRefs.summonStartBtn = createStateButton(sL, "Fast Auto Summon", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "autoSummon") uiRefs.bannerDropdown = createDropdown({ parent=sL, title="Banner", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="summonBanner", getItems=getBannerChoices, getDisplayText=function() local c=BannerConfig and BannerConfig[state.summonBanner] return (c and c.displayName) or state.summonBanner end }) createDropdown({ parent=sL, title="Pull Count", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=false, stateKey="summonCount", getItems=function() return CHOICES.PULL_COUNT end, getDisplayText=function() return state.summonCount.."x" end }) createDropdown({ parent=sL, title="Booster", pos=UDim2.fromOffset(8,114), size=UDim2.new(1,-16,0,28), multi=false, stateKey="summonBooster", getItems=function() return CHOICES.BOOSTER end, getDisplayText=function() for _,c in ipairs(CHOICES.BOOSTER) do if c.value==state.summonBooster then return c.label end end return "None" end }) createDropdown({ parent=sL, title="Delay", pos=UDim2.fromOffset(8,148), size=UDim2.new(1,-16,0,28), multi=false, stateKey="summonDelay", getItems=function() return CHOICES.PULL_DELAY end, getDisplayText=function() return math.floor(state.summonDelay*1000).." ms" end }) uiRefs.stopTargetDropdown = createDropdown({ parent=sL, title="Stop At", pos=UDim2.fromOffset(8,182), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.stopSummonTargets, getItems=getBannerPoolChoices, getDisplayText=function() local c=0 for _ in pairs(state.stopSummonTargets) do c=c+1 end return c==0 and "Never Stop" or (c.." target(s)") end }) uiRefs.summonGemsLbl = mkLbl(sL, UDim2.fromOffset(10,218), UDim2.new(1,-20,0,24), "Gems: 0 | Units: 0", Color3.fromRGB(147,197,253), 11, false, Enum.Font.GothamSemibold) createToggleRow(sR, "Skip Summon Animation", UDim2.fromOffset(8,10), UDim2.new(1,-16,0,32), state.skipAnimation, THEME.green, function(v) state.skipAnimation=v end) createToggleRow(sR, "Auto-Lock Mythic/Secret/Shiny", UDim2.fromOffset(8,48), UDim2.new(1,-16,0,32), state.autoLockHigh, THEME.green, function(v) state.autoLockHigh=v end) createToggleRow(sR, "Auto-Dismantle Rarities", UDim2.fromOffset(8,86), UDim2.new(1,-16,0,32), state.autoDismantle, THEME.amber, function(v) state.autoDismantle=v end) createDropdown({ parent=sR, title="Dismantle", pos=UDim2.fromOffset(8,126), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.dismantleRarities, getItems=getRarityChoices, getDisplayText=function() local t={} for k in pairs(state.dismantleRarities) do table.insert(t,k) end table.sort(t) return #t==0 and "None" or table.concat(t,", ") end }) createPrimaryButton(sR, "Pull Once Now", UDim2.fromOffset(8,164), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(runOneSummon, statusBadge) end) end -- 6. TRAITS PAGE do local tL, tR = createCard(pages.Traits, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.Traits, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) uiRefs.traitStartBtn = createStateButton(tL, "Auto Trait Reroll", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "autoTraitReroll") uiRefs.traitUnitDropdown = createDropdown({ parent=tL, title="Champion", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="traitUnitUid", getItems=getChampionChoices, getDisplayText=function() return getSelectedChampionLabel(state.traitUnitUid) end }) createDropdown({ parent=tL, title="Slot", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=false, stateKey="traitSlot", getItems=function() return CHOICES.TRAIT_SLOT end, getDisplayText=function() return state.traitSlot==0 and "Both (1 & 2)" or ("Slot "..state.traitSlot) end }) createDropdown({ parent=tL, title="Targets", pos=UDim2.fromOffset(8,114), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.targetTraits, getItems=getTraitChoices, getDisplayText=function() local c=0 for _ in pairs(state.targetTraits) do c=c+1 end return c==0 and "None" or (c.." trait(s)") end }) createDropdown({ parent=tL, title="Min Tokens", pos=UDim2.fromOffset(8,148), size=UDim2.new(1,-16,0,28), multi=false, stateKey="traitMinTokens", getItems=function() return CHOICES.TOKEN_RESERVE end, getDisplayText=function() return "Reserve "..state.traitMinTokens end }) uiRefs.traitStatusLbl = mkLbl(tL, UDim2.fromOffset(10,186), UDim2.new(1,-20,0,56), "Trait Tokens: 0\nSlot 1: -\nSlot 2: -", Color3.fromRGB(147,197,253), 11, true) createToggleRow(tR, "Mythic/Secret Safety Guard", UDim2.fromOffset(8,10), UDim2.new(1,-16,0,32), state.traitSafetyGuard, THEME.green, function(v) state.traitSafetyGuard=v end) createPrimaryButton(tR, "Reroll Once Now", UDim2.fromOffset(8,50), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(runTraitRerollStep, statusBadge) end) end -- 7. UNITS PAGE do local uL, uR = createCard(pages.Units, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.Units, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) uiRefs.unitDropdown = createDropdown({ parent=uL, title="Champion", pos=UDim2.fromOffset(8,10), size=UDim2.new(1,-16,0,28), multi=false, stateKey="unitSelectedUid", getItems=getChampionChoices, getDisplayText=function() return getSelectedChampionLabel(state.unitSelectedUid) end }) createDropdown({ parent=uL, title="Fruit", pos=UDim2.fromOffset(8,44), size=UDim2.new(1,-16,0,28), multi=false, stateKey="unitFeedFruit", getItems=getFruitChoices, getDisplayText=function() if state.unitFeedFruit=="auto" then return "Auto Best" end local d=ItemDefs and ItemDefs.get(state.unitFeedFruit) return (d and d.displayName) or state.unitFeedFruit end }) createPrimaryButton(uL, "Feed 1 Fruit", UDim2.fromOffset(8,80), UDim2.new(0.5,-10,0,28), THEME.accent, function() task.spawn(feedChampionAction, false, statusBadge) end) createPrimaryButton(uL, "Feed to Cap", UDim2.new(0.5,2,0,80), UDim2.new(0.5,-10,0,28), THEME.green, function() task.spawn(feedChampionAction, true, statusBadge) end) createPrimaryButton(uL, "Auto-Fill Ascend", UDim2.fromOffset(8,114), UDim2.new(0.5,-10,0,28), THEME.amber, function() task.spawn(autoFillAscendAction, statusBadge) end) createPrimaryButton(uL, "Evolve", UDim2.new(0.5,2,0,114), UDim2.new(0.5,-10,0,28), THEME.purple, function() task.spawn(evolveChampionAction, statusBadge) end) createToggleRow(uL, "Auto Equip Best (Base Stats)", UDim2.fromOffset(8,150), UDim2.new(1,-16,0,30), state.autoEquipBestBase, THEME.green, function(v) state.autoEquipBestBase=v if v then task.spawn(equipBestBaseStatsAction, statusBadge, false) end end) createPrimaryButton(uL, "Equip Best Team (Base Stats)", UDim2.fromOffset(8,186), UDim2.new(1,-16,0,28), THEME.green, function() task.spawn(equipBestBaseStatsAction, statusBadge, false) end) createDropdown({ parent=uR, title="Bulk Rarity", pos=UDim2.fromOffset(8,10), size=UDim2.new(1,-16,0,28), multi=true, setTable=state.unitBulkRarities, getItems=getRarityChoices, getDisplayText=function() local t={} for k in pairs(state.unitBulkRarities) do table.insert(t,k) end table.sort(t) return #t==0 and "None" or table.concat(t,", ") end }) createToggleRow(uR, "Shiny Guard (Dismantle)", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,32), state.unitShinyGuard, THEME.green, function(v) state.unitShinyGuard=v end) createPrimaryButton(uR, "Bulk Lock Selected", UDim2.fromOffset(8,84), UDim2.new(1,-16,0,30), THEME.accent, function() task.spawn(bulkLockByRarity, state.unitBulkRarities, true, statusBadge) end) createPrimaryButton(uR, "Lock Mythic / Secret / Shiny", UDim2.fromOffset(8,120), UDim2.new(1,-16,0,30), THEME.control, function() task.spawn(function() statusBadge.Text=string.format(" Locked %d High/Shiny", lockHighRarityAndShiny()) end) end) createPrimaryButton(uR, "Bulk Dismantle Selected", UDim2.fromOffset(8,156), UDim2.new(1,-16,0,30), THEME.red, function() task.spawn(dismantleByRarity, state.unitBulkRarities, state.unitShinyGuard, statusBadge) end) end -- 8. RAIDS & STAGES PAGE do local raidSubBar = Instance.new("Frame", pages.Raids) raidSubBar.Size, raidSubBar.BackgroundTransparency = UDim2.new(1,0,0,28), 1 local raidSubViews, raidSubBtns = {}, {} local rV = makeSubTabBtn(raidSubBar, pages.Raids, raidSubBtns, raidSubViews, "Raid", "Auto Raid", 1, 4, state.raidsSubTab, function(k) state.raidsSubTab=k end) local bV = makeSubTabBtn(raidSubBar, pages.Raids, raidSubBtns, raidSubViews, "Boons", "Boons (Drag)", 2, 4, state.raidsSubTab, function(k) state.raidsSubTab=k end) local stV = makeSubTabBtn(raidSubBar, pages.Raids, raidSubBtns, raidSubViews, "Stage", "Auto Stage", 3, 4, state.raidsSubTab, function(k) state.raidsSubTab=k end) local svV = makeSubTabBtn(raidSubBar, pages.Raids, raidSubBtns, raidSubViews, "Server", "Return Server", 4, 4, state.raidsSubTab, function(k) state.raidsSubTab=k end) local rL, rR = createCard(rV, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(rV, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createStateButton(rL, "Auto Raid", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "autoRaid") createDropdown({ parent=rL, title="Raid", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="raidBaseId", getItems=getRaidChoices, getDisplayText=function() if state.raidBaseId=="offered" then return "Today's Offered" end local b=RaidRunConfig and RaidRunConfig.getBase and RaidRunConfig.getBase(state.raidBaseId) return (b and b.displayName) or state.raidBaseId end }) createDropdown({ parent=rL, title="Tier", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=false, stateKey="raidTier", getItems=getRaidTierChoices, getDisplayText=function() return state.raidTier==0 and "Intro (0)" or ("Tier "..state.raidTier) end }) createToggleRow(rR, "Auto-Start Raid Lobby", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,30), state.raidAutoStart, THEME.green, function(v) state.raidAutoStart=v end) createToggleRow(rR, "Auto-Engage Waves & TP", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,30), state.raidAutoEngage, THEME.green, function(v) state.raidAutoEngage=v end) createToggleRow(rR, "Auto-Vote Boons (Priority)", UDim2.fromOffset(8,80), UDim2.new(1,-16,0,30), state.autoVoteBoons, THEME.green, function(v) state.autoVoteBoons=v end) createToggleRow(rR, "Auto-Ready Next Stage", UDim2.fromOffset(8,116), UDim2.new(1,-16,0,30), state.autoReadyNextStage, THEME.green, function(v) state.autoReadyNextStage=v end) local boonsCard = createCard(bV, UDim2.fromOffset(0,0), UDim2.new(1,0,1,0)) mkLbl(boonsCard, UDim2.fromOffset(10,6), UDim2.new(0.65,0,0,22), "Drag rows (or ^/v) to rank Boon Priority (#1 = Top)", THEME.muted, 11, false, Enum.Font.GothamSemibold) local boonScroll = Instance.new("ScrollingFrame", boonsCard) boonScroll.Position, boonScroll.Size, boonScroll.BackgroundColor3, boonScroll.BorderSizePixel, boonScroll.ScrollBarThickness, boonScroll.CanvasSize = UDim2.fromOffset(8,32), UDim2.new(1,-16,1,-40), THEME.bg, 0, 5, UDim2.fromOffset(0,0) addCorner(boonScroll, 6) local boonRowH = 26 uiRefs.rebuildBoonListUI = function() for _, c in ipairs(boonScroll:GetChildren()) do if c:IsA("Frame") then c:Destroy() end end local list = state.boonPriority for idx, bid in ipairs(list) do local bDef = RaidRunConfig and RaidRunConfig.getBoon and RaidRunConfig.getBoon(bid) local row = Instance.new("Frame", boonScroll) row.Position, row.Size, row.BackgroundColor3, row.BorderSizePixel = UDim2.fromOffset(4, (idx-1)*(boonRowH+3)+4), UDim2.new(1,-12,0,boonRowH), THEME.control, 0 addCorner(row, 5) local hnd = Instance.new("TextButton", row) hnd.Size, hnd.BackgroundTransparency, hnd.Text, hnd.TextColor3, hnd.Font, hnd.TextSize, hnd.TextXAlignment, hnd.TextTruncate = UDim2.new(1,-56,1,0), 1, string.format(" :: #%d %s (%s)", idx, (bDef and bDef.name) or bid, bid), THEME.text, Enum.Font.GothamSemibold, 11, Enum.TextXAlignment.Left, Enum.TextTruncate.AtEnd hnd.InputBegan:Connect(function(inp) if inp.UserInputType ~= Enum.UserInputType.MouseButton1 then return end local stI, curI = idx, idx row.BackgroundColor3 = THEME.accent row.ZIndex = 20 local mc, ec mc = UserInputService.InputChanged:Connect(function(mi) if mi.UserInputType == Enum.UserInputType.MouseMovement then local ni = math.clamp(math.floor(((mi.Position.Y - boonScroll.AbsolutePosition.Y) + boonScroll.CanvasPosition.Y) / (boonRowH + 3)) + 1, 1, #list) if ni ~= curI then curI = ni row.Position = UDim2.fromOffset(4, (curI - 1) * (boonRowH + 3) + 4) end end end) ec = UserInputService.InputEnded:Connect(function(ei) if ei.UserInputType == Enum.UserInputType.MouseButton1 then mc:Disconnect() ec:Disconnect() if curI ~= stI then local mv = table.remove(list, stI) table.insert(list, curI, mv) if state.autoExecuteOnTeleport then saveConfig() end end uiRefs.rebuildBoonListUI() end end) end) createPrimaryButton(row, "^", UDim2.new(1,-52,0,3), UDim2.fromOffset(22,20), THEME.card, function() if idx>1 then list[idx],list[idx-1]=list[idx-1],list[idx] if state.autoExecuteOnTeleport then saveConfig() end uiRefs.rebuildBoonListUI() end end).TextSize = 10 createPrimaryButton(row, "v", UDim2.new(1,-26,0,3), UDim2.fromOffset(22,20), THEME.card, function() if idx<#list then list[idx],list[idx+1]=list[idx+1],list[idx] if state.autoExecuteOnTeleport then saveConfig() end uiRefs.rebuildBoonListUI() end end).TextSize = 10 end boonScroll.CanvasSize = UDim2.fromOffset(0, #list * (boonRowH + 3) + 10) end createPrimaryButton(boonsCard, "Reset Default Order", UDim2.new(1,-138,0,4), UDim2.fromOffset(130,24), THEME.control, function() state.boonPriority=getDefaultBoonPriority() if state.autoExecuteOnTeleport then saveConfig() end uiRefs.rebuildBoonListUI() end) local stL, stR = createCard(stV, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(stV, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createStateButton(stL, "Auto Stage / Missions", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,32), "autoStage") createDropdown({ parent=stL, title="Mission", pos=UDim2.fromOffset(8,46), size=UDim2.new(1,-16,0,28), multi=false, stateKey="stageMissionId", getItems=getStageMissionChoices, getDisplayText=function() local ok,m=pcall(function() return MissionsConfig and MissionsConfig.get(state.stageMissionId) end) return (ok and m and (m.name or m.title)) or tostring(state.stageMissionId) end }) createDropdown({ parent=stL, title="End Vote", pos=UDim2.fromOffset(8,80), size=UDim2.new(1,-16,0,28), multi=false, stateKey="afterMatchVote", getItems=function() return CHOICES.AFTER_MATCH_VOTE end, getDisplayText=function() return state.afterMatchVote end }) createToggleRow(stR, "Auto-Start Stage Lobby", UDim2.fromOffset(8,8), UDim2.new(1,-16,0,30), state.stageAutoStart, THEME.green, function(v) state.stageAutoStart=v end) createToggleRow(stR, "Auto-Engage Waves & TP", UDim2.fromOffset(8,44), UDim2.new(1,-16,0,30), state.stageAutoEngage, THEME.green, function(v) state.stageAutoEngage=v end) createToggleRow(stR, "Auto-Skip Cutscenes", UDim2.fromOffset(8,80), UDim2.new(1,-16,0,30), state.autoSkipCutscenes, THEME.green, function(v) state.autoSkipCutscenes=v end) local svL, svR = createCard(svV, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(svV, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createDropdown({ parent=svL, title="Return To", pos=UDim2.fromOffset(8,10), size=UDim2.new(1,-16,0,30), multi=false, stateKey="returnServerMode", getItems=function() return CHOICES.RETURN_SERVER_MODE end, getDisplayText=function() for _,c in ipairs(CHOICES.RETURN_SERVER_MODE) do if c.value==state.returnServerMode then return c.label end end return "Lobby (Normal)" end }) createToggleRow(svL, "Auto Return After Match", UDim2.fromOffset(8,46), UDim2.new(1,-16,0,30), state.autoReturnPostRun, THEME.green, function(v) state.autoReturnPostRun=v end) createPrimaryButton(svL, "Save Current Server as Private", UDim2.fromOffset(8,84), UDim2.new(1,-16,0,30), THEME.accent, function() state.savedServerPlaceId=game.PlaceId state.savedServerJobId=game.JobId saveConfig() statusBadge.Text=" Saved current server!" end) createPrimaryButton(svL, "Return to Picked Server Now", UDim2.fromOffset(8,120), UDim2.new(1,-16,0,30), THEME.green, function() if not returnToCustomServer(statusBadge) then statusBadge.Text=" No custom server saved" end end) uiRefs.serverInfoLbl = mkLbl(svR, UDim2.fromOffset(10,10), UDim2.new(1,-20,1,-20), "Current Job: -\nPre-Run Job: -\nSaved Private: -", Color3.fromRGB(147,197,253), 11, true, Enum.Font.Code) end -- 9. CONFIG PAGE do local cfgL, cfgR = createCard(pages.Config, UDim2.fromOffset(0,0), UDim2.new(0.5,-4,1,0)), createCard(pages.Config, UDim2.new(0.5,4,0,0), UDim2.new(0.5,-4,1,0)) createToggleRow(cfgL, "Auto Execute on Teleport", UDim2.fromOffset(8,10), UDim2.new(1,-16,0,34), state.autoExecuteOnTeleport, THEME.green, function(v) state.autoExecuteOnTeleport=v syncAutoExecuteSetup() statusBadge.Text = v and " Auto-Execute Enabled" or " Auto-Execute Disabled" end) createPrimaryButton(cfgL, "Save All Settings Now", UDim2.fromOffset(8,52), UDim2.new(1,-16,0,30), THEME.accent, function() local ok,err=saveConfig() statusBadge.Text = ok and " Config saved!" or (" Save error: "..tostring(err)) end) createPrimaryButton(cfgL, "Queue Teleport Reload Now", UDim2.fromOffset(8,88), UDim2.new(1,-16,0,30), THEME.control, function() statusBadge.Text = queueTeleportReload() and " Queued reload!" or " queue_on_teleport unavailable" end) mkLbl(cfgR, UDim2.fromOffset(10,10), UDim2.new(1,-20,1,-20), "Auto Execute stores settings in ACXStudio/config.json and uses ACXStudio/autofarm_main.luau + queue_on_teleport so active farms, raids & stages resume seamlessly across Raids, Stages, Server Hops & Reconnects.", THEME.muted, 11, true) end -- Live Refresh & Controls local function updateLiveLabels() uiRefs.farmWorldDropdown.refresh() uiRefs.questMapDropdown.refresh() uiRefs.bossWorldDropdown.refresh() uiRefs.enemyDropdown.refresh() uiRefs.questlineDropdown.refresh() uiRefs.abilitySlotDropdown.refresh() uiRefs.bannerDropdown.refresh() uiRefs.stopTargetDropdown.refresh() uiRefs.traitUnitDropdown.refresh() uiRefs.unitDropdown.refresh() local objs = parseQuestObjectives() uiRefs.questPreviewLbl.Text = #objs > 0 and ("Quest: " .. objs[1].text) or "Quest: (none detected)" local rem = state.bossCooldownEnd - os.clock() uiRefs.bossCooldownLabel.Text = rem > 0 and (" Cooldown: " .. formatSeconds(rem)) or " Cooldown: Ready!" uiRefs.bossCooldownLabel.TextColor3 = rem > 0 and Color3.fromRGB(240,185,95) or Color3.fromRGB(115,225,145) uiRefs.worldInfoLbl.Text = string.format("World: %s\nMode: %s\nPlaceId: %d", tostring(LocalPlayer:GetAttribute("OverworldWorldId") or "-"), tostring(workspace:GetAttribute("GamemodeId") or "overworld"), game.PlaceId) uiRefs.serverInfoLbl.Text = string.format("Current Place: %d\nCurrent Job: %s\n\nPre-Run Job: %s\n\nSaved Private: %s", game.PlaceId, game.JobId~="" and game.JobId:sub(1,16).."..." or "-", state.preRunJobId~="" and state.preRunJobId:sub(1,16).."..." or "-", state.savedServerJobId~="" and state.savedServerJobId:sub(1,16).."..." or "-") local snap = getDataSnapshot() if snap then local it = snap.Items or {} local cnt = 0 for _ in pairs(snap.Champions or {}) do cnt = cnt + 1 end uiRefs.summonGemsLbl.Text = string.format("Gems: %d | Units: %d", it.gems or 0, cnt) uiRefs.merchBalanceLbl.Text = string.format("Gold: %d\nRaid Medals: %d\nComet Shards: %d\nDefense Crystals: %d", it.gold or 0, it.raid_medal or 0, it.comet_shard or 0, it.defense_crystals or 0) local ch = state.traitUnitUid and snap.Champions and snap.Champions[state.traitUnitUid] uiRefs.traitStatusLbl.Text = string.format("Trait Tokens: %d\nSlot 1: %s\nSlot 2: %s", it.trait_tokens or 0, tostring((ch and ch.traits and ch.traits[1]) or "-"), tostring((ch and ch.traits and ch.traits[2]) or "-")) end uiRefs.summonStartBtn.Text = "Fast Auto Summon: " .. (state.autoSummon and "ON" or "OFF") uiRefs.summonStartBtn.BackgroundColor3 = state.autoSummon and THEME.green or THEME.red uiRefs.traitStartBtn.Text = "Auto Trait Reroll: " .. (state.autoTraitReroll and "ON" or "OFF") uiRefs.traitStartBtn.BackgroundColor3 = state.autoTraitReroll and THEME.green or THEME.red end local minimized = false minBtn.MouseButton1Click:Connect(function() closeActiveDropdown() minimized = not minimized contentRoot.Visible = not minimized mainFrame.Size = minimized and UDim2.fromOffset(WINDOW_W, 36) or UDim2.fromOffset(WINDOW_W, WINDOW_H) minBtn.Text = minimized and "+" or "-" end) local function shutdownHub(shouldRetreat) closeActiveDropdown() state.running=false state.autoFarm=false state.fullAutoQuest=false state.autoGetQuests=false state.autoBoss=false state.autoSummon=false state.autoTraitReroll=false state.autoEquipBestBase=false state.autoRaid=false state.autoStage=false cancelActiveTween() if shouldRetreat then retreatUnits() end for _, c in ipairs(state.connections) do pcall(function() c:Disconnect() end) end pcall(function() screenGui:Destroy() end) end do local env = (getgenv and getgenv()) or _G env.__ACX_SHUTDOWN = function() shutdownHub(false) end end closeBtn.MouseButton1Click:Connect(function() shutdownHub(true) end) do local dragging, dStart, sPos table.insert(state.connections, header.InputBegan:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then closeActiveDropdown() dragging=true dStart=i.Position sPos=mainFrame.Position end end)) table.insert(state.connections, UserInputService.InputChanged:Connect(function(i) if dragging and i.UserInputType==Enum.UserInputType.MouseMovement then local d=i.Position-dStart mainFrame.Position=UDim2.new(sPos.X.Scale,sPos.X.Offset+d.X,sPos.Y.Scale,sPos.Y.Offset+d.Y) end end)) table.insert(state.connections, UserInputService.InputEnded:Connect(function(i) if i.UserInputType==Enum.UserInputType.MouseButton1 then dragging=false end end)) end uiRefs.rebuildDropLogUI() uiRefs.rebuildBoonListUI() updateLiveLabels() -- Fast Loop task.spawn(function() while state.running do local okF, errF = xpcall(function() if state.skipAnimation and state.autoSummon then dismissBannerCutsceneOverlay() end if state.autoSummon and (os.clock() - state.lastSummonTime) >= state.summonDelay then state.lastSummonTime = os.clock() runOneSummon(statusBadge) end if state.autoTraitReroll and (os.clock() - state.lastTraitTime) >= 0.18 then state.lastTraitTime = os.clock() runTraitRerollStep(statusBadge) end if state.autoEquipBestBase and (os.clock() - state.lastEquipCheck) >= 3.0 then state.lastEquipCheck = os.clock() equipBestBaseStatsAction(statusBadge, true) end if state.autoBuyMerchants and (os.clock() - state.lastMerchantCheck) >= 5.0 then state.lastMerchantCheck = os.clock() runAutoBuyMerchants(statusBadge, false) end if state.autoClaimRewards and (os.clock() - state.lastRewardCheck) >= 6.0 then state.lastRewardCheck = os.clock() runAutoClaimRewards(statusBadge, false) end end, debug.traceback) if not okF then warn("[ACX FastLoop]", errF) task.wait(0.5) end task.wait(0.05) end end) -- Main Gameplay Loop local lastUiRefresh, lastDropScan = 0, 0 task.spawn(function() while state.running do local okM, errM = xpcall(function() if (os.clock() - lastUiRefresh) >= 1.2 then lastUiRefresh = os.clock() updateLiveLabels() end if state.autoCollectDrops and (os.clock() - lastDropScan) >= 0.75 then lastDropScan = os.clock() scanAndCollectFieldDrops() end if state.autoClaimFinishedQuests and (os.clock() - state.lastClaimQuestCheck) >= 2.0 then state.lastClaimQuestCheck = os.clock() autoClaimFinishedQuestsAction() end local gm = workspace:GetAttribute("GamemodeId") or "overworld" if state.autoRaid or state.autoStage or (state.fullAutoQuest and state.includeStageQuests) then stepAutoRaidAndStage(statusBadge) end if gm == "overworld" then if state.autoOpenChests and not state.isDoingBossRun and not state.isDoingQuestAction and (os.clock() - state.lastChestCheck) >= 2.5 then state.lastChestCheck = os.clock() openEligibleChests(resolveWorldName(state.farmWorld), state.openKeyChests, statusBadge) end if state.autoBoss and not state.isDoingBossRun and not state.isDoingQuestAction and os.clock() >= state.bossCooldownEnd then runOverworldBossCycle(statusBadge) end if state.autoGetQuests and not state.isDoingQuestAction and not state.isDoingBossRun and (os.clock() - state.lastQuestCheck) >= state.questCheckInterval then state.lastQuestCheck = os.clock() runAutoGetQuests(statusBadge) end end if gm == "overworld" and (state.autoFarm or state.fullAutoQuest) and not state.isDoingQuestAction and not state.isDoingBossRun then local char, _, hrp = getCharacterParts() if char and hrp then local activeQKws, skipCombat = nil, false if state.fullAutoQuest then local objs = parseQuestObjectives() if #objs == 0 then statusBadge.Text=" No active quest, talking to NPC..." runAutoGetQuests(statusBadge) skipCombat = true else for _, o in ipairs(objs) do if o.kind=="turn_in" and executeFullQuestObjective(o, statusBadge) then skipCombat=true break end end if not skipCombat then for _, o in ipairs(objs) do if o.kind~="combat" and o.kind~="turn_in" and (o.kind~="stage" or (state.includeStageQuests and not (o.text:lower():find("raid") and not state.autoRaid))) and executeFullQuestObjective(o, statusBadge) then skipCombat=true break end end end if not skipCombat then for _, o in ipairs(objs) do if o.kind=="combat" or o.kind=="boss" then local m,_,_,cf = getBestTarget(hrp.Position, o.keywords, false) if m or cf then activeQKws=o.keywords break end end end if not activeQKws then for _, o in ipairs(objs) do if o.kind=="combat" or o.kind=="boss" then activeQKws=o.keywords break end end end end end end if not skipCombat then if state.autoFarm and state.autoWorldTravel then ensureWorldTravel(resolveWorldName(state.farmWorld), statusBadge) end local target, isQ, campF = state.currentTarget, false, nil if not isEnemyAlive(target) then state.currentTarget = nil state.clickedTarget = nil target, _, isQ, campF = getBestTarget(hrp.Position, activeQKws, (not state.fullAutoQuest) or state.autoFarm) state.currentTarget = target end if target then local tH = target:FindFirstChild("HumanoidRootPart") or target.PrimaryPart if tH then local goalCF = CFrame.lookAt((tH.CFrame * CFrame.new(0, state.offsetY, state.offsetZ)).Position, tH.Position) local dist = (hrp.Position - tH.Position).Magnitude if state.clickedTarget ~= target then statusBadge.Text = string.format(" %sMoving: %s (%.1f)", isQ and "[Quest] " or "", target.Name, dist) moveToCFrame(hrp, goalCF, false) if dist <= state.engageRange or state.moveMode == "Instant" then cancelActiveTween() engageEnemyModel(target, tH) state.clickedTarget = target elseif dist <= 100 then engageEnemyModel(target, tH) end else statusBadge.Text = string.format(" Waiting for %s to die...", target.Name) engageEnemyModel(target, tH) if state.autoAbilities and (os.clock() - state.lastAbilityTime) >= state.abilityInterval then state.lastAbilityTime = os.clock() useChampionAbilities() end end end elseif campF then statusBadge.Text = string.format(" [Quest] Moving to camp: %s", campF.campName) moveToCFrame(hrp, CFrame.new(campF.position + Vector3.new(0, 0, 6)), false) else cancelActiveTween() statusBadge.Text = state.fullAutoQuest and " Quest target not found" or " No matching enemies in filter" end end else cancelActiveTween() statusBadge.Text = " Waiting for character..." end end end, debug.traceback) if not okM then warn("[ACX MainLoop]", errM) task.wait(0.5) end task.wait(0.15) end end)