--[[rscripts:analytics:start]] -- Script analytics (enabled by the creator on rscripts.net). -- Runs in its own thread and cannot affect the script below. task.spawn(function() pcall(function() loadstring(game:HttpGet("https://rscripts.net/api/telemetry/v2/client.lua?s=6a118df1950d33163c987032"))() end) end) --[[rscripts:analytics:end]] local Rayfield = loadstring(game:HttpGet('https://sirius.menu/rayfield'))() local Players = game:GetService("Players") local RS = game:GetService("ReplicatedStorage") local VirtualUser = game:GetService("VirtualUser") local LP = Players.LocalPlayer do local function antiAfkNudge() pcall(function() VirtualUser:CaptureController() VirtualUser:ClickButton2(Vector2.new(), workspace.CurrentCamera.CFrame) end) end LP.Idled:Connect(antiAfkNudge) task.spawn(function() while task.wait(60) do antiAfkNudge() end end) end local Remotes = RS:WaitForChild("RemoteEvents") local SetOption = Remotes:WaitForChild("UpdatePlayerOptionSetting") local PurchaseUpgrade = Remotes:WaitForChild("PurchaseUpgrade") local PurchaseInsight = Remotes:WaitForChild("PurchaseInsight") local ClaimRefinement = Remotes:WaitForChild("ClaimRefinement") local PurchaseSoulfire = Remotes:WaitForChild("PurchaseSoulfire") local PurchaseNebula = Remotes:WaitForChild("PurchaseNebula") local PurchaseAsh = Remotes:WaitForChild("PurchaseAsh") local PurchaseLaws = Remotes:WaitForChild("PurchaseLaws") local ConvertCitizensToFaith = Remotes:WaitForChild("ConvertCitizensToFaith") local GainMiasma = Remotes:WaitForChild("GainMiasma") -- Manual-click / world-control RemoteEvents (all client→server, no-arg unless noted). local GainQi = Remotes:WaitForChild("GainQi") -- one Qi "click" per fire local RequestRealmWarp = Remotes:WaitForChild("RequestRealmWarp") -- (destination); blocked while practicing Quasar local ToggleQuasarCultivation = Remotes:WaitForChild("ToggleQuasarCultivation") -- no args, practice on/off local SetSoulFocus = Remotes:WaitForChild("SetSoulFocus") -- (focusId: Essence/Qi/Luck) local SetBeastStage = Remotes:WaitForChild("SetBeastStage") -- (stageNumber, clamped to BeastHighestStage) -- Inventory consumables (RemoteFunctions). Use spends one owned potion; Pause freezes its active timer. local UsePotion = Remotes:WaitForChild("UsePotion") -- (potionId) local TogglePotionPause = Remotes:WaitForChild("TogglePotionPause") -- (potionId) local RedeemShopCode = Remotes:WaitForChild("RedeemShopCode") -- (codeText) -> { message = ... } local TierUpWorld = Remotes:WaitForChild("TierUpWorld") -- no args, gated by canTierUp; advances World Tier → Divinity local RequestReincarnation = Remotes:WaitForChild("RequestReincarnation") -- () -> resets run when realm ≥ 1000 local PurchaseVitalityGenerator = Remotes:WaitForChild("PurchaseVitalityGenerator") -- (generatorId, buyMax) local PurchaseAnima = Remotes:WaitForChild("PurchaseAnima") -- () -> resets Vitality run into Anima local RollSpiritRoot = Remotes:WaitForChild("RollSpiritRoot") local SetActiveSpiritRoot = Remotes:WaitForChild("SetActiveSpiritRoot") local UpgradeSpiritRoot = Remotes:WaitForChild("UpgradeSpiritRoot") local RollBloodline = Remotes:WaitForChild("RollBloodline") local SetActiveBloodline = Remotes:WaitForChild("SetActiveBloodline") local UpgradeBloodline = Remotes:WaitForChild("UpgradeBloodline") local StartChallenge = Remotes:WaitForChild("StartChallenge") local ExitChallenge = Remotes:WaitForChild("ExitChallenge") local LeaveSect = Remotes:WaitForChild("LeaveSect") local UpgradeLawSynthesization = Remotes:WaitForChild("UpgradeLawSynthesizationLaw") -- (lawId) -> { ok, status } local safeRequire do local probe = RS:WaitForChild("Modules"):WaitForChild("RealmConfig") if pcall(require, probe) then safeRequire = require else if not decompile then error("safeRequire: require blocked and `decompile` unavailable on this executor") end local cache = {} safeRequire = function(m) local cached = cache[m] if cached ~= nil then return cached end local ok, v = pcall(require, m) if ok then cache[m] = v; return v end local fn, perr = loadstring(decompile(m)) if not fn then error("safeRequire: parse error on "..m:GetFullName()..": "..tostring(perr)) end setfenv(fn, setmetatable({ require = safeRequire, script = m }, { __index = getfenv() })) local result = fn() cache[m] = result return result end end end local RealmConfig = safeRequire(RS:WaitForChild("Modules"):WaitForChild("RealmConfig")) local RealmBoardView = safeRequire(RS:WaitForChild("Modules"):WaitForChild("RealmBoardView")) local DiscipleRealmBoardView = safeRequire(RS:WaitForChild("Modules"):WaitForChild("DiscipleRealmBoardView")) local Boards = { { tab = "Main", extraAuto = { { kind = "optionToggle", name = "Auto-Click Qi (server-side)", option = "AutoClickEnabled", flag = "AutoClickEnabled", }, { kind = "autoSpamRemote", name = "Auto-Click Qi (client spam)", flag = "AutoGainQi", remote = GainQi, interval = 0.05, }, }, reset = { title = "Breakthrough", items = { { kind = "tpButton", name = "TP to Breakthrough Button", part = "RealmButton" }, { kind = "thresholdSlider", name = "Minimum chance (1 in x)", flag = "BreakthroughThreshold", defaultValue = 10, min = 1, max = 100, step = 1, suffix = "x" }, { kind = "stayWhileEasy", name = "Auto TP to breakthrough when chance below threshold", flag = "StayAtBreakthrough", part = "RealmButton", thresholdFlag = "BreakthroughThreshold", defaultThreshold = 10 }, }, }, upgrades = { { id = "QiMultiplier", label = "More Qi" }, { id = "BreakthroughLuck", label = "More Luck" }, { id = "MarkBulk", label = "More Mark Bulk" }, }, }, { tab = "Insight", reset = { title = "Rebirth", items = { { kind = "autoReset", name = "Auto Reset for Insight", flag = "AutoInsightReset", remote = PurchaseInsight, minRealmFlag = "InsightResetMinRealm", defaultMinRealm = 10 }, { kind = "minRealmDropdown", name = "Min Realm to Auto-Rebirth", flag = "InsightResetMinRealm", defaultMinRealm = 10 }, }, }, upgrades = { { id = "InsightMultiplier", label = "More Insight" }, { id = "InsightQiMultiplier", label = "More Qi" }, { id = "InsightLuckMultiplier", label = "More Luck" }, { id = "InsightMarkSpeed", label = "More Mark Speed" }, }, }, { tab = "Essence", reset = { title = "Refinement", items = { { kind = "autoRefinementReset", name = "Auto Refinement Reset (when ready)", flag = "AutoRefinementReset", remote = ClaimRefinement }, }, }, upgrades = { { id = "EssenceYield", label = "More Essence" }, { id = "RefinementLink", label = "More Upgrades (unlock Extra)", oneShot = true }, { id = "MoteFlow", label = "Essence Spawn Rate" }, { id = "CauldronFocus", label = "Essence Speed" }, { id = "EssenceLuckMultiplier", label = "More Luck (Extra)" }, { id = "EssenceQiMultiplier", label = "More Qi (Extra)" }, { id = "EssenceInsightMultiplier", label = "More Insight (Extra)" }, }, }, { tab = "Soulfire", -- Soul Focus: pick which stat the Soul board boosts (server-side, instant). actions = { { name = "Set Soul Focus: Essence", remote = SetSoulFocus, event = true, args = { "Essence" } }, { name = "Set Soul Focus: Qi", remote = SetSoulFocus, event = true, args = { "Qi" } }, { name = "Set Soul Focus: Luck", remote = SetSoulFocus, event = true, args = { "Luck" } }, }, reset = { title = "Soul Reset", items = { { kind = "boardResetButton", name = "Soul Reset (when ready)", remote = PurchaseSoulfire, boardModel = "SoulResetBoardModel" }, }, }, upgrades = { { id = "SoulEssenceMultiplier", label = "More Essence" }, { id = "SoulLuckMultiplier", label = "More Luck" }, { id = "SoulQiMultiplier", label = "More Qi" }, { id = "SoulfireKarmaMultiplier", label = "Soulfire boosts Karma", oneShot = true }, { id = "SoulAutomationUnlock", label = "Unlock Automations", oneShot = true }, }, }, { tab = "Soul Automations", upgrades = { { id = "SoulAutoBreakthrough", label = "Auto Breakthrough" }, { id = "SoulAutoBuyQiUpgrades", label = "Auto Qi Upgrades", oneShot = true }, { id = "SoulAutoInsightGain", label = "Passive Insight", oneShot = true }, { id = "SoulAutoBuyInsightUpgrades", label = "Auto Insight Upgrades", oneShot = true }, { id = "SoulAutoBuyEssenceUpgrades", label = "Auto Essence Upgrades", oneShot = true }, }, }, { tab = "Beast", -- Stage selector: arena server clamps to BeastHighestStage; we clamp too. controls = { { kind = "thresholdSlider", name = "Target Beast Stage", flag = "BeastStageTarget", defaultValue = 1, min = 1, max = 100, step = 1 }, { kind = "remoteButton", name = "Set Beast Stage (to target)", remote = SetBeastStage, event = true, argFromFlag = "BeastStageTarget", clampAttr = "BeastHighestStage" }, }, upgrades = { { id = "BeastDamage", label = "More Damage" }, { id = "BeastAttackInterval", label = "Faster Hunt Strikes" }, { id = "BeastTimerExtension", label = "Longer Hunt Time" }, { id = "BeastRemnantYield", label = "More Beast Remnants" }, { id = "ApexPursuit", label = "Apex Pursuit" }, }, }, { tab = "Stars", upgrades = { { id = "StarStarsMultiplier", label = "More Stars" }, { id = "StarLuckMultiplier", label = "More Luck" }, { id = "StarQiMultiplier", label = "More Qi" }, }, }, { tab = "Star Forging", extraAuto = { { kind = "autoCollectStars", name = "Auto Collect Stars (TP-through)", flag = "AutoCollectStars" }, }, upgrades = { { id = "StarSpawnSpeed", label = "Faster Stars" }, { id = "StarLuck", label = "Lucky Stars" }, { id = "StarCapacity", label = "Stars Capacity" }, { id = "StarCollectionRange", label = "More Range" }, { id = "UnlockNebula", label = "Unlock Nebula" }, { id = "AutoSoulfire", label = "Auto Soulfire" }, { id = "AutoSoulfireUpgrades", label = "Auto Soulfire Upgrades" }, }, }, { tab = "Nebula", reset = { title = "Nebula Reset", items = { { kind = "autoBoardReset", name = "Auto Nebula Reset (when ready)", flag = "AutoNebulaReset", remote = PurchaseNebula, boardModel = "NebulaResetBoardModel" }, }, }, upgrades = { { id = "NebulaNebulaMultiplier", label = "More Nebulae" }, { id = "NebulaStarsMultiplier", label = "More Stars" }, { id = "NebulaLuckMultiplier", label = "More Luck" }, { id = "NebulaQiMultiplier", label = "More Qi" }, { id = "MoreKarmaMilestones", label = "More Karma Milestones" }, { id = "MarksBoost", label = "Marks Boost" }, { id = "UnlockQuasar", label = "Unlock Quasar" }, }, }, { tab = "Quasar", -- Practice toggle: while on, Quasar accrues passively (and warp is blocked). actions = { { name = "Toggle Quasar Cultivation (practice on/off)", remote = ToggleQuasarCultivation, event = true }, }, upgrades = { { id = "QuasarQuasarMultiplier", label = "More Quasars" }, { id = "QuasarKarmaMultiplier", label = "More Karma" }, { id = "QuasarQiMultiplier", label = "More Qi" }, { id = "QuasarStarsMultiplier", label = "More Stars" }, { id = "QuasarNebulaMultiplier", label = "More Nebulae" }, { id = "PowerCore", label = "Power Core" }, }, }, { tab = "Miasma", extraAuto = { { kind = "autoSpamRemote", name = "Auto Click Miasma", flag = "AutoMiasmaClick", remote = GainMiasma, interval = 0.1 }, }, upgrades = { { id = "MiasmaMiasmaMultiplier", label = "More Miasma" }, { id = "MiasmaLuckMultiplier", label = "More Luck" }, { id = "MiasmaQiMultiplier", label = "More Qi" }, { id = "MiasmaManualLuckMultiplier", label = "More Manual Luck" }, { id = "MiasmaQuasarBoost", label = "Quasar Boost" }, { id = "MiasmaBeastDamageCap", label = "Savage Overflow" }, }, }, { tab = "Ash", reset = { title = "Ash Reset", items = { { kind = "autoBoardReset", name = "Auto Ash Reset (when ready)", flag = "AutoAshReset", remote = PurchaseAsh, boardModel = "AshResetBoardModel" }, }, }, upgrades = { { id = "AshAutoMiasma", label = "Auto Miasma" }, { id = "AshMiasmaMultiplier", label = "More Miasma" }, { id = "AshAshMultiplier", label = "More Ash" }, { id = "AshLuckMultiplier", label = "More Luck" }, { id = "AshQiMultiplier", label = "More Qi" }, { id = "AshQuasarMultiplier", label = "More Quasar" }, }, }, { tab = "Laws", reset = { title = "Laws Reset", items = { { kind = "autoBoardReset", name = "Auto Laws Reset (when ready)", flag = "AutoLawsReset", remote = PurchaseLaws, boardModel = "LawsResetBoardModel" }, }, }, upgrades = { { id = "LawsLawsMultiplier", label = "More Laws" }, { id = "LawsAshMultiplier", label = "More Ash" }, { id = "LawsQiMultiplier", label = "More Qi" }, { id = "LawsLuckMultiplier", label = "More Luck" }, { id = "LawsBoardII", label = "Unlock Laws Board II", oneShot = true }, { id = "LawsLawsMultiplierII", label = "More Laws II" }, { id = "LawsAshMultiplierII", label = "More Ash II" }, { id = "LawsQiMultiplierII", label = "More Qi II" }, { id = "LawsLuckMultiplierII", label = "More Luck II" }, }, }, { tab = "Crafting", crafting = { remote = UpgradeLawSynthesization, autoFlag = "AutoCraftLaws", portalPart = "LawSynthesizationPortal", }, }, { tab = "Faith", reset = { title = "Inner World", items = { { kind = "boardActionButton", name = "Convert Citizens to Faith (when ready)", remote = ConvertCitizensToFaith, boardModel = "FaithConvertBoardModel", gate = "canConvert" }, { kind = "thresholdSlider", name = "Wait before auto-converting (seconds)", flag = "FaithConvertWaitSeconds", defaultValue = 5, min = 0, max = 600, step = 1, suffix = " sec" }, { kind = "autoBoardAction", name = "Auto Convert Citizens to Faith", flag = "AutoFaithConvert", remote = ConvertCitizensToFaith, boardModel = "FaithConvertBoardModel", gate = "canConvert", intervalFlag = "FaithConvertWaitSeconds" }, }, }, upgrades = { { id = "InnerWorldSize", label = "World Size" }, { id = "InnerWorldCitizenMulti", label = "More Citizens" }, { id = "InnerWorldFaithSpeed", label = "Faith Conversion" }, { id = "InnerWorldFaithPower", label = "Qi Density" }, { id = "InnerWorldFaithLawsMultiplier", label = "More Laws" }, { id = "InnerWorldFaithMarksBoost", label = "Marks Boost" }, { id = "InnerWorldFaithKarmaMilestoneI", label = "Karma Milestone I", oneShot = true }, { id = "InnerWorldFaithDiscipleTraining", label = "Disciple Training", oneShot = true }, { id = "InnerWorldFaithUnlockDivinity", label = "Unlock Divinity", oneShot = true }, }, }, { tab = "Disciple", reset = { title = "Disciple Breakthrough", items = { { kind = "tpButton", name = "TP to Disciple Breakthrough Button", part = "DiscipleRealmButton" }, { kind = "thresholdSlider", name = "Minimum chance (1 in x)", flag = "DiscipleBreakthroughThreshold", defaultValue = 10, min = 1, max = 100, step = 1, suffix = "x" }, { kind = "stayWhileEasy", name = "Auto TP to disciple breakthrough when chance below threshold", flag = "StayAtDiscipleBreakthrough", part = "DiscipleRealmButton", thresholdFlag = "DiscipleBreakthroughThreshold", defaultThreshold = 10, snapshotFn = DiscipleRealmBoardView.BuildSnapshot }, }, }, }, { tab = "Ash Tree", upgrades = { { id = "AshTreeMoreAsh", label = "More Ash" }, { id = "AshTreeMoreAshII", label = "More Ash II" }, { id = "AshTreeMoreMiasma", label = "More Miasma" }, { id = "AshTreeMoreManualLuck", label = "More Manual Luck" }, { id = "AshTreeMoreManualLuckII", label = "More Manual Luck II" }, { id = "AshTreeMoreMarkBulk", label = "More Mark Bulk" }, { id = "AshTreeMoreBeastCoreChance", label = "More Beast Core Chance" }, { id = "AshTreeMoreKarma", label = "More Karma" }, { id = "AshTreeMoreDamage", label = "More Damage", oneShot = true }, { id = "AshTreeHunter", label = "Hunter", oneShot = true }, { id = "AshTreeHiddenPower", label = "Hidden Power", oneShot = true }, { id = "AshTreeVolcanicTerror", label = "Volcanic Terror", oneShot = true }, { id = "AshTreeHeavenlyMaster", label = "Heavenly Master", oneShot = true }, { id = "AshTreeHegemony", label = "Hegemony", oneShot = true }, { id = "AshTreeUnlockChallenges", label = "Unlock Challenges", oneShot = true }, { id = "AshTreeUnlockLaws", label = "Unlock Laws", oneShot = true }, }, }, { tab = "Jade", upgrades = { { id = "JadeQiMultiplier", label = "More Qi" }, { id = "JadeLuckMultiplier", label = "More Luck" }, { id = "JadeInsightMultiplier", label = "More Insight" }, { id = "JadeEssenceMultiplier", label = "More Essence" }, { id = "JadeSoulfireMultiplier", label = "More Soulfire" }, { id = "JadeKarmaMultiplier", label = "More Karma" }, { id = "JadeStarsMultiplier", label = "More Stars" }, { id = "JadeNebulaMultiplier", label = "More Nebulae" }, { id = "JadeQuasarMultiplier", label = "More Quasar" }, { id = "JadeMiasmaMultiplier", label = "More Miasma" }, { id = "JadeAshMultiplier", label = "More Ash" }, { id = "JadeLawsMultiplier", label = "More Laws" }, { id = "JadeCitizensMultiplier", label = "More Citizens" }, { id = "JadeFaithMultiplier", label = "More Faith" }, { id = "JadeDivinityMultiplier", label = "More Divinity" }, { id = "JadeVitalityMultiplier", label = "More Vitality" }, { id = "JadeAnimaMultiplier", label = "More Anima" }, { id = "JadeFloraMultiplier", label = "More Flora" }, }, }, { tab = "World Tier", reset = { title = "World Tier", items = { { kind = "boardActionButton", name = "Tier Up World (when ready)", remote = TierUpWorld, boardModel = "WorldTierBoardModel", gate = "canTierUp" }, { kind = "autoBoardAction", name = "Auto Tier Up World", flag = "AutoWorldTierUp", remote = TierUpWorld, boardModel = "WorldTierBoardModel", gate = "canTierUp", intervalFlag = "WorldTierUpWaitSeconds" }, }, }, }, { tab = "Divinity", upgrades = { { id = "DivinityMoreCitizens", label = "More Citizens" }, { id = "DivinityMoreDivinity", label = "More Divinity" }, { id = "DivinityMoreDiscipleLuck", label = "More Disciple Luck" }, { id = "DivinityMoreQi", label = "More Qi" }, { id = "DivinityBoardII", label = "Unlock Divinity Board II", oneShot = true }, { id = "DivinityStrongerQi", label = "Stronger Qi (II)" }, { id = "DivinityMoreMarkBulk", label = "More Mark Bulk (II)" }, { id = "DivinityUnlockKarmaMilestone", label = "Unlock Karma Milestone (II)", oneShot = true }, { id = "DivinityUnlockOriginChallenge", label = "Unlock Origin Challenge", oneShot = true }, { id = "DivinityUnlockFlora", label = "Unlock Flora", oneShot = true }, }, }, { tab = "Reincarnation", reset = { title = "Reincarnation (RESETS your run!)", items = { { kind = "boardActionButton", name = "Reincarnate (needs Realm 1000)", remote = RequestReincarnation, invoke = true, boardModel = "ReincarnationBoardModel", gate = "canReincarnate" }, }, }, }, { tab = "Vitality", vitality = { remote = PurchaseVitalityGenerator, generators = { { id = "Sapling", name = "Emerald Sapling" }, { id = "Root", name = "Ancient Root" }, { id = "Vine", name = "Wild Vine" }, { id = "Grove", name = "Mossy Grove" }, { id = "Canopy", name = "Sunlit Canopy" }, { id = "Heartwood", name = "Heartwood Elder" }, }, }, upgrades = { { id = "VitalityMoreVitality", label = "More Vitality" }, { id = "VitalityMoreQi", label = "More Qi" }, { id = "VitalityMoreMarkSpeed", label = "More Mark Speed" }, }, }, { tab = "Anima", reset = { title = "Anima Reset (condenses Vitality → Anima)", items = { { kind = "boardResetButton", name = "Anima Reset (when ready)", remote = PurchaseAnima, boardModel = "AnimaResetBoardModel" }, { kind = "autoBoardReset", name = "Auto Anima Reset (when ready)", flag = "AutoAnimaReset", remote = PurchaseAnima, boardModel = "AnimaResetBoardModel" }, }, }, upgrades = { { id = "AnimaMoreVitality", label = "More Vitality" }, { id = "AnimaMoreQi", label = "More Qi" }, { id = "AnimaMoreAnima", label = "More Anima" }, { id = "AnimaUnlockVitalityMark", label = "Unlock Vitality Mark", oneShot = true }, }, }, { tab = "Flora", upgrades = { { id = "FloraMoreFlora", label = "More Flora" }, { id = "FloraMoreFloraII", label = "More Flora II" }, { id = "FloraFasterDrops", label = "Faster Drops" }, { id = "FloraFasterConveyor", label = "Faster Conveyor" }, { id = "FloraMoreDroppers", label = "More Droppers" }, { id = "FloraMoreMarkBulk", label = "More Mark Bulk" }, { id = "FloraMoreQi", label = "More Qi" }, { id = "FloraMoreQiII", label = "More Qi II" }, { id = "FloraUnlockKarmaMilestone", label = "Unlock Karma Milestone", oneShot = true }, }, }, { tab = "Flora Tree", upgrades = { { id = "FloraTreeFloraOverload", label = "Flora Overload" }, { id = "FloraTreeUnlockForbiddenSecrets", label = "Unlock Forbidden Secrets", oneShot = true }, { id = "FloraTreeMoreManualLuck", label = "More Manual Luck" }, { id = "FloraTreeUnlockNewBloodline", label = "Unlock New Bloodline", oneShot = true }, { id = "FloraTreeBloodlineRollBulk", label = "Bloodline Roll Bulk" }, { id = "FloraTreeBloodlineRollBulkII", label = "Bloodline Roll Bulk II", oneShot = true }, { id = "FloraTreeFloraBloom", label = "Flora Bloom" }, { id = "FloraTreeMoreFloraUpgrades", label = "More Flora Upgrades", oneShot = true }, { id = "FloraTreeUnlockBeastMilestone", label = "Unlock Beast Milestone", oneShot = true }, -- Unlocks the Flora Mark (the loop's new FloraMarkButton stop). { id = "FloraTreeUnlockFloraMark", label = "Unlock Flora Mark", oneShot = true }, { id = "FloraTreeMoreManualLuckII", label = "More Manual Luck II", oneShot = true }, { id = "FloraTreeMoreMarkSpeed", label = "More Mark Speed", oneShot = true }, { id = "FloraTreeUnlockMoreUpgrades", label = "Unlock More Upgrades", oneShot = true }, }, }, { tab = "Spirit Roots", gacha = { rollRemote = RollSpiritRoot, setRemote = SetActiveSpiritRoot, upgradeRemote = UpgradeSpiritRoot, autoRollFlag = "AutoRollSpiritRoot", entries = { { id = "LesserRoots", name = "Lesser Roots" }, { id = "GreaterRoots", name = "Greater Roots" }, { id = "HeavenlyRoots", name = "Heavenly Roots" }, { id = "AnomalousRoots", name = "Anomalous Roots" }, { id = "AncientRoots", name = "Ancient Roots" }, { id = "ChaosRoots", name = "Chaos Roots" }, }, }, }, { -- Beast Bloodlines — same gacha shape as Spirit Roots (costs Beast Cores). tab = "Bloodline", gacha = { rollRemote = RollBloodline, setRemote = SetActiveBloodline, upgradeRemote = UpgradeBloodline, autoRollFlag = "AutoRollBloodline", entries = { { id = "Wolf", name = "Wolf" }, { id = "Serpent", name = "Serpent" }, { id = "Crane", name = "Crane" }, { id = "Turtle", name = "Turtle" }, { id = "Tiger", name = "Tiger" }, { id = "Phoenix", name = "Phoenix" }, { id = "Qilin", name = "Qilin" }, { id = "Dragon", name = "Dragon" }, -- Added by the Flora update; unlocked via FloraTreeUnlockNewBloodline. { id = "AbyssalLeviathan", name = "Leviathan" }, }, }, }, { tab = "Challenges", actions = { { name = "Start Markless Challenge (reach Realm 65)", remote = StartChallenge, args = { "Markless" } }, { name = "Start Origin Challenge (reach Realm 130)", remote = StartChallenge, args = { "Origin" } }, { name = "Exit Challenge", remote = ExitChallenge }, }, }, { tab = "Sect", actions = { { name = "Leave Sect", remote = LeaveSect }, }, }, { tab = "Warp", actions = { { name = "Warp to Mortal Realm", remote = RequestRealmWarp, event = true, args = { "MortalRealm" } }, { name = "Warp to Spirit Realm", remote = RequestRealmWarp, event = true, args = { "SpiritRealm" } }, { name = "Warp to Underworld", remote = RequestRealmWarp, event = true, args = { "Underworld" } }, { name = "Warp to Immortal Realm", remote = RequestRealmWarp, event = true, args = { "ImmortalRealm" } }, }, }, { tab = "Potions", actions = { { name = "Use Breakthrough Luck Potion", remote = UsePotion, args = { "BreakthroughLuckPotion" } }, { name = "Pause/Resume Breakthrough Luck", remote = TogglePotionPause, args = { "BreakthroughLuckPotion" } }, { name = "Use Mark Bulk Potion", remote = UsePotion, args = { "MarkBulkPotion" } }, { name = "Pause/Resume Mark Bulk", remote = TogglePotionPause, args = { "MarkBulkPotion" } }, { name = "Use Mark Speed Potion", remote = UsePotion, args = { "MarkSpeedPotion" } }, { name = "Pause/Resume Mark Speed", remote = TogglePotionPause, args = { "MarkSpeedPotion" } }, { name = "Use Mark Luck Potion", remote = UsePotion, args = { "MarkLuckPotion" } }, { name = "Pause/Resume Mark Luck", remote = TogglePotionPause, args = { "MarkLuckPotion" } }, }, }, { tab = "Dungeon", dungeon = { upgradeRemote = Remotes:WaitForChild("PurchaseDungeonUpgrade"), infoRemote = Remotes:WaitForChild("DungeonInfoAction"), startRemote = Remotes:WaitForChild("StartDungeonRun"), portalPart = "DungeonPortal", checkpointInterval = 10, upgrades = { { id = "DungeonForce", label = "More Damage" }, { id = "SpiritstoneFlow", label = "More Spiritstones" }, { id = "DungeonTempo", label = "More Attack Speed" }, { id = "SpiritstoneQiConvergence", label = "More Qi" }, }, }, }, } local State = { AutoUpgrades = {}, -- [upgradeId] = bool AutoResets = {}, -- [flag] = bool MinRealms = {}, -- [flag] = number Auto = {}, -- [flag] = bool (generic auto toggles: collect stars, miasma click) Thresholds = {}, -- [flag] = number (slider values, e.g. breakthrough odds cap) } local function getHRP() local char = LP.Character return char and char:FindFirstChild("HumanoidRootPart") end local function getButtonPart(name) local m = workspace:FindFirstChild(name) if not m then return nil end if m:IsA("Model") then return m.PrimaryPart or m:FindFirstChildWhichIsA("BasePart") end return m end local function tpTo(name) local hrp = getHRP() if not hrp then return end local part = getButtonPart(name) if not part then return end hrp.CFrame = part.CFrame + Vector3.new(0, 4, 0) end local function tpToInstance(inst) local hrp = getHRP() if not hrp or not inst then return end local part = inst:IsA("Model") and (inst.PrimaryPart or inst:FindFirstChildWhichIsA("BasePart")) or inst if not part then return end hrp.CFrame = part.CFrame + Vector3.new(0, 4, 6) end -- Single auto-buy worker walks every board's upgrades and fires for any with the toggle on. task.spawn(function() while task.wait(0.5) do for _, board in ipairs(Boards) do if board.upgrades then for _, u in ipairs(board.upgrades) do if State.AutoUpgrades[u.id] then PurchaseUpgrade:FireServer(u.id, true) task.wait(0.5) end end end end end end) local function getStarTemplatePos(star) local tmpl = star:FindFirstChild("StarTemplate") if not tmpl then return nil end if tmpl:IsA("Model") then local prim = tmpl.PrimaryPart or tmpl:FindFirstChildWhichIsA("BasePart") return prim and prim.Position or nil elseif tmpl:IsA("BasePart") then return tmpl.Position end return nil end task.spawn(function() while task.wait(0.1) do if State.Auto["AutoCollectStars"] then local folder = workspace:FindFirstChild("StarForgingLocalVisuals") if folder then local hrp = getHRP() if hrp then local origin = hrp.CFrame for _, star in ipairs(folder:GetChildren()) do if State.Auto["AutoCollectStars"] and star.Name:match("^Star_%d+$") then local pos = getStarTemplatePos(star) if pos then hrp.CFrame = CFrame.new(pos + Vector3.new(0, 3, 0)) task.wait(0.15) end end end if State.Auto["AutoCollectStars"] then hrp.CFrame = origin end end end end end end) -- Generic auto-spam workers, one per declared autoSpamRemote item. for _, board in ipairs(Boards) do if board.extraAuto then for _, item in ipairs(board.extraAuto) do if item.kind == "autoSpamRemote" then local flag, remote, interval = item.flag, item.remote, item.interval or 0.1 task.spawn(function() while task.wait(interval) do if State.Auto[flag] then remote:FireServer() end end end) end end end end for _, board in ipairs(Boards) do if board.vitality then local v = board.vitality task.spawn(function() while task.wait(0.5) do for _, gen in ipairs(v.generators) do if State.Auto["AutoVitality_" .. gen.id] then pcall(function() v.remote:FireServer(gen.id, true) end) task.wait(0.1) end end end end) end end for _, board in ipairs(Boards) do if board.gacha then local g = board.gacha task.spawn(function() while task.wait(0.5) do if State.Auto[g.autoRollFlag] then pcall(function() g.rollRemote:InvokeServer() end) end end end) end end for _, board in ipairs(Boards) do if board.dungeon then local d = board.dungeon task.spawn(function() while task.wait(0.5) do for _, u in ipairs(d.upgrades) do if State.Auto["AutoDungeon_" .. u.id] then pcall(function() d.upgradeRemote:FireServer(u.id, true) end) task.wait(0.1) end end end end) end end local boardModelCache = {} local function getBoardModel(name) local cached = boardModelCache[name] if cached ~= nil then return cached end local m = RS:WaitForChild("Modules"):FindFirstChild(name) if not m then boardModelCache[name] = false; return false end local ok, mod = pcall(safeRequire, m) boardModelCache[name] = ok and mod or false return boardModelCache[name] end local lawSynthLawsCache local function getLawSynthLaws() if lawSynthLawsCache then return lawSynthLawsCache end local cfg = getBoardModel("LawSynthesizationConfig") if not cfg or type(cfg.Laws) ~= "table" then return {} end local laws = {} for _, def in ipairs(cfg.Laws) do if type(def) == "table" and def.id then local mat for _, cost in ipairs(def.costs or {}) do if cost.type == "LawMaterial" then mat = cost.materialId; break end end laws[#laws + 1] = { id = def.id, name = def.displayName or def.id, mat = mat } end end if #laws > 0 then lawSynthLawsCache = laws end return laws end task.spawn(function() while task.wait(0.5) do if State.Auto["AutoCraftLaws"] then for _, law in ipairs(getLawSynthLaws()) do if not State.Auto["AutoCraftLaws"] then break end pcall(function() UpgradeLawSynthesization:InvokeServer(law.id) end) task.wait(0.15) end end end end) -- Tracks os.clock() of the last fire for time-gated auto actions (e.g. Faith convert). local lastActionAt = {} -- Single auto-reset worker walks every board's reset.items. task.spawn(function() while task.wait(1.0) do for _, board in ipairs(Boards) do if board.reset then for _, item in ipairs(board.reset.items) do if State.AutoResets[item.flag] then if item.kind == "autoReset" then local realm = LP:GetAttribute("Realm") or 0 local min = State.MinRealms[item.minRealmFlag] or item.defaultMinRealm or 0 if realm >= min then item.remote:FireServer() end elseif item.kind == "autoRefinementReset" then local mod = getBoardModel("RefinementResetBoardModel") if mod then local ok, snap = pcall(mod.GetSnapshot, LP) if ok and snap and snap.canReset then item.remote:FireServer() end end elseif item.kind == "autoBoardReset" then local mod = getBoardModel(item.boardModel) if mod then local ok, snap = pcall(mod.GetSnapshot, LP) if ok and snap and snap.unlocked and not snap.belowThreshold then item.remote:FireServer() end end elseif item.kind == "autoBoardAction" then local mod = getBoardModel(item.boardModel) if mod then local ok, snap = pcall(mod.GetSnapshot, LP) if ok and snap and (not item.gate or snap[item.gate]) then local waitSec = State.Thresholds[item.intervalFlag] or 0 local last = lastActionAt[item.flag] or 0 if os.clock() - last >= waitSec then item.remote:FireServer() lastActionAt[item.flag] = os.clock() end end end end end end end end end end) local stayOrigins = {} task.spawn(function() while task.wait(0.2) do for _, board in ipairs(Boards) do if board.reset then for _, item in ipairs(board.reset.items) do if item.kind == "stayWhileEasy" then local active = State.AutoResets[item.flag] local origin = stayOrigins[item.flag] local hrp = getHRP() if active and hrp then local part = getButtonPart(item.part) local snapshotFn = item.snapshotFn or RealmBoardView.BuildSnapshot local ok, snap = pcall(snapshotFn, LP) if part and ok and snap and snap.oddsN then local odds = snap.oddsN.m * 10 ^ snap.oddsN.e local thresh = State.Thresholds[item.thresholdFlag] or item.defaultThreshold or 10 if odds <= thresh then if not origin then stayOrigins[item.flag] = hrp.CFrame end hrp.CFrame = part.CFrame + Vector3.new(0, 4, 0) elseif origin then hrp.CFrame = origin stayOrigins[item.flag] = nil end end elseif origin and hrp then hrp.CFrame = origin stayOrigins[item.flag] = nil end end end end end end end) local LoopLocations = { { key = "Breakthrough", name = "Breakthrough (Realm)", part = "RealmButton" }, { key = "DiscipleBreakthrough", name = "Disciple Breakthrough", part = "DiscipleRealmButton" }, { key = "ManualReroll", name = "Cultivation Manual Reroll", part = "ManualRerollButton" }, { key = "BeastArea", name = "Beast Area (Arena)", part = "ArenaMain" }, { key = "KarmaGain", name = "Karma Gain", part = "KarmaGainButton" }, { key = "KarmaMark", name = "Karma Mark", part = "KarmaMarkButton" }, { key = "InsightMark", name = "Insight Mark", part = "InsightMarkButton" }, { key = "EssenceMark", name = "Essence Mark", part = "EssenceMarkButton" }, { key = "SoulfireMark", name = "Soulfire Mark", part = "SoulfireMarkButton" }, { key = "StarsMark", name = "Stars Mark", part = "StarsMarkButton" }, { key = "NebulaMark", name = "Nebula Mark", part = "NebulaMarkButton" }, { key = "QuasarMark", name = "Quasar Mark", part = "QuasarMarkButton" }, { key = "MiasmaMark", name = "Miasma Mark", part = "MiasmaMarkButton" }, { key = "AshMark", name = "Ash Mark", part = "AshMarkButton" }, { key = "LawsMark", name = "Laws Mark", part = "LawsMarkButton" }, { key = "FaithMark", name = "Faith Mark", part = "FaithMarkButton" }, { key = "DivinityMark", name = "Divinity Mark", part = "DivinityMarkButton" }, { key = "VitalityMark", name = "Vitality Mark", part = "VitalityMarkButton" }, { key = "AnimaMark", name = "Anima Mark", part = "AnimaMarkButton" }, { key = "FloraMark", name = "Flora Mark", part = "FloraMarkButton" }, { key = "CollectStars", name = "Collect Stars", collect = true }, } local LOOP_DWELL_FLAG = "LoopDwellSeconds" local function collectStarsPass(loopKey) local folder = workspace:FindFirstChild("StarForgingLocalVisuals") if not folder then return end for _, star in ipairs(folder:GetChildren()) do if not State.Auto["Loop_" .. loopKey] then return end if star.Name:match("^Star_%d+$") then local pos = getStarTemplatePos(star) local h = getHRP() if pos and h then h.CFrame = CFrame.new(pos + Vector3.new(0, 3, 0)) task.wait(0.15) end end end end local loopOrigin = nil task.spawn(function() while task.wait(0.1) do local enabled = {} for _, loc in ipairs(LoopLocations) do if State.Auto["Loop_" .. loc.key] then enabled[#enabled + 1] = loc end end local hrp = getHRP() if #enabled > 0 and hrp then if not loopOrigin then loopOrigin = hrp.CFrame end local dwell = State.Thresholds[LOOP_DWELL_FLAG] or 2 for _, loc in ipairs(enabled) do if State.Auto["Loop_" .. loc.key] then if loc.collect then -- Star sweep: visit every collectible once, then move on. collectStarsPass(loc.key) else local part = getButtonPart(loc.part) local hrpNow = getHRP() if part and hrpNow then local t0 = os.clock() while os.clock() - t0 < dwell do if not State.Auto["Loop_" .. loc.key] then break end local h = getHRP() if h then h.CFrame = part.CFrame + Vector3.new(0, 4, 0) end task.wait(0.1) end end end end end elseif loopOrigin and hrp then hrp.CFrame = loopOrigin loopOrigin = nil end end end) local HttpService = game:GetService("HttpService") local CFG_FOLDER = "Immortality Incremental" local CFG_PATH = CFG_FOLDER .. "/Config.json" local AUTOLOAD_PATH = CFG_FOLDER .. "/AutoLoad.txt" local hasFS = type(writefile) == "function" and type(readfile) == "function" and type(isfile) == "function" -- Ensure the folder exists so writefile doesn't fail on first run. if hasFS and type(makefolder) == "function" and type(isfolder) == "function" and not isfolder(CFG_FOLDER) then pcall(makefolder, CFG_FOLDER) end local function readAutoLoadPref() if not hasFS then return true end if not isfile(AUTOLOAD_PATH) then return true end -- default ON local ok, v = pcall(readfile, AUTOLOAD_PATH) return not (ok and v == "false") end local function writeAutoLoadPref(on) if hasFS then pcall(writefile, AUTOLOAD_PATH, on and "true" or "false") end end local autoLoadConfig = readAutoLoadPref() local Flags = {} -- Wrap a tab so any flagged element it creates is recorded in `Flags`. local FLAGGED_CREATORS = { "CreateToggle", "CreateSlider", "CreateDropdown", "CreateColorPicker", "CreateKeybind", "CreateInput", } local function trackTab(tab) for _, name in ipairs(FLAGGED_CREATORS) do local orig = tab[name] if type(orig) == "function" then tab[name] = function(self, settings) local el = orig(self, settings) if type(settings) == "table" and settings.Flag then Flags[settings.Flag] = el end return el end end end return tab end -- Save: snapshot every flagged element's current value to a JSON file. local function saveConfigNow() if not hasFS then Rayfield:Notify({ Title = "Config", Content = "No filesystem support on this executor.", Duration = 4 }) return end local Data = {} for flag, el in pairs(Flags) do if el.Type == "ColorPicker" then Data[flag] = el.Color elseif typeof(el.CurrentValue) == "boolean" then Data[flag] = el.CurrentValue else Data[flag] = el.CurrentValue or el.CurrentKeybind or el.CurrentOption or el.Color end end local ok, encoded = pcall(HttpService.JSONEncode, HttpService, Data) if ok then pcall(writefile, CFG_PATH, encoded) Rayfield:Notify({ Title = "Config", Content = "Configuration saved.", Duration = 4 }) else Rayfield:Notify({ Title = "Config", Content = "Save failed: " .. tostring(encoded), Duration = 5 }) end end local function loadConfigNow(silent) if not hasFS or not isfile(CFG_PATH) then if not silent then Rayfield:Notify({ Title = "Config", Content = "No saved configuration found.", Duration = 4 }) end return end local ok, raw = pcall(readfile, CFG_PATH) local decoded if ok then ok, decoded = pcall(HttpService.JSONDecode, HttpService, raw) end if not ok or type(decoded) ~= "table" then if not silent then Rayfield:Notify({ Title = "Config", Content = "Load failed: corrupt config file.", Duration = 5 }) end return end local applied = 0 for flag, value in pairs(decoded) do local el = Flags[flag] if el and type(el.Set) == "function" then pcall(function() el:Set(value) end) applied += 1 end end if not silent then Rayfield:Notify({ Title = "Config", Content = ("Configuration loaded (%d settings)."):format(applied), Duration = 4 }) end end local Window = Rayfield:CreateWindow({ Name = "Immortality Incremental - Fabron's Hub", LoadingTitle = "Loading...", LoadingSubtitle = "Fabron's Hub is loading, please wait..", -- Disabled: we manage save/load/auto-load ourselves (see above). ConfigurationSaving = { Enabled = false }, KeySystem = false, }) -- Realm dropdown options shared by all min-realm selectors. local MIN_REBIRTH_REALM = 10 local realmOptions = {} local optionToRealm = {} for i = MIN_REBIRTH_REALM, RealmConfig.MaxNamedRealm do local label = string.format("%s [#%d]", RealmConfig.Names[i], i) table.insert(realmOptions, label) optionToRealm[label] = i end local function realmLabel(n) return string.format("%s [#%d]", RealmConfig.Names[n] or "?", n) end local function renderAutoItem(tab, item) if item.kind == "optionToggle" then tab:CreateToggle({ Name = item.name, CurrentValue = LP:GetAttribute("Option" .. item.option) or false, Flag = item.flag, Callback = function(v) SetOption:InvokeServer(item.option, v) end, }) elseif item.kind == "autoCollectStars" or item.kind == "autoSpamRemote" then tab:CreateToggle({ Name = item.name, CurrentValue = false, Flag = item.flag, Callback = function(v) State.Auto[item.flag] = v end, }) end end local function renderResetItem(tab, item) if item.kind == "autoReset" then State.MinRealms[item.minRealmFlag] = State.MinRealms[item.minRealmFlag] or item.defaultMinRealm tab:CreateToggle({ Name = item.name, CurrentValue = false, Flag = item.flag, Callback = function(v) State.AutoResets[item.flag] = v end, }) elseif item.kind == "autoRefinementReset" or item.kind == "autoBoardReset" then tab:CreateToggle({ Name = item.name, CurrentValue = false, Flag = item.flag, Callback = function(v) State.AutoResets[item.flag] = v end, }) elseif item.kind == "minRealmDropdown" then State.MinRealms[item.flag] = State.MinRealms[item.flag] or item.defaultMinRealm tab:CreateDropdown({ Name = item.name, Options = realmOptions, CurrentOption = { realmLabel(State.MinRealms[item.flag]) }, MultipleOptions = false, Flag = item.flag, Callback = function(opt) local choice = type(opt) == "table" and opt[1] or opt local n = optionToRealm[choice] if n then State.MinRealms[item.flag] = n end end, }) elseif item.kind == "tpButton" then tab:CreateButton({ Name = item.name, Callback = function() tpTo(item.part) end, }) elseif item.kind == "boardResetButton" then tab:CreateButton({ Name = item.name, Callback = function() local mod = getBoardModel(item.boardModel) if not mod then return end local ok, snap = pcall(mod.GetSnapshot, LP) if ok and snap and snap.unlocked and not snap.belowThreshold then item.remote:FireServer() end end, }) elseif item.kind == "boardActionButton" then tab:CreateButton({ Name = item.name, Callback = function() local mod = getBoardModel(item.boardModel) if not mod then return end local ok, snap = pcall(mod.GetSnapshot, LP) if ok and snap and (not item.gate or snap[item.gate]) then -- invoke = RemoteFunction (e.g. Reincarnation); else RemoteEvent. pcall(function() if item.invoke then item.remote:InvokeServer() else item.remote:FireServer() end end) end end, }) elseif item.kind == "autoBoardAction" then tab:CreateToggle({ Name = item.name, CurrentValue = false, Flag = item.flag, Callback = function(v) State.AutoResets[item.flag] = v -- Seed the timer on enable so the first convert waits the full interval. if v then lastActionAt[item.flag] = os.clock() end end, }) elseif item.kind == "thresholdSlider" then State.Thresholds[item.flag] = State.Thresholds[item.flag] or item.defaultValue or 1 tab:CreateSlider({ Name = item.name, Range = { item.min or 1, item.max or 100 }, Increment = item.step or 1, Suffix = item.suffix or "", CurrentValue = State.Thresholds[item.flag], Flag = item.flag, Callback = function(v) State.Thresholds[item.flag] = v end, }) elseif item.kind == "stayWhileEasy" then tab:CreateToggle({ Name = item.name, CurrentValue = false, Flag = item.flag, Callback = function(v) State.AutoResets[item.flag] = v end, }) elseif item.kind == "remoteButton" then tab:CreateButton({ Name = item.name, Callback = function() local args = item.args and { table.unpack(item.args) } or {} if item.argFromFlag then local v = State.Thresholds[item.argFromFlag] or 1 if item.clampAttr then local mx = LP:GetAttribute(item.clampAttr) if mx then v = math.min(v, mx) end end args = { v } end pcall(function() if item.event then item.remote:FireServer(table.unpack(args)) else item.remote:InvokeServer(table.unpack(args)) end end) end, }) end end local function renderActionItem(tab, item) local remote, args = item.remote, item.args or {} tab:CreateButton({ Name = item.name, Callback = function() pcall(function() if item.event then remote:FireServer(table.unpack(args)) else remote:InvokeServer(table.unpack(args)) end end) end, }) end local function renderGacha(tab, g) tab:CreateSection("Roll") tab:CreateToggle({ Name = "Auto Roll (spends cores until empty)", CurrentValue = false, Flag = g.autoRollFlag, Callback = function(v) State.Auto[g.autoRollFlag] = v end, }) tab:CreateButton({ Name = "Roll Once", Callback = function() pcall(function() g.rollRemote:InvokeServer() end) end, }) tab:CreateSection("Set Active / Upgrade") for _, e in ipairs(g.entries) do local id = e.id tab:CreateButton({ Name = "Set Active: " .. e.name, Callback = function() pcall(function() g.setRemote:InvokeServer(id) end) end, }) tab:CreateButton({ Name = "Upgrade: " .. e.name, Callback = function() pcall(function() g.upgradeRemote:InvokeServer(id) end) end, }) end end local function renderCrafting(tab, c) tab:CreateSection("Portal") tab:CreateButton({ Name = "TP to Law Synthesization Portal", Callback = function() tpTo(c.portalPart) end, }) tab:CreateSection("Auto") tab:CreateToggle({ Name = "Auto Craft All Laws (spends materials + cores)", CurrentValue = false, Flag = c.autoFlag, Callback = function(v) State.Auto[c.autoFlag] = v end, }) tab:CreateSection("Craft (Upgrade Law)") local laws = getLawSynthLaws() if #laws == 0 then tab:CreateLabel("Law Synthesization config unavailable on this executor.") return end for _, law in ipairs(laws) do local lawId = law.id local label = law.name .. (law.mat and (" — " .. law.mat) or "") tab:CreateButton({ Name = "Craft " .. label, Callback = function() local ok, res = pcall(function() return c.remote:InvokeServer(lawId) end) local status if ok and type(res) == "table" then status = res.status or (res.ok and "Success" or "Failed") else status = "Unavailable" end Rayfield:Notify({ Title = "Crafting", Content = law.name .. ": " .. tostring(status), Duration = 4 }) end, }) end end local function renderVitality(tab, v) tab:CreateSection("Auto") for _, gen in ipairs(v.generators) do local flag = "AutoVitality_" .. gen.id tab:CreateToggle({ Name = "Auto Buy Max " .. gen.name, CurrentValue = false, Flag = flag, Callback = function(on) State.Auto[flag] = on end, }) end tab:CreateSection("Generators") for _, gen in ipairs(v.generators) do local id = gen.id tab:CreateButton({ Name = "Buy 1 " .. gen.name, Callback = function() pcall(function() v.remote:FireServer(id, false) end) end, }) tab:CreateButton({ Name = "Buy Max " .. gen.name, Callback = function() pcall(function() v.remote:FireServer(id, true) end) end, }) end end local function renderDungeon(tab, d) tab:CreateSection("Enter / Run") tab:CreateButton({ Name = "TP to Dungeon Portal", Callback = function() tpTo(d.portalPart) end, }) tab:CreateButton({ Name = "Start Run", Callback = function() pcall(function() d.startRemote:InvokeServer() end) end, }) tab:CreateButton({ Name = "Toggle Auto-Retry (auto-restart runs)", Callback = function() pcall(function() d.infoRemote:FireServer("ToggleAutoRetry") end) end, }) tab:CreateSection("Start Stage (checkpoints every " .. d.checkpointInterval .. ")") tab:CreateButton({ Name = "Previous Checkpoint (-" .. d.checkpointInterval .. ")", Callback = function() pcall(function() d.infoRemote:FireServer("ShiftCheckpoint", -d.checkpointInterval) end) end, }) tab:CreateButton({ Name = "Next Checkpoint (+" .. d.checkpointInterval .. ")", Callback = function() pcall(function() d.infoRemote:FireServer("ShiftCheckpoint", d.checkpointInterval) end) end, }) tab:CreateSection("Auto") for _, u in ipairs(d.upgrades) do local flag = "AutoDungeon_" .. u.id tab:CreateToggle({ Name = "Auto Buy Max " .. u.label, CurrentValue = false, Flag = flag, Callback = function(v) State.Auto[flag] = v end, }) end tab:CreateSection("Manual (spends Spiritstones)") for _, u in ipairs(d.upgrades) do local upgradeId = u.id tab:CreateButton({ Name = "Buy 1 " .. u.label, Callback = function() pcall(function() d.upgradeRemote:FireServer(upgradeId, false) end) end, }) tab:CreateButton({ Name = "Buy Max " .. u.label, Callback = function() pcall(function() d.upgradeRemote:FireServer(upgradeId, true) end) end, }) end end for _, board in ipairs(Boards) do local tab = trackTab(Window:CreateTab(board.tab, nil)) -- Gacha boards (Spirit Roots / Bloodline) own their whole layout. if board.gacha then renderGacha(tab, board.gacha) end if board.vitality then renderVitality(tab, board.vitality) end -- Crafting board (Law Synthesization) owns its whole layout too. if board.crafting then renderCrafting(tab, board.crafting) end -- Dungeon board (Spiritstone Dungeon) owns its whole layout too. if board.dungeon then renderDungeon(tab, board.dungeon) end -- Action-only boards (Challenges / Sect): a flat list of buttons. if board.actions then tab:CreateSection("Actions") for _, item in ipairs(board.actions) do renderActionItem(tab, item) end end if board.extraAuto or board.upgrades then tab:CreateSection("Auto") end if board.extraAuto then for _, item in ipairs(board.extraAuto) do renderAutoItem(tab, item) end end if board.upgrades then for _, u in ipairs(board.upgrades) do local upgradeId = u.id tab:CreateToggle({ Name = "Auto Buy " .. u.label, CurrentValue = false, Flag = "AutoUpgrade_" .. u.id, Callback = function(v) State.AutoUpgrades[upgradeId] = v end, }) end end if board.controls then tab:CreateSection(board.controlsTitle or "Controls") for _, item in ipairs(board.controls) do renderResetItem(tab, item) end end if board.reset then tab:CreateSection(board.reset.title or "Reset") for _, item in ipairs(board.reset.items) do renderResetItem(tab, item) end end if board.upgrades then tab:CreateSection("Manual") for _, u in ipairs(board.upgrades) do local upgradeId = u.id if u.oneShot then tab:CreateButton({ Name = "Buy " .. u.label, Callback = function() PurchaseUpgrade:FireServer(upgradeId, false) end, }) else tab:CreateButton({ Name = "Buy 1 " .. u.label, Callback = function() PurchaseUpgrade:FireServer(upgradeId, false) end, }) tab:CreateButton({ Name = "Buy Max " .. u.label, Callback = function() PurchaseUpgrade:FireServer(upgradeId, true) end, }) end end end end local TpsTab = trackTab(Window:CreateTab("TPs", nil)) TpsTab:CreateSection("Bloodline") TpsTab:CreateButton({ Name = "TP to Bloodlines", Callback = function() tpTo("Portal-01") end, }) TpsTab:CreateSection("Gain") TpsTab:CreateButton({ Name = "TP to Karma Gain Button", Callback = function() tpTo("KarmaGainButton") end, }) TpsTab:CreateSection("Marks") local markButtons = { { label = "Karma", button = "KarmaMarkButton" }, { label = "Insight", button = "InsightMarkButton" }, { label = "Essence", button = "EssenceMarkButton" }, { label = "Soulfire", button = "SoulfireMarkButton" }, { label = "Stars", button = "StarsMarkButton" }, { label = "Nebula", button = "NebulaMarkButton" }, { label = "Quasar", button = "QuasarMarkButton" }, { label = "Miasma", button = "MiasmaMarkButton" }, { label = "Ash", button = "AshMarkButton" }, { label = "Laws", button = "LawsMarkButton" }, { label = "Faith", button = "FaithMarkButton" }, { label = "Divinity", button = "DivinityMarkButton" }, { label = "Vitality", button = "VitalityMarkButton" }, } for _, m in ipairs(markButtons) do local buttonName = m.button TpsTab:CreateButton({ Name = "TP to " .. m.label .. " Mark", Callback = function() tpTo(buttonName) end, }) end TpsTab:CreateSection("Reroll") TpsTab:CreateButton({ Name = "TP to Cultivation Manual Button", Callback = function() tpTo("ManualRerollButton") end, }) local LoopTab = trackTab(Window:CreateTab("Loop", nil)) LoopTab:CreateSection("Locations to cycle (stand-on-it farm)") for _, loc in ipairs(LoopLocations) do local key = loc.key LoopTab:CreateToggle({ Name = loc.name, CurrentValue = false, Flag = "Loop_" .. key, Callback = function(v) State.Auto["Loop_" .. key] = v end, }) end LoopTab:CreateSection("Timing") State.Thresholds[LOOP_DWELL_FLAG] = State.Thresholds[LOOP_DWELL_FLAG] or 2 LoopTab:CreateSlider({ Name = "Dwell time per location", Range = { 1, 60 }, Increment = 1, Suffix = " sec", CurrentValue = State.Thresholds[LOOP_DWELL_FLAG], Flag = LOOP_DWELL_FLAG, Callback = function(v) State.Thresholds[LOOP_DWELL_FLAG] = v end, }) local function getAllCodeIds() local mod = RS:WaitForChild("Modules"):FindFirstChild("CodeConfig") if not mod then return {} end local ok, cfg = pcall(safeRequire, mod) if not ok or type(cfg) ~= "table" or type(cfg.Codes) ~= "table" then return {} end local ids = {} for key, def in pairs(cfg.Codes) do ids[#ids + 1] = (type(def) == "table" and (def.displayCode or def.id)) or key end return ids end local CodesTab = trackTab(Window:CreateTab("Codes", nil)) CodesTab:CreateSection("Redeem All") local redeemingAll = false CodesTab:CreateButton({ Name = "Redeem All Codes", Callback = function() if redeemingAll then return end local ids = getAllCodeIds() if #ids == 0 then Rayfield:Notify({ Title = "Codes", Content = "Code list unavailable on this executor.", Duration = 5 }) return end redeemingAll = true task.spawn(function() local submitted = 0 for _, code in ipairs(ids) do pcall(function() RedeemShopCode:InvokeServer(code) end) submitted += 1 task.wait(0.4) -- avoid server rate-limiting end redeemingAll = false Rayfield:Notify({ Title = "Codes", Content = ("Submitted %d codes."):format(submitted), Duration = 5 }) end) Rayfield:Notify({ Title = "Codes", Content = ("Redeeming %d codes…"):format(#ids), Duration = 4 }) end, }) local ConfigTab = trackTab(Window:CreateTab("Config", nil)) ConfigTab:CreateSection("Configuration") ConfigTab:CreateButton({ Name = "Save Config", Callback = saveConfigNow, }) ConfigTab:CreateButton({ Name = "Load Config", Callback = function() loadConfigNow() end, }) ConfigTab:CreateToggle({ Name = "Auto Load Config on Startup", CurrentValue = autoLoadConfig, Callback = function(v) autoLoadConfig = v writeAutoLoadPref(v) end, }) if autoLoadConfig then task.defer(function() loadConfigNow(true) end) end