-- v1 local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local LP = Players.LocalPlayer local INPUT = game:GetService("UserInputService") local VERBOSE = true local EQUIP_SLOT_FIRST = 1 local EQUIP_SLOT_CROW = 4 local EQUIP_1_TO_4_GAP = 0.30 local CROW_HOLD_TIME = 7.0 local CROW_GUI_TIMEOUT = 12.0 local RESCAN_DELAY = 0.5 local NO_QUEST_GRACE = 2 local TP_OFFSET_STUDS = 4 local TP_NEAR_DISTANCE = 8 local CHEST_HOLD = 2.1 local LOOT_TAP = 0.04 local LOOT_TIMEOUT = 5 local ATTACK_INTERVAL = 0.12 local ABILITY_INTERVAL = 0.12 local ATTACK_KEYS = {Enum.KeyCode.B, Enum.KeyCode.V, Enum.KeyCode.C, Enum.KeyCode.X, Enum.KeyCode.Z} local UI_UTIL = { UIPadding = true, UICorner = true, UIStroke = true, UIGridLayout = true, UIListLayout = true, UIPageLayout = true, UIScale = true, UISizeConstraint = true, UIAspectRatioConstraint = true, UITextSizeConstraint = true, UICanvasGroup = true, UIGradient = true, UIShadow = true, } local SIGNAL = RS:WaitForChild("Communication") :WaitForChild("ServerAndClient") :WaitForChild("Signals") :WaitForChild("SignalEvent") :WaitForChild("Event") local GUI_SEGMENTS = { "ComponentsHolder","DialogueContent","Frame","ListMask", "ActualHolder","InnerHolder", } local TRACKER_SEGMENTS = { "ComponentsHolder","LeftCenterFramesHolder","zQuestsFrame","Panel", } local AUTO_QUEST = false local claimed = {} local stage = "idle" local followAnchor, followConnection local closed, equipGeneration = false, 0 local bossHumanoid, deathConnection, lootPending, keyHeld local handledBosses = setmetatable({}, {__mode = "k"}) local noQuestSince local statusLabel, controlFrame local function setStatus(text) if statusLabel then pcall(function() statusLabel:Set(text) end) end if VERBOSE then print("[autoquest] " .. text) end end local function setStage(s) if stage ~= s then stage = s; setStatus(s) end end local equippedSlot, equippedCharacter, equipKey local SLOT_KEYS = {[1] = Enum.KeyCode.One, [4] = Enum.KeyCode.Four, [5] = Enum.KeyCode.Five} local function releaseEquipKey() if not equipKey then return true end local ok = pcall(function() game:GetService("VirtualInputManager"):SendKeyEvent(false, equipKey, false, game) end) if ok then equipKey = nil end return ok end local function tapSlot(slot) if closed or INPUT:GetFocusedTextBox() or not SLOT_KEYS[slot] then return false end if not releaseEquipKey() then return false end equipKey = SLOT_KEYS[slot] local ok, err = pcall(function() game:GetService("VirtualInputManager"):SendKeyEvent(true, equipKey, false, game) task.wait(0.04) end) local released = releaseEquipKey() if not ok then warn("[autoquest] equipment key failed: " .. tostring(err)) end return ok and released end local function equipSlot(slot) if not AUTO_QUEST or not LP.Character then return false end if equippedCharacter ~= LP.Character then equippedSlot, equippedCharacter = nil, LP.Character end if equippedSlot == slot then return true end local generation, character = equipGeneration, LP.Character local ok = tapSlot(slot) if ok then equippedSlot = slot end return ok and AUTO_QUEST and generation == equipGeneration and LP.Character == character end local function resolveInner() local node = LP:FindFirstChildOfClass("PlayerGui"); if not node then return nil end for _, seg in ipairs(GUI_SEGMENTS) do node = node:FindFirstChild(seg); if not node then return nil end end return node end local function resolveTrackerPanel() local node = LP:FindFirstChildOfClass("PlayerGui"); if not node then return nil end for _, seg in ipairs(TRACKER_SEGMENTS) do node = node:FindFirstChild(seg); if not node then return nil end end return node end local function readTrackerQuest() local panel = resolveTrackerPanel(); if not panel then return nil end for _, qframe in ipairs(panel:GetChildren()) do if qframe:IsA("GuiObject") and not UI_UTIL[qframe.Name] then local th = qframe:FindFirstChild("cTasksHolder") if th then for _, c in ipairs(th:GetChildren()) do if c:IsA("GuiObject") and not UI_UTIL[c.Name] then return qframe.Name, c.Name, (c.Name:gsub("^%a+%s+", "")) end end end end end return nil end local function getHolder() local ps = RS:FindFirstChild("Player_Service"); if not ps then return nil end local data = ps:FindFirstChild("Data"); if not data then return nil end local me = data:FindFirstChild(LP.Name); if not me then return nil end local slots = me:FindFirstChild("slots"); if not slots then return nil end local slot1 = slots:FindFirstChild("Slot1"); if not slot1 then return nil end local quests = slot1:FindFirstChild("Quests"); if not quests then return nil end return quests:FindFirstChild("Holder") end local function hasActiveQuest() if readTrackerQuest() then return true end local h = getHolder() return h ~= nil and #h:GetChildren() > 0 end local BOSS_POSITIONS = { domae = Vector3.new(-296.471985, 1352.99988, -3451.27295), akazo = Vector3.new(-1129.14832, 1383.31055, -1745.64832), datai = Vector3.new(-167.81192, 1045.49988, -1138.5094), enru = Vector3.new(825.797729, 797.896545, 549.380737), fujiko = Vector3.new(-2461.62598, 40.3170967, 1117.21765), gyutai = Vector3.new(-270.83255, 1045.73706, -1143.99133), hoyuzo = Vector3.new(746.875, 1003.49994, -1413), kaiden = Vector3.new(583.95343, 1149.01538, -1312.01135), nezura = Vector3.new(-1459.526, 278.450653, 935.536011), reaper = Vector3.new(98.4680023, 1045.49988, -573.911011), sumari = Vector3.new(393.200928, 1020.49994, -620.668945), yahari = Vector3.new(827.53241, 1021.70013, -643.158569), zuko = Vector3.new(-296.70401, 1226.69958, -1022.19702), } local travelKey, travelCharacter, retryAt = nil, nil, 0 local function bossKey(name) local text = (name or ""):lower() if BOSS_POSITIONS[text] then return text end local found for word in text:gmatch("%a+") do if BOSS_POSITIONS[word] then if found and found ~= word then return nil end found = word end end return found end local function findNpcWrapper(hint) local humanoids = workspace:FindFirstChild("Humanoids"); if not humanoids then return nil end local regions = humanoids:FindFirstChild("Regions"); if not regions then return nil end local misc = regions:FindFirstChild("Misc"); if not misc then return nil end local active = misc:FindFirstChild("ActiveNpcs"); if not active then return nil end if not hint or hint == "" then return nil end local lowerHint = hint:lower() for _, c in ipairs(active:GetChildren()) do if c.Name:lower() == lowerHint then return c end end local best, bestLen = nil, 0 for _, c in ipairs(active:GetChildren()) do local ln = c.Name:lower() if ln:find(lowerHint, 1, true) or lowerHint:find(ln, 1, true) then if #c.Name > bestLen then best, bestLen = c, #c.Name end end end return best end local function teleportToPos(targetPos, lookAt, force) local char = LP.Character; if not char then return false end local hrp = char:FindFirstChild("HumanoidRootPart"); if not hrp then return false end if typeof(targetPos) ~= "Vector3" then return false end local look = lookAt or (targetPos + Vector3.new(0, 0, 1)) local dist = (hrp.Position - targetPos).Magnitude if not force and dist < TP_NEAR_DISTANCE then return true, dist end local ok = pcall(function() hrp.CFrame = CFrame.new(targetPos, look) end) return ok, dist end local function teleportToAnchor(anchor) if not anchor or not anchor:IsDescendantOf(workspace) then return false end local char = LP.Character if not char or char ~= travelCharacter then return false end local hrp = char:FindFirstChild("HumanoidRootPart") local humanoid = char:FindFirstChildOfClass("Humanoid") if not hrp or not humanoid or humanoid.Health <= 0 then return false end local dir = Vector3.new(anchor.CFrame.LookVector.X, 0, anchor.CFrame.LookVector.Z) dir = dir.Magnitude > 0.001 and dir.Unit or Vector3.new(0, 0, -1) local target = anchor.Position - dir * TP_OFFSET_STUDS + Vector3.new(0, 1, 0) hrp.CFrame = CFrame.lookAt(target, target + dir) hrp.AssemblyLinearVelocity = Vector3.zero hrp.AssemblyAngularVelocity = Vector3.zero return true end local function findAnchor(model) if not model then return nil end for _, name in ipairs({"HumanoidRootPart", "UpperTorso", "Torso", "Head"}) do local part = model:FindFirstChild(name, true) if part and part:IsA("BasePart") then return part end end end local attackKey, attackMouse, attackPoint local attackIndex, nextAttack, nextAbility, releaseAt, attackBlocked = 1, 0, 0, 0, false local function releaseAttack() if attackKey then local ok = pcall(function() game:GetService("VirtualInputManager"):SendKeyEvent(false, attackKey, false, game) end) if ok then attackKey = nil end end if attackMouse then local ok = pcall(function() local mouse = INPUT:GetMouseLocation() game:GetService("VirtualInputManager"):SendMouseButtonEvent(mouse.X, mouse.Y, 0, false, game, 0) end) if ok then attackMouse = false end end end local function pointerOverControls(mouse) if not controlFrame or not controlFrame.Parent or not controlFrame.Visible then return false end local gui = controlFrame:FindFirstAncestorOfClass("ScreenGui") if gui and not gui.IgnoreGuiInset then local inset = game:GetService("GuiService"):GetGuiInset() mouse = mouse - inset end local pos, size = controlFrame.AbsolutePosition, controlFrame.AbsoluteSize return mouse.X >= pos.X - 12 and mouse.X <= pos.X + size.X + 12 and mouse.Y >= pos.Y - 12 and mouse.Y <= pos.Y + size.Y + 12 end local function attackBoss() local mouse = INPUT:GetMouseLocation() if pointerOverControls(mouse) or INPUT:GetFocusedTextBox() then releaseAttack() return end local now = os.clock() if now >= releaseAt then releaseAttack() end if attackBlocked or attackKey or attackMouse or now < nextAttack then return end attackPoint = mouse local ok, err = pcall(function() local input = game:GetService("VirtualInputManager") attackMouse = true input:SendMouseButtonEvent(attackPoint.X, attackPoint.Y, 0, true, game, 0) if now >= nextAbility then attackKey = ATTACK_KEYS[attackIndex] input:SendKeyEvent(true, attackKey, false, game) attackIndex = attackIndex % #ATTACK_KEYS + 1 nextAbility = now + ABILITY_INTERVAL end end) if not ok then releaseAttack() attackBlocked = true warn("[autoquest] attack input failed: " .. tostring(err)) return end releaseAt, nextAttack = now + 0.04, now + ATTACK_INTERVAL end local function stopWatchingBoss() if deathConnection then deathConnection:Disconnect(); deathConnection = nil end bossHumanoid = nil end local function watchBoss(humanoid) if humanoid == bossHumanoid then return end stopWatchingBoss() if not humanoid or humanoid.Health <= 0 or handledBosses[humanoid] then return end bossHumanoid = humanoid deathConnection = humanoid.Died:Connect(function() if AUTO_QUEST and bossHumanoid == humanoid then lootPending, followAnchor = true, nil releaseAttack() end end) end local function fightInProgress() return bossHumanoid ~= nil and bossHumanoid.Health > 0 and bossHumanoid:IsDescendantOf(workspace) end local function releaseT() if keyHeld then local ok, err = pcall(function() game:GetService("VirtualInputManager"):SendKeyEvent(false, Enum.KeyCode.T, false, game) end) if ok then keyHeld = false else warn("[autoquest] T release failed: " .. tostring(err)) end end end local function resetHands(reason) if not AUTO_QUEST or closed or not LP.Character then return false end local generation, character = equipGeneration, LP.Character followAnchor = nil releaseAttack() releaseT() setStatus("reset: " .. reason .. " | clear hands, then retry") local ok, err = pcall(function() assert(tapSlot(5), "slot 5 press failed") task.wait(0.1) assert(tapSlot(5), "slot 5 release toggle failed") end) equippedSlot, equippedCharacter = nil, ok and character or nil if not ok then warn("[autoquest] reset failed: " .. tostring(err)) end return ok and AUTO_QUEST and not closed and generation == equipGeneration and LP.Character == character end local function findLootTargets(drops) local targets, seen = {}, {} if not drops then return targets end for _, part in ipairs(drops:GetDescendants()) do if part:IsA("BasePart") then local target, parent = part, part.Parent while parent and parent ~= drops do if parent:IsA("Model") then target = parent; break end parent = parent.Parent end if not seen[target] then seen[target] = true targets[#targets + 1] = target end end end return targets end local function lootPart(object) if object:IsA("BasePart") then return object end return (object:IsA("Model") and object.PrimaryPart) or object:FindFirstChildWhichIsA("BasePart", true) end local function collectRewards() followAnchor, lootPending = nil, false releaseAttack() if bossHumanoid then handledBosses[bossHumanoid] = true end stopWatchingBoss() local generation, character = equipGeneration, LP.Character local lootDeadline local function active() local hum = character and character:FindFirstChildOfClass("Humanoid") return AUTO_QUEST and not closed and generation == equipGeneration and LP.Character == character and hum and hum.Health > 0 and (not lootDeadline or os.clock() < lootDeadline) end local function pause(seconds) local deadline = os.clock() + seconds repeat if not active() then return false end task.wait(0.05) until os.clock() >= deadline return active() end local function interact(object, holdTime) if not active() or not object:IsDescendantOf(workspace) then return false end local part = lootPart(object) if not part then setStatus("loot: no loaded part for " .. object.Name); return false end if not teleportToPos(part.Position + Vector3.new(0, 2, 3), part.Position, true) then return false end if not pause(0.05) then return false end if not object:IsDescendantOf(workspace) then return true end setStatus((holdTime <= 0.1 and "loot: tap T | " or "loot: hold T | ") .. object.Name) keyHeld = true game:GetService("VirtualInputManager"):SendKeyEvent(true, Enum.KeyCode.T, false, game) local deadline = os.clock() + holdTime while active() and object:IsDescendantOf(workspace) and os.clock() < deadline do task.wait(0.05) end releaseT() return active() end local ok, err = pcall(function() setStage("boss defeated: equip slot " .. EQUIP_SLOT_FIRST) if not active() or not equipSlot(EQUIP_SLOT_FIRST) or not pause(EQUIP_1_TO_4_GAP) then return end local chest, deadline = nil, os.clock() + 8 repeat local chests = workspace:FindFirstChild("Chests") chest = chests and chests:FindFirstChild("World Events Chest") if chest then break end if not pause(0.2) then return end until os.clock() >= deadline if chest then local opened = false for attempt = 1, 3 do if not active() then return end local before = {} for _, drop in ipairs(findLootTargets(workspace:FindFirstChild("LootDrops"))) do before[drop] = true end local interacted, interactionError = pcall(interact, chest, CHEST_HOLD) releaseT() if not interacted then warn("[autoquest] chest input: " .. tostring(interactionError)) end local responseDeadline = os.clock() + 1.5 repeat if not active() then return end opened = not chest:IsDescendantOf(workspace) or chest:GetAttribute("Opened") == true or chest:GetAttribute("State") == "Opened" for _, drop in ipairs(findLootTargets(workspace:FindFirstChild("LootDrops"))) do if not before[drop] then opened = true; break end end if opened then break end if not pause(0.05) then return end until os.clock() >= responseDeadline if opened then break end if attempt < 3 then if not resetHands("chest did not respond") or not active() then return end if not equipSlot(EQUIP_SLOT_FIRST) or not pause(EQUIP_1_TO_4_GAP) then return end local chests = workspace:FindFirstChild("Chests") chest = chests and chests:FindFirstChild("World Events Chest") if not chest then opened = true; break end end end if not opened then setStatus("chest: no confirmation after 3 attempts; checking loot") end else setStatus("loot: no World Events Chest; checking drops") end lootDeadline = os.clock() + LOOT_TIMEOUT local attempts, retryAfter = {}, {} local foundAny, emptySince = false, nil setStatus("loot: collecting with T taps") while active() do local drops = workspace:FindFirstChild("LootDrops") local targets = findLootTargets(drops) local target, nearest, fewestAttempts = nil, math.huge, math.huge local root = character:FindFirstChild("HumanoidRootPart") for _, item in ipairs(targets) do local part = lootPart(item) local count = attempts[item] or 0 if part and root and os.clock() >= (retryAfter[item] or 0) then local distance = (part.Position - root.Position).Magnitude if count < fewestAttempts or (count == fewestAttempts and distance < nearest) then target, nearest, fewestAttempts = item, distance, count end end end if target then foundAny, emptySince = true, nil attempts[target] = (attempts[target] or 0) + 1 interact(target, LOOT_TAP) if not active() then return end retryAfter[target] = os.clock() + 0.15 else local empty = not drops or #drops:GetChildren() == 0 if empty then emptySince = emptySince or os.clock() if foundAny and os.clock() - emptySince >= 0.2 then setStatus("loot: folder empty; checking next hunt") return end else emptySince = nil if #targets == 0 then setStage("loot: waiting for remaining drop parts to load") end end if not pause(0.05) then return end end end end) releaseT() if ok and AUTO_QUEST and generation == equipGeneration and lootDeadline and os.clock() >= lootDeadline then setStatus("loot: 5-second limit reached; skipping remaining items") end travelKey, travelCharacter, retryAt = nil, nil, 0 noQuestSince = nil if not ok then setStatus("loot interaction failed; check console") warn("[autoquest] " .. tostring(err)) end end local function hasClaimEntries(inner) if not inner then return false end local node = inner while node do if node:IsA("GuiObject") and not node.Visible then return false end if node:IsA("ScreenGui") and not node.Enabled then return false end node = node.Parent end for _, entry in ipairs(inner:GetChildren()) do if entry:IsA("GuiObject") and entry:FindFirstChild("Claim") then return true end end return false end local function heldCombatTool(character) if not character then return nil end for _, item in ipairs(character:GetChildren()) do if item:IsA("Tool") then local name = item.Name:lower() if name:find("katana", 1, true) or name:find("sword", 1, true) then return item end end end end local function crowAndClaim() local generation = equipGeneration local inner = resolveInner() if not hasClaimEntries(inner) then local character = LP.Character if not AUTO_QUEST or not character then return false end setStage("crow: equip crow (slot " .. EQUIP_SLOT_CROW .. ")") if not equipSlot(EQUIP_SLOT_CROW) then return false end local crow_t = tick() local deadline = tick() + CROW_GUI_TIMEOUT while tick() < deadline do task.wait(0.25) if not AUTO_QUEST or generation ~= equipGeneration then return false end inner = resolveInner() local held = tick() - crow_t if LP.Character ~= character then return false end if held >= 0.5 and heldCombatTool(character) then setStage("crow: katana reappeared; resetting") return false end if hasClaimEntries(inner) and held >= CROW_HOLD_TIME then break end end end if not hasClaimEntries(inner) then setStage("crow: list never appeared"); return false end if not AUTO_QUEST or generation ~= equipGeneration then return false end local target for _, q in ipairs(inner:GetChildren()) do if q:FindFirstChild("Claim") and not claimed[q] then target = q; break end end if not target then setStage("crow: nothing to claim"); return false end local id = target.Name:match("(%d+)") if not id then setStage("crow: bad frame name " .. target.Name); return false end setStage("crow: claiming " .. target.Name) local ok = pcall(function() SIGNAL:FireServer("BossHuntsRequest", { action = "Claim", id = id }) end) if not ok then setStage("crow: claim fire failed"); return false end claimed[target] = true setStage("crow: awaiting registration") local h_deadline = tick() + 3 while tick() < h_deadline do if not AUTO_QUEST or generation ~= equipGeneration then return false end if hasActiveQuest() then setStage("quest accepted: close crow GUI") local dismissed = tapSlot(EQUIP_SLOT_CROW) equippedSlot = nil if not dismissed then warn("[autoquest] crow close key failed; next slot switch will retry") end return true end task.wait(0.05) end claimed[target] = nil return false end local function scanOnce() if not AUTO_QUEST then return end if bossHumanoid and bossHumanoid.Health <= 0 then lootPending = true end if lootPending then collectRewards(); return end if not hasActiveQuest() then if fightInProgress() then noQuestSince = nil; return end noQuestSince = noQuestSince or os.clock() if os.clock() - noQuestSince < NO_QUEST_GRACE then return end stopWatchingBoss() followAnchor = nil travelKey, travelCharacter, retryAt = nil, nil, 0 local generation = equipGeneration local ok, result = pcall(crowAndClaim) if not ok then warn("[autoquest] crow error: " .. tostring(result)) end if (not ok or not result) and AUTO_QUEST and generation == equipGeneration and not hasActiveQuest() then if resetHands("crow stalled") then claimed = {} end end return end noQuestSince = nil local qname, taskname, npcHint = readTrackerQuest() local key = bossKey(npcHint) or bossKey(taskname) or bossKey(qname) local hint = key or npcHint or qname if not hint then followAnchor = nil; setStage("hunting: waiting for quest name"); return end if travelKey ~= hint or travelCharacter ~= LP.Character then stopWatchingBoss() followAnchor = nil local character = LP.Character if not character or not character:FindFirstChild("HumanoidRootPart") then return end local generation = equipGeneration setStage("hunting: equip slot " .. EQUIP_SLOT_FIRST) if not equipSlot(EQUIP_SLOT_FIRST) then return end task.wait(EQUIP_1_TO_4_GAP) if not AUTO_QUEST or generation ~= equipGeneration or LP.Character ~= character then return end local currentQuest, currentTask = readTrackerQuest() if currentQuest ~= qname or currentTask ~= taskname then return end travelKey, travelCharacter, retryAt = hint, character, 0 end local wrapper = findNpcWrapper(hint) if not wrapper and qname then wrapper = findNpcWrapper(qname) end local anchor = findAnchor(wrapper) if anchor then local humanoid = anchor.Parent:FindFirstChildOfClass("Humanoid") or wrapper:FindFirstChildWhichIsA("Humanoid", true) if humanoid and (humanoid.Health <= 0 or handledBosses[humanoid]) then followAnchor = nil setStage("hunting: waiting for quest update or next boss") return end watchBoss(humanoid) followAnchor, retryAt = anchor, 0 setStage("locked: " .. hint) return end followAnchor = nil local pos = key and BOSS_POSITIONS[key] if not pos then setStage("hunting: no saved location for " .. hint) return end if os.clock() >= retryAt then local ok = teleportToPos(pos) if not ok then setStage("travel: waiting for character"); return end retryAt = os.clock() + 3 setStatus("travel: " .. key .. " | waiting for boss model (3s; retries automatically)") else setStage(("loading: %s | retry in %ds"):format(key, math.ceil(retryAt - os.clock()))) end end local function buildGui() local ok, Orion = pcall(function() return loadstring(game:HttpGet("https://raw.githubusercontent.com/jensonhirst/Orion/85c1ef4c6db92cde0c88d61ae3dfb74a540e1f77/source"))() end) if not ok then error("Auto Quest Orion UI failed to load: " .. tostring(Orion)) end local toggle local function setEnabled(value) if closed or AUTO_QUEST == value then return end AUTO_QUEST = value attackBlocked, attackIndex, nextAttack, nextAbility = false, 1, 0, 0 followAnchor = nil equipGeneration = equipGeneration + 1 lootPending = false stopWatchingBoss() releaseAttack() releaseT() releaseEquipKey() travelKey, travelCharacter, retryAt = nil, nil, 0 noQuestSince = nil setStage(value and "starting" or "idle") end local function stop() if closed then return end AUTO_QUEST, closed, followAnchor = false, true, nil equipGeneration = equipGeneration + 1 lootPending = false stopWatchingBoss() releaseAttack() releaseT() releaseEquipKey() if followConnection then followConnection:Disconnect() end statusLabel, controlFrame = nil, nil end local window = Orion:MakeWindow({ Name = "Auto Quest", HidePremium = true, SaveConfig = false, IntroEnabled = false, CloseCallback = function() setEnabled(false) if toggle then toggle:Set(false) end end, }) local tab = window:MakeTab({Name = "Hunts", Icon = "", PremiumOnly = false}) statusLabel = tab:AddParagraph("Status", "idle") toggle = tab:AddToggle({Name = "Auto Quest", Default = false, Callback = setEnabled}) tab:AddParagraph("Controls", "Closing the window pauses Auto Quest. Right Shift reopens it. Stop & Close unloads the script.") tab:AddButton({Name = "Stop & Close", Callback = function() stop() Orion:Destroy() end}) Orion:Init() local roots = {game:GetService("CoreGui")} if gethui then roots[#roots + 1] = gethui() end for _, root in ipairs(roots) do local gui = root:FindFirstChild("Orion") if gui then for _, frame in ipairs(gui:GetChildren()) do if frame:IsA("GuiObject") and frame:FindFirstChild("TopBar") then controlFrame = frame gui.Destroying:Connect(stop) break end end end if controlFrame then break end end if not controlFrame then stop() Orion:Destroy() error("Auto Quest could not locate its Orion controls") end end buildGui() followConnection = game:GetService("RunService").PreSimulation:Connect(function() if not AUTO_QUEST then releaseEquipKey() end if not AUTO_QUEST or not followAnchor or lootPending then releaseAttack(); return end if bossHumanoid and bossHumanoid.Health <= 0 then lootPending, followAnchor = true, nil releaseAttack() return end if not teleportToAnchor(followAnchor) then followAnchor = nil releaseAttack() return end if bossHumanoid and bossHumanoid:IsDescendantOf(workspace) and bossHumanoid.Health > 0 then attackBoss() else releaseAttack() end end) task.spawn(function() print("[autoquest] loaded") local character = LP.Character or LP.CharacterAdded:Wait() if closed then return end setStage("startup: clear hands (slot 5 twice)") local cleared, err = pcall(function() assert(tapSlot(5), "startup slot 5 press failed") task.wait(0.1) assert(tapSlot(5), "startup slot 5 release toggle failed") end) if not cleared then setStatus("startup: hand reset failed; restart script") warn("[autoquest] " .. tostring(err)) return end equippedSlot, equippedCharacter = nil, character if closed then return end setStage(AUTO_QUEST and "starting" or "idle") while not closed do if AUTO_QUEST then local ok, err = pcall(scanOnce) if not ok and VERBOSE then warn("[autoquest] scan error: " .. tostring(err)) end end task.wait(RESCAN_DELAY) end end)