-- [[ Rscripts Risk Notice ]] -- This script is not verified by rscripts.net. Deal with caution. -- -- Stay safe: -- • Never log in on unofficial Roblox sites or lookalike domains. -- • Real Roblox links use roblox.com (check the .com ending). -- • Treat fake Roblox login / "claim reward" pages as phishing. -- [[ End Rscripts Risk Notice ]] --[[ ============================================================================== Depth Incremental [World 1 & 2] Modules: 1. Catch the Lightning Auto-Farm 2. All 6 Merchants Auto-Buy 3. Pet Egg Auto-Hatch + Inventory & Egg Auto-Shiny + Inventory & Egg Auto-Rainbow Developer: Noliar ============================================================================== ]] -- [0] Single-Instance Teardown Guard & Orphan Purge if getgenv().Ritmada_DepthSuite_Loaded then if typeof(getgenv().Ritmada_DepthSuite_Cleanup) == "function" then pcall(getgenv().Ritmada_DepthSuite_Cleanup) end end if getgenv().Ritmada_LightningFarm_Cleanup and typeof(getgenv().Ritmada_LightningFarm_Cleanup) == "function" then pcall(getgenv().Ritmada_LightningFarm_Cleanup) end getgenv().Ritmada_DepthSuite_Loaded = true -- [1] Core Services & Game Modules local Players = game:GetService("Players") local RunService = game:GetService("RunService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local CollectionService = game:GetService("CollectionService") local TweenService = game:GetService("TweenService") local VirtualUser = game:GetService("VirtualUser") local LocalPlayer = Players.LocalPlayer local PitConfig = require(ReplicatedStorage:WaitForChild("PitConfig", 10)) local PetConfig = require(ReplicatedStorage:WaitForChild("PetConfig", 10)) local PitRemotes = ReplicatedStorage:WaitForChild("PitRemotes", 10) local W2LightningRemote = PitRemotes:WaitForChild("W2Lightning", 10) local TeleportRemote = PitRemotes:WaitForChild("Teleport", 10) local MerchantBuyRemote = PitRemotes:WaitForChild("MerchantBuy", 10) local MerchantStockRemote = PitRemotes:WaitForChild("MerchantStock", 10) local MerchantSyncRemote = PitRemotes:WaitForChild("MerchantSync", 10) local W2HatchRemote = PitRemotes:WaitForChild("W2Hatch", 10) local W2HatchResultRemote = PitRemotes:WaitForChild("W2HatchResult", 10) local RevealDoneRemote = PitRemotes:WaitForChild("RevealDone", 10) local W2ShinyCraftRemote = PitRemotes:WaitForChild("W2ShinyCraft", 10) local W2ShinyCraftResultRemote = PitRemotes:WaitForChild("W2ShinyCraftResult", 10) local W2RainbowCraftRemote = PitRemotes:WaitForChild("W2RainbowCraft", 10) local W2RainbowCraftResultRemote = PitRemotes:WaitForChild("W2RainbowCraftResult", 10) -- Purge orphaned anonymous connections from prior runs if getconnections then local signals = { W2LightningRemote.OnClientEvent, MerchantStockRemote.OnClientEvent, W2HatchResultRemote.OnClientEvent, W2ShinyCraftResultRemote.OnClientEvent, W2RainbowCraftResultRemote.OnClientEvent, LocalPlayer.AttributeChanged, } for _, sig in ipairs(signals) do pcall(function() for _, conn in ipairs(getconnections(sig)) do if conn.Function and debug.info(conn.Function, "s") == "" then conn:Disconnect() end end end) end end -- [2] Game Constants & Dynamic Catalogs local LIGHTNING_ROOM = "W2CatchLightning" local BANK_PAD_POS = Vector3.new(50095.44, -2776.5, -82.05) local STRIKE_ZONE_CENTER = Vector3.new(50150.0, -2776.5, -55.0) local SHINY_PAD_FALLBACK = Vector3.new(49912.30, -583.0, 51.43) local RAINBOW_PAD_FALLBACK = Vector3.new(49948.57, -2036.0, -114.5) local MERCHANTS = { { key = "Trading", title = "Merchant (W1)", M = PitConfig.Merchant, list = PitConfig.MerchantList }, { key = "Ice", title = "Ice Merchant (W1)", M = PitConfig.IceMerchant, list = PitConfig.IceMerchantList }, { key = "Pirate", title = "The Smuggler (W1)", M = PitConfig.PirateMerchant, list = PitConfig.PirateMerchantList }, { key = "Core", title = "The Core Broker (W1)", M = PitConfig.CoreMerchant, list = PitConfig.CoreMerchantList }, { key = "Toy", title = "The Toy Soldier (W2)", M = PitConfig.ToyMerchant, list = PitConfig.ToyMerchantList }, { key = "Bakery", title = "The Bakery Merchant (W2)", M = PitConfig.BakeryMerchant, list = PitConfig.BakeryMerchantList }, } local MERCHANT_BY_KEY = {} local MERCHANT_LABEL_TO_KEY = {} local MERCHANT_LABELS = {} local ALL_MERCHANT_ITEM_LABELS = {} local MERCHANT_LABEL_TO_ITEM_ID = {} for _, md in ipairs(MERCHANTS) do MERCHANT_BY_KEY[md.key] = md MERCHANT_LABEL_TO_KEY[md.title] = md.key table.insert(MERCHANT_LABELS, md.title) for _, it in ipairs(md.list or {}) do local label = string.format("[%s | %s] %s", md.key, it.rarity, it.name) table.insert(ALL_MERCHANT_ITEM_LABELS, label) MERCHANT_LABEL_TO_ITEM_ID[label] = it.id end end local MERCHANT_RARITIES = PitConfig.MerchantRarityOrder or { "Common", "Uncommon", "Rare", "Epic", "Legendary", "Mythic", "Godly" } -- Dynamic Egg & Pet Catalog from PetConfig local EGG_LABELS = {} local EGG_LABEL_TO_ID = {} local DEFAULT_BEST_EGG_ID = PetConfig.EGG_ORDER[#PetConfig.EGG_ORDER] or "TempestEgg" local DEFAULT_BEST_EGG_LABEL = nil for _, eggId in ipairs(PetConfig.EGG_ORDER or {}) do local edef = PetConfig.EGGS[eggId] if edef then local label = edef.name or eggId table.insert(EGG_LABELS, label) EGG_LABEL_TO_ID[label] = eggId if eggId == DEFAULT_BEST_EGG_ID then DEFAULT_BEST_EGG_LABEL = label end end end local function getEggPetCatalog(eggId) local edef = PetConfig.EGGS[eggId] local labels = {} local labelToId = {} if edef then for _, entry in ipairs(edef.pets or edef.pool or {}) do local pid = type(entry) == "table" and (entry.id or entry[1]) or entry local pdef = PetConfig.PETS[pid] if pdef then local lbl = string.format("[%s] %s", pdef.rarity or "?", pdef.name or pid) table.insert(labels, lbl) labelToId[lbl] = pid end end end return labels, labelToId end -- [3] Reactive Configuration & Runtime State local config = { -- Lightning Farm lightningEnabled = false, movementMode = "Walk (Humanoid)", -- "Walk (Humanoid)", "Instant (CFrame)", "Smooth (Tween)" walkSpeed = 40, centerSnap = true, autoBank = true, bankThreshold = 110, -- Merchants merchantEnabled = false, merchantBuyMode = "By Rarity", -- "By Rarity" | "Specific Items Only" | "Rarity + Specific" merchantShops = { "Trading", "Ice", "Pirate", "Core", "Toy", "Bakery" }, merchantRarities = { "Epic", "Legendary", "Mythic", "Godly" }, merchantSpecificIds = {}, -- Pets / Eggs / Shiny / Rainbow petFarmEnabled = false, selectedEggId = DEFAULT_BEST_EGG_ID, craftScope = "Entire Inventory (All Pets)", -- "Entire Inventory (All Pets)" | "Selected Egg Only" | "Specific Target Pet(s)" selectedPetIds = {}, petsPerCraft = 8, -- 8 * 12.5% = 100% guaranteed Shiny & Rainbow autoShiny = true, autoRainbow = true, suppressHatchUI = true, -- Safety noclip = true, antiAfk = true, } local runtime = { alive = true, isBanking = false, merchantBusy = false, petStepBusy = false, merchantStocks = {}, lastRestockBucket = -1, totalCaught = 0, totalDeposited = 0, totalMerchantBuys = 0, totalHatches = 0, totalShinyCrafted = 0, totalRainbowCrafted = 0, originalWalkSpeed = 16, hatchPending = false, lastHatchResult = nil, } local connections = {} local logQueue = {} local pendingTagUpdate = false local pendingStatsSync = false local console local statusTag -- [3B] Session Tracker (Fresh Session Created on Every Execution) local session = { startedAt = os.date("%X"), startedClock = os.clock(), merchant = { Common = 0, Uncommon = 0, Rare = 0, Epic = 0, Legendary = 0, Mythic = 0, Godly = 0, Total = 0, }, hatch = { Common = 0, Uncommon = 0, Rare = 0, Epic = 0, Legendary = 0, Secret = 0, Exclusive = 0, Total = 0, }, crafted = { Shiny = 0, Rainbow = 0, }, } -- Snapshot current merchant item levels at session boot so only new purchases count local merchSnapshot = {} for itemId in pairs(PitConfig.MerchantById or {}) do merchSnapshot[itemId] = LocalPlayer:GetAttribute("Merch_" .. itemId) or 0 end local statWidgets = { merchant = {}, hatch = {}, crafted = {}, } local function logTelemetry(msg) table.insert(logQueue, string.format("[%s] %s", os.date("%X"), tostring(msg))) end local function updateTag() pendingTagUpdate = true end local function syncSessionStats() pendingStatsSync = true end local function resetSessionStats() session.startedAt = os.date("%X") session.startedClock = os.clock() for k in pairs(session.merchant) do session.merchant[k] = 0 end for k in pairs(session.hatch) do session.hatch[k] = 0 end session.crafted.Shiny = 0 session.crafted.Rainbow = 0 for itemId in pairs(PitConfig.MerchantById or {}) do merchSnapshot[itemId] = LocalPlayer:GetAttribute("Merch_" .. itemId) or 0 end syncSessionStats() logTelemetry("[SESSION] All session counters reset at " .. session.startedAt) end -- [4] Core Helpers & Exact Floor-Safe Positioning local function getRootPart() local char = LocalPlayer.Character return char and char:FindFirstChild("HumanoidRootPart") end local function getHumanoid() local char = LocalPlayer.Character return char and char:FindFirstChildOfClass("Humanoid") end local function getMeterCap() local ok, cap = pcall(function() return PitConfig.MeterCap(LocalPlayer) end) if ok and type(cap) == "number" and cap > 0 then return cap end return 110 end local function getBoltMeter() return LocalPlayer:GetAttribute("BoltMeter") or 0 end local function getTotalBolts() return LocalPlayer:GetAttribute("Bolts") or 0 end local function isRoomUnlocked(roomName) if not roomName then return true end return LocalPlayer:GetAttribute("Room_" .. roomName) == true end -- Computes exact floor-level position right in front of any W2EggStand (handles both +Z and -Z facing rooms) local function getEggStandFrontPos(eggId) for _, inst in ipairs(CollectionService:GetTagged("W2EggStand")) do if inst:GetAttribute("EggId") == eggId then local plate = inst:FindFirstChild("PricePlate") local base = inst:FindFirstChild("Base") or inst:FindFirstChild("Frosting") or inst:FindFirstChild("Pedestal") local anchor = inst:FindFirstChild("EggAnchor") if plate and plate:IsA("BasePart") then local front = plate.Position + plate.CFrame.LookVector * 6 local floorY = (base and base:IsA("BasePart")) and (base.Position.Y + 3) or (anchor and anchor:IsA("BasePart")) and (anchor.Position.Y - 4) or (plate.Position.Y - 2) return Vector3.new(front.X, floorY, front.Z), anchor and anchor.Position or plate.Position end local pivotPos = inst:GetPivot().Position return Vector3.new(pivotPos.X, pivotPos.Y - 12, pivotPos.Z + 6), pivotPos end end return nil, nil end -- Computes exact circle center inside ShinyPad / RainbowPad Zone so the machine modal & server reach trigger cleanly local function getMachinePadPos(tagName, fallbackPos) for _, inst in ipairs(CollectionService:GetTagged(tagName)) do local zone = inst:FindFirstChild("Zone") if zone and zone:IsA("BasePart") then return Vector3.new(zone.Position.X, zone.Position.Y + 3, zone.Position.Z) end local piv = inst:GetPivot().Position return Vector3.new(piv.X, piv.Y + 3, piv.Z) end return fallbackPos end -- Reliable cross-world / same-world server teleport + exact coordinate lock local function teleportToRoomAndPos(roomName, targetPosFnOrVec) local root = getRootPart() local oldPos = root and root.Position if roomName and TeleportRemote then TeleportRemote:FireServer(roomName) -- Wait dynamically for server teleport to shift character & stream room local t0 = os.clock() while (os.clock() - t0) < 1.2 do local cur = getRootPart() if cur and oldPos and (cur.Position - oldPos).Magnitude > 25 then break end task.wait(0.08) end task.wait(0.35) end local finalPos = typeof(targetPosFnOrVec) == "function" and targetPosFnOrVec() or targetPosFnOrVec root = getRootPart() if root and finalPos then root.AssemblyLinearVelocity = Vector3.zero root.CFrame = CFrame.new(finalPos) task.wait(0.22) end end local function moveToPosition(targetPosition, onComplete) local root = getRootPart() local humanoid = getHumanoid() if not root or not humanoid then return end local targetV3 = Vector3.new(targetPosition.X, root.Position.Y, targetPosition.Z) if config.movementMode == "Instant (CFrame)" then root.CFrame = CFrame.new(targetV3) if onComplete then onComplete() end elseif config.movementMode == "Smooth (Tween)" then local distance = (root.Position - targetV3).Magnitude local duration = math.clamp(distance / math.max(config.walkSpeed, 16), 0.1, 1.1) local tween = TweenService:Create(root, TweenInfo.new(duration, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), { CFrame = CFrame.new(targetV3) }) tween:Play() task.delay(duration, function() if onComplete then onComplete() end end) else humanoid.WalkSpeed = config.walkSpeed humanoid:MoveTo(targetV3) task.spawn(function() local startTime = os.clock() while runtime.alive and not runtime.merchantBusy do local curRoot = getRootPart() if not curRoot then break end if (curRoot.Position - targetV3).Magnitude <= 2.5 then break end if (os.clock() - startTime) >= 1.8 then break end task.wait(0.03) end if not runtime.merchantBusy and config.centerSnap then local curRoot = getRootPart() if curRoot then curRoot.CFrame = CFrame.new(targetV3) end end if onComplete then onComplete() end end) end end -- Elevated UI Dispatcher Pump (runs on identity-8 executor thread so identity-2 RemoteEvent callbacks never touch CoreGui) local function startUiPump() task.spawn(function() while runtime.alive do if #logQueue > 0 and console then local batch = logQueue logQueue = {} for _, line in ipairs(batch) do pcall(function() console:Append(line) end) end end if pendingTagUpdate and statusTag then pendingTagUpdate = false pcall(function() if runtime.merchantBusy then statusTag:Set({ text = "MERCHANT BUY", color = Color3.fromRGB(255, 190, 50) }) elseif runtime.isBanking then statusTag:Set({ text = "BANKING BOLTS", color = Color3.fromRGB(240, 150, 40) }) elseif config.petFarmEnabled then statusTag:Set({ text = "PET FARM LOOP", color = Color3.fromRGB(160, 110, 255) }) elseif config.lightningEnabled then statusTag:Set({ text = "LIGHTNING FARM", color = Color3.fromRGB(0, 200, 115) }) elseif config.merchantEnabled then statusTag:Set({ text = "MERCHANT WATCH", color = Color3.fromRGB(80, 175, 255) }) else statusTag:Set({ text = "IDLE", color = Color3.fromRGB(160, 165, 180) }) end end) end if pendingStatsSync then pendingStatsSync = false for rarity, widget in pairs(statWidgets.merchant) do local val = session.merchant[rarity] or 0 pcall(function() widget:Set(val) end) end for rarity, widget in pairs(statWidgets.hatch) do local val = session.hatch[rarity] or 0 pcall(function() widget:Set(val) end) end if statWidgets.crafted.Shiny then pcall(function() statWidgets.crafted.Shiny:Set(session.crafted.Shiny) end) end if statWidgets.crafted.Rainbow then pcall(function() statWidgets.crafted.Rainbow:Set(session.crafted.Rainbow) end) end end task.wait(0.08) end end) end -- [5] Subsystem A: Lightning Banking & Recovery local function ensureInLightningRoom() local root = getRootPart() if not root then return end if (root.Position - STRIKE_ZONE_CENTER).Magnitude > 180 then if logTelemetry then logTelemetry("[LIGHTNING] Returning to Catch the Lightning room...") end teleportToRoomAndPos(LIGHTNING_ROOM, STRIKE_ZONE_CENTER) end end local function performBankDeposit() if runtime.isBanking or runtime.merchantBusy then return end runtime.isBanking = true updateTag() if logTelemetry then logTelemetry(string.format("[BANK] Charge threshold reached (%.1f / %d). Heading to Star Deposit Pad...", getBoltMeter(), config.bankThreshold)) end ensureInLightningRoom() moveToPosition(BANK_PAD_POS, function() local root = getRootPart() if root and not runtime.merchantBusy then root.CFrame = CFrame.new(BANK_PAD_POS) end end) task.spawn(function() local waitStart = os.clock() while runtime.alive and not runtime.merchantBusy and getBoltMeter() > 0 and (os.clock() - waitStart) < 3.5 do local root = getRootPart() if root and (root.Position - BANK_PAD_POS).Magnitude > 3 then root.CFrame = CFrame.new(BANK_PAD_POS) end task.wait(0.1) end if getBoltMeter() == 0 then runtime.totalDeposited += 1 if logTelemetry then logTelemetry(string.format("[BANKED] Deposit complete! Total Bolts: %s", PitConfig.Short(getTotalBolts()))) end end runtime.isBanking = false updateTag() if config.lightningEnabled and not runtime.merchantBusy then moveToPosition(STRIKE_ZONE_CENTER) end end) end -- [6] Subsystem B: 6-Merchant Auto-Buy Engine (Synchronized with Lightning & Pet Farm) local function setContains(list, value) for _, v in ipairs(list) do if v == value then return true end end return false end local function shouldBuyMerchantItem(itemDef) local byRarity = setContains(config.merchantRarities, itemDef.rarity) local bySpecific = setContains(config.merchantSpecificIds, itemDef.id) if config.merchantBuyMode == "By Rarity" then return byRarity elseif config.merchantBuyMode == "Specific Items Only" then return bySpecific else return byRarity or bySpecific end end local function getPendingMerchantPurchases() local plan = {} for _, md in ipairs(MERCHANTS) do if setContains(config.merchantShops, md.key) and isRoomUnlocked(md.M.ROOM) then local stockTbl = runtime.merchantStocks[md.key] if type(stockTbl) == "table" then local currency = md.M.CURRENCY or "Cash" local balance = LocalPlayer:GetAttribute(currency) or 0 local itemsToBuy = {} for _, it in ipairs(md.list or {}) do local stockCount = stockTbl[it.id] or 0 if stockCount > 0 and shouldBuyMerchantItem(it) then local owned = LocalPlayer:GetAttribute("Merch_" .. it.id) or 0 if owned < it.max then local cost = PitConfig.MerchantCost(it.id, owned) if cost <= balance then table.insert(itemsToBuy, { id = it.id, name = it.name, rarity = it.rarity, stock = stockCount, max = it.max, currency = currency, }) end end end end if #itemsToBuy > 0 then table.insert(plan, { merchant = md, items = itemsToBuy }) end end end end return plan end local function runMerchantSweep(forceRun) if runtime.merchantBusy then return end if not forceRun and not config.merchantEnabled then return end local plan = getPendingMerchantPurchases() if #plan == 0 then if forceRun and logTelemetry then logTelemetry("[MERCHANT] Sweep scanned all selected shops — no matching affordable stock right now.") end return end -- Priority lock pauses Lightning & Pet Farm loops cleanly runtime.merchantBusy = true updateTag() -- Wait briefly if Pet Farm is mid-packet (hatch/craft) for clean handoff local waitPet = os.clock() while runtime.petStepBusy and (os.clock() - waitPet) < 2.0 do task.wait(0.05) end local wasLightning = config.lightningEnabled local wasPetFarm = config.petFarmEnabled local savedRoot = getRootPart() local savedCFrame = savedRoot and savedRoot.CFrame if logTelemetry then logTelemetry(string.format("[MERCHANT] Priority sync interrupt! Visiting %d shop(s) with wanted stock...", #plan)) end for _, entry in ipairs(plan) do if not runtime.alive then break end local md = entry.merchant local targetPos = md.M.POS + Vector3.new(0, 2, 0) if logTelemetry then logTelemetry(string.format("[MERCHANT] Travelling to %s (%s)...", md.title, md.M.ROOM)) end teleportToRoomAndPos(md.M.ROOM, targetPos) for _, item in ipairs(entry.items) do if not runtime.alive then break end local attempts = 0 while attempts < item.stock and attempts < 10 do local owned = LocalPlayer:GetAttribute("Merch_" .. item.id) or 0 local curStock = (runtime.merchantStocks[md.key] and runtime.merchantStocks[md.key][item.id]) or 0 local balance = LocalPlayer:GetAttribute(item.currency) or 0 local cost = PitConfig.MerchantCost(item.id, owned) if owned >= item.max or curStock <= 0 or cost > balance then break end MerchantBuyRemote:FireServer(item.id) attempts += 1 runtime.totalMerchantBuys += 1 if logTelemetry then logTelemetry(string.format("[MERCHANT BUY] %s (%s) — Lvl %d/%d @ %s", item.name, item.rarity, owned + 1, item.max, md.key)) end task.wait(0.24) end end end -- Synchronized return directly back to active farm if wasLightning then if logTelemetry then logTelemetry("[MERCHANT] Purchases finished. Returning to Catch the Lightning farm...") end teleportToRoomAndPos(LIGHTNING_ROOM, STRIKE_ZONE_CENTER) elseif wasPetFarm then local edef = PetConfig.EGGS[config.selectedEggId] if edef then if logTelemetry then logTelemetry("[MERCHANT] Purchases finished. Returning to " .. (edef.name or config.selectedEggId) .. " stand...") end teleportToRoomAndPos(edef.room, function() local frontPos = getEggStandFrontPos(config.selectedEggId) return frontPos end) end elseif savedCFrame then local root = getRootPart() if root then root.CFrame = savedCFrame end end runtime.merchantBusy = false updateTag() end -- [7] Subsystem C: Inventory-Aware Shiny & Rainbow Crafting + Floor-Accurate Egg Auto-Hatch local function collectCraftCandidates(eggId) local normalIds = {} local shinyIds = {} if config.craftScope == "Entire Inventory (All Pets)" then for pid, pdef in pairs(PetConfig.PETS) do if not pdef.variant and not pdef.share and PetConfig.PETS[pid .. PetConfig.SUFFIX.Shiny] then table.insert(normalIds, pid) elseif pdef.variant == "Shiny" and PetConfig.rainbowOf and PetConfig.rainbowOf(pid) then table.insert(shinyIds, pid) end end elseif config.craftScope == "Specific Target Pet(s)" and #config.selectedPetIds > 0 then for _, pid in ipairs(config.selectedPetIds) do if PetConfig.PETS[pid] then table.insert(normalIds, pid) local sid = pid .. PetConfig.SUFFIX.Shiny if PetConfig.PETS[sid] then table.insert(shinyIds, sid) end end end else -- Selected Egg Only local edef = PetConfig.EGGS[eggId] if edef then for _, entry in ipairs(edef.pets or edef.pool or {}) do local pid = type(entry) == "table" and (entry.id or entry[1]) or entry if pid and PetConfig.PETS[pid] then table.insert(normalIds, pid) local sid = pid .. PetConfig.SUFFIX.Shiny if PetConfig.PETS[sid] then table.insert(shinyIds, sid) end end end end end return normalIds, shinyIds end local function craftAvailablePets(eggId) local per = math.clamp(config.petsPerCraft, 1, 8) local normalIds, shinyIds = collectCraftCandidates(eggId) local didCraft = false -- Pass 1: Shiny Machine (Step inside W2ShinyPad circle -> Craft Normal -> Shiny) if config.autoShiny and isRoomUnlocked(PetConfig.SHINY_MACHINE.ROOM) and not runtime.merchantBusy then local shinyQueue = {} for _, pid in ipairs(normalIds) do local spare = PetConfig.spare(LocalPlayer, pid) if spare >= per then local times = math.clamp(math.floor(spare / per), 1, PetConfig.SHINY_MACHINE.MAX_TIMES or 1000) table.insert(shinyQueue, { id = pid, times = times, spare = spare }) end end if #shinyQueue > 0 then didCraft = true runtime.petStepBusy = true if logTelemetry then logTelemetry(string.format("[SHINY MACHINE] Stepping onto Shiny Pad circle for %d pet type(s)...", #shinyQueue)) end teleportToRoomAndPos(PetConfig.SHINY_MACHINE.ROOM, function() return getMachinePadPos("W2ShinyPad", SHINY_PAD_FALLBACK) end) task.wait(0.35) -- allow ShinyPad Zone circle & modal trigger for _, job in ipairs(shinyQueue) do if not runtime.alive or runtime.merchantBusy then break end -- Ensure we stay centered inside the Shiny circle local padPos = getMachinePadPos("W2ShinyPad", SHINY_PAD_FALLBACK) local root = getRootPart() if root and (root.Position - padPos).Magnitude > 4 then root.CFrame = CFrame.new(padPos) end local gotResult = false local resConn resConn = W2ShinyCraftResultRemote.OnClientEvent:Connect(function(resId, perUsed, timesUsed, madeCount) if resId == job.id then gotResult = true local made = tonumber(madeCount) or 0 runtime.totalShinyCrafted += made local pname = (PetConfig.PETS[job.id] and PetConfig.PETS[job.id].name) or job.id if logTelemetry then logTelemetry(string.format("[SHINY CRAFT] %s: +%d Shiny crafted (%dx%d used)", pname, made, tonumber(perUsed) or per, tonumber(timesUsed) or job.times)) end end end) W2ShinyCraftRemote:FireServer(job.id, per, job.times) local t0 = os.clock() while not gotResult and (os.clock() - t0) < 2.5 do task.wait(0.05) end if resConn.Connected then resConn:Disconnect() end task.wait((PetConfig.SHINY_MACHINE.COOLDOWN or 0.9) + 0.1) end runtime.petStepBusy = false end end -- Pass 2: Rainbow Machine (Step inside W2RainbowPad circle -> Craft Shiny -> Rainbow) if config.autoRainbow and isRoomUnlocked(PetConfig.RAINBOW_MACHINE.ROOM) and not runtime.merchantBusy then -- Re-scan shiny spares AFTER Pass 1 so newly crafted Shinies immediately feed into Rainbow! local rainbowQueue = {} for _, sid in ipairs(shinyIds) do local spareShiny = PetConfig.spare(LocalPlayer, sid) if spareShiny >= per then local times = math.clamp(math.floor(spareShiny / per), 1, PetConfig.RAINBOW_MACHINE.MAX_TIMES or 1000) table.insert(rainbowQueue, { id = sid, times = times, spare = spareShiny }) end end if #rainbowQueue > 0 then didCraft = true runtime.petStepBusy = true if logTelemetry then logTelemetry(string.format("[RAINBOW MACHINE] Stepping onto Rainbow Pad circle for %d shiny pet type(s)...", #rainbowQueue)) end teleportToRoomAndPos(PetConfig.RAINBOW_MACHINE.ROOM, function() return getMachinePadPos("W2RainbowPad", RAINBOW_PAD_FALLBACK) end) task.wait(0.35) -- allow RainbowPad Zone circle & modal trigger for _, job in ipairs(rainbowQueue) do if not runtime.alive or runtime.merchantBusy then break end local padPos = getMachinePadPos("W2RainbowPad", RAINBOW_PAD_FALLBACK) local root = getRootPart() if root and (root.Position - padPos).Magnitude > 4 then root.CFrame = CFrame.new(padPos) end local gotResult = false local resConn resConn = W2RainbowCraftResultRemote.OnClientEvent:Connect(function(resId, perUsed, timesUsed, madeCount) if resId == job.id then gotResult = true local made = tonumber(madeCount) or 0 runtime.totalRainbowCrafted += made local pname = (PetConfig.PETS[job.id] and PetConfig.PETS[job.id].name) or job.id if logTelemetry then logTelemetry(string.format("[RAINBOW CRAFT] %s: +%d RAINBOW crafted (%dx%d Shiny used)!", pname, made, tonumber(perUsed) or per, tonumber(timesUsed) or job.times)) end end end) W2RainbowCraftRemote:FireServer(job.id, per, job.times) local t0 = os.clock() while not gotResult and (os.clock() - t0) < 2.5 do task.wait(0.05) end if resConn.Connected then resConn:Disconnect() end task.wait((PetConfig.RAINBOW_MACHINE.COOLDOWN or 0.9) + 0.1) end runtime.petStepBusy = false end end return didCraft end local function positionNearSelectedEgg(eggId) local edef = PetConfig.EGGS[eggId] if not edef then return false end local frontPos, anchorPos = getEggStandFrontPos(eggId) local root = getRootPart() local needRoomTp = (not frontPos) or (not root) or (anchorPos and (root.Position - anchorPos).Magnitude > 45) if needRoomTp then teleportToRoomAndPos(edef.room, function() local fp = getEggStandFrontPos(eggId) return fp end) frontPos, anchorPos = getEggStandFrontPos(eggId) root = getRootPart() end if root and frontPos then if (root.Position - frontPos).Magnitude > 6 then root.AssemblyLinearVelocity = Vector3.zero root.CFrame = CFrame.new(frontPos) task.wait(0.18) end return true end return false end local function startPetFarmLoop() task.spawn(function() while runtime.alive do if not config.petFarmEnabled or runtime.merchantBusy then task.wait(0.25) continue end local eggId = config.selectedEggId local edef = PetConfig.EGGS[eggId] if not edef or not isRoomUnlocked(edef.room) then if logTelemetry then logTelemetry("[PET FARM] Selected egg room is locked or invalid: " .. tostring(eggId)) end task.wait(2.0) continue end -- Step 1: Check & run Shiny -> Rainbow crafting whenever any target pet hits threshold craftAvailablePets(eggId) if not config.petFarmEnabled or runtime.merchantBusy then continue end -- Step 2: Stand directly in front of the selected Egg Stand on the floor (within STAND_REACH = 19) local positioned = positionNearSelectedEgg(eggId) if not positioned or not config.petFarmEnabled or runtime.merchantBusy then task.wait(0.3) continue end -- Step 3: Check currency & hatch max eggs at once local hatchCount = PetConfig.hatchMax and PetConfig.hatchMax(LocalPlayer) or 1 local currency = edef.currency or "Bucks" local balance = LocalPlayer:GetAttribute(currency) or 0 if balance < edef.price * hatchCount then if balance >= edef.price then hatchCount = 1 else if logTelemetry then logTelemetry(string.format("[PET FARM] Insufficient %s for %s (Need %s). Waiting...", currency, edef.name or eggId, PitConfig.Short(edef.price))) end task.wait(3.0) continue end end -- Step 4: Fire Hatch & wait for W2HatchResult + exact server cooldown runtime.petStepBusy = true runtime.hatchPending = true runtime.lastHatchResult = nil local hatchStart = os.clock() W2HatchRemote:FireServer(eggId, hatchCount) while runtime.hatchPending and (os.clock() - hatchStart) < 3.2 do task.wait(0.05) end runtime.petStepBusy = false if config.suppressHatchUI then local hatchGui = LocalPlayer.PlayerGui:FindFirstChild("HatchScreen") if hatchGui and hatchGui:IsA("ScreenGui") then hatchGui.Enabled = false end RevealDoneRemote:FireServer("egg") end -- Yield immediately if Merchant Auto-Buy triggered while hatching if runtime.merchantBusy then continue end local speed = PetConfig.hatchSpeed and PetConfig.hatchSpeed(LocalPlayer) or 1 local cooldown = (PetConfig.HATCH_COOLDOWN or 2.6) / math.max(speed, 0.5) local remaining = math.max(0.15, cooldown - (os.clock() - hatchStart)) local waitStart = os.clock() while (os.clock() - waitStart) < remaining and runtime.alive and config.petFarmEnabled and not runtime.merchantBusy do task.wait(0.08) end end end) end -- [8] Rayfield Gen2 User Interface local Rayfield = loadstring(game:HttpGet("https://sirius.menu/gen2"))() local window = Rayfield:CreateWindow({ name = "Depth Incremental — Noliar", subtitle = "Lightning · Merchants · Pets · Session Log", sidebarLayout = true, theme = "cobalt", fallbackFont = Enum.Font.Gotham, configuration = { autoSave = true, autoLoad = true, fileName = "DepthIncrementalSuiteV23", customFolder = "Ritmada", } }) statusTag = window:CreateTag({ text = "IDLE", color = Color3.fromRGB(160, 165, 180) }) -- Tabs local tabLightning = window:CreateTab({ name = "Lightning", icon = 93364949241311 }) local tabMerchants = window:CreateTab({ name = "Merchants", icon = 93364949241311 }) local tabPets = window:CreateTab({ name = "Pets & Craft", icon = 93364949241311 }) local tabSession = window:CreateTab({ name = "Session Log", icon = 93364949241311 }) local tabTelemetry = window:CreateTab({ name = "Telemetry", icon = 93364949241311 }) local tabSettings = window:CreateTab({ name = "Settings", icon = 93364949241311 }) local toggleLightning local togglePetFarm -- TAB 1: LIGHTNING FARM tabLightning:CreateSection({ name = "Catch the Lightning Automation" }) toggleLightning = tabLightning:CreateToggle({ name = "Enable Lightning Auto-Farm", flag = "lightningEnabled", value = false, callback = function(val) config.lightningEnabled = val if val then if config.petFarmEnabled and togglePetFarm then togglePetFarm:Set(false) end if logTelemetry then logTelemetry("[LIGHTNING] Auto-farm enabled.") end task.spawn(ensureInLightningRoom) else if logTelemetry then logTelemetry("[LIGHTNING] Auto-farm paused.") end end updateTag() end, }) tabLightning:CreateDropdown({ name = "Movement Strategy", flag = "movementMode", options = { "Walk (Humanoid)", "Instant (CFrame)", "Smooth (Tween)" }, value = "Walk (Humanoid)", callback = function(selected) config.movementMode = selected if logTelemetry then logTelemetry("[CONFIG] Movement mode -> " .. selected) end end, }) tabLightning:CreateSlider({ name = "WalkSpeed Override", flag = "walkSpeed", range = { 16, 80 }, increment = 2, value = 40, callback = function(val) config.walkSpeed = val local hum = getHumanoid() if hum and config.movementMode == "Walk (Humanoid)" then hum.WalkSpeed = val end end, }) tabLightning:CreateToggle({ name = "Dead-Center Alignment Snap", flag = "centerSnap", value = true, callback = function(val) config.centerSnap = val end, }) tabLightning:CreateSection({ name = "Star Pad Auto-Bank" }) tabLightning:CreateToggle({ name = "Auto Bank When Full", flag = "autoBank", value = true, callback = function(val) config.autoBank = val end, }) tabLightning:CreateSlider({ name = "Bank Capacity Trigger", flag = "bankThreshold", range = { 10, 110 }, increment = 5, value = 110, callback = function(val) config.bankThreshold = val end, }) tabLightning:CreateButton({ name = "Bank Charges Immediately", callback = function() task.spawn(performBankDeposit) end, }) tabLightning:CreateButton({ name = "Teleport to Catch Lightning Room", callback = function() task.spawn(function() teleportToRoomAndPos(LIGHTNING_ROOM, STRIKE_ZONE_CENTER) if logTelemetry then logTelemetry("[NAV] Teleported to Catch the Lightning room.") end end) end, }) -- TAB 2: MERCHANTS AUTO-BUY tabMerchants:CreateSection({ name = "6-Merchant Sync (Lightning + Pet Farm)" }) tabMerchants:CreateText({ name = "Merchant Synchronization", text = "Synced with BOTH Lightning Farm and Pet Egg Farm. Whenever selected merchants have wanted items in stock, pauses your active farm, buys everything selected, and teleports right back to resume." }) tabMerchants:CreateToggle({ name = "Enable Merchant Auto-Buy", flag = "merchantEnabled", value = false, callback = function(val) config.merchantEnabled = val updateTag() if val then if logTelemetry then logTelemetry("[MERCHANT] Auto-Buy armed. Syncing stock across all 6 shops...") end MerchantSyncRemote:FireServer() task.delay(0.8, function() runMerchantSweep(false) end) else if logTelemetry then logTelemetry("[MERCHANT] Auto-Buy disarmed.") end end end, }) tabMerchants:CreateDropdown({ name = "Purchase Filter Mode", flag = "merchantBuyMode", options = { "By Rarity", "Specific Items Only", "Rarity + Specific" }, value = "By Rarity", callback = function(selected) config.merchantBuyMode = selected end, }) tabMerchants:CreateDropdown({ name = "Target Merchant Shops", flag = "merchantShops", options = MERCHANT_LABELS, value = MERCHANT_LABELS, multiSelect = true, callback = function(selectedList) local keys = {} for _, lbl in ipairs(selectedList) do if MERCHANT_LABEL_TO_KEY[lbl] then table.insert(keys, MERCHANT_LABEL_TO_KEY[lbl]) end end config.merchantShops = keys end, }) tabMerchants:CreateDropdown({ name = "Target Rarities (Auto-Buy)", flag = "merchantRarities", options = MERCHANT_RARITIES, value = { "Epic", "Legendary", "Mythic", "Godly" }, multiSelect = true, callback = function(selectedList) config.merchantRarities = selectedList end, }) tabMerchants:CreateDropdown({ name = "Specific Items Whitelist (Optional)", flag = "merchantSpecificItems", options = ALL_MERCHANT_ITEM_LABELS, value = {}, multiSelect = true, placeholder = "Search any merchant item...", callback = function(selectedList) local ids = {} for _, lbl in ipairs(selectedList) do if MERCHANT_LABEL_TO_ITEM_ID[lbl] then table.insert(ids, MERCHANT_LABEL_TO_ITEM_ID[lbl]) end end config.merchantSpecificIds = ids end, }) tabMerchants:CreateButton({ name = "Sync & Sweep All Merchants Now", callback = function() task.spawn(function() MerchantSyncRemote:FireServer() task.wait(0.7) runMerchantSweep(true) end) end, }) -- TAB 3: PETS, EGGS, SHINY & RAINBOW tabPets:CreateSection({ name = "Egg Hatch -> Shiny Circle (8->1) -> Rainbow Circle (8->1)" }) tabPets:CreateText({ name = "Verified Machine & Egg Mechanics", text = "Stands directly in front of the selected Egg Stand to auto-hatch. When spare pets reach threshold, teleports onto the Shiny/Rainbow machine circles, crafts all ready pets, and returns to hatch." }) togglePetFarm = tabPets:CreateToggle({ name = "Enable Pet Auto-Farm Loop", flag = "petFarmEnabled", value = false, callback = function(val) config.petFarmEnabled = val if val then if config.lightningEnabled and toggleLightning then toggleLightning:Set(false) end if logTelemetry then logTelemetry("[PET FARM] Loop active on egg: " .. config.selectedEggId .. " | Scope: " .. config.craftScope) end else if logTelemetry then logTelemetry("[PET FARM] Loop paused.") end end updateTag() end, }) local initialPetLabels, activePetLabelToId = getEggPetCatalog(config.selectedEggId) local dropdownTargetPets tabPets:CreateDropdown({ name = "Target Egg (All 8 Eggs)", flag = "selectedEgg", options = EGG_LABELS, value = DEFAULT_BEST_EGG_LABEL or EGG_LABELS[#EGG_LABELS], callback = function(selectedLabel) local eggId = EGG_LABEL_TO_ID[selectedLabel] if eggId then config.selectedEggId = eggId local newLabels, newMap = getEggPetCatalog(eggId) activePetLabelToId = newMap config.selectedPetIds = {} if dropdownTargetPets then pcall(function() dropdownTargetPets:Refresh(newLabels) end) end if logTelemetry then logTelemetry("[PET FARM] Target egg -> " .. eggId) end end end, }) tabPets:CreateDropdown({ name = "Shiny & Rainbow Craft Scope", flag = "craftScope", options = { "Entire Inventory (All Pets)", "Selected Egg Only", "Specific Target Pet(s)" }, value = "Entire Inventory (All Pets)", callback = function(selected) config.craftScope = selected if logTelemetry then logTelemetry("[CRAFT] Scope -> " .. selected) end end, }) dropdownTargetPets = tabPets:CreateDropdown({ name = "Specific Target Pet(s) (From Selected Egg)", flag = "selectedPets", options = initialPetLabels, value = {}, multiSelect = true, placeholder = "Used when Scope = Specific Target Pet(s)", callback = function(selectedList) local ids = {} for _, lbl in ipairs(selectedList) do if activePetLabelToId[lbl] then table.insert(ids, activePetLabelToId[lbl]) end end config.selectedPetIds = ids end, }) tabPets:CreateSlider({ name = "Pets Per Craft (8 = 100% Guaranteed)", flag = "petsPerCraft", range = { 1, 8 }, increment = 1, value = 8, callback = function(val) config.petsPerCraft = val end, }) tabPets:CreateToggle({ name = "Auto Craft Shiny (Normal -> Shiny)", flag = "autoShiny", value = true, callback = function(val) config.autoShiny = val end, }) tabPets:CreateToggle({ name = "Auto Craft Rainbow (Shiny -> Rainbow)", flag = "autoRainbow", value = true, callback = function(val) config.autoRainbow = val end, }) tabPets:CreateToggle({ name = "Hide Hatch Reveal Overlay", flag = "suppressHatchUI", value = true, callback = function(val) config.suppressHatchUI = val local hg = LocalPlayer.PlayerGui:FindFirstChild("HatchScreen") if hg and hg:IsA("ScreenGui") then hg.Enabled = not val end end, }) tabPets:CreateButton({ name = "Craft Ready Shiny & Rainbow Now", callback = function() task.spawn(function() local did = craftAvailablePets(config.selectedEggId) if not did and logTelemetry then logTelemetry("[CRAFT] No spare pets reached threshold (" .. config.petsPerCraft .. ") in current scope.") end end) end, }) tabPets:CreateButton({ name = "Inspect Inventory Ready to Craft (Console)", callback = function() local per = config.petsPerCraft local readyShiny, readyRainbow = {}, {} for pid, pdef in pairs(PetConfig.PETS) do local sp = PetConfig.spare(LocalPlayer, pid) if sp >= per then if not pdef.variant and not pdef.share and PetConfig.PETS[pid .. PetConfig.SUFFIX.Shiny] then table.insert(readyShiny, string.format("%s (%d -> %dx Shiny)", pdef.name or pid, sp, math.floor(sp / per))) elseif pdef.variant == "Shiny" and PetConfig.rainbowOf and PetConfig.rainbowOf(pid) then table.insert(readyRainbow, string.format("%s (%d -> %dx Rainbow)", pdef.name or pid, sp, math.floor(sp / per))) end end end logTelemetry("[INVENTORY READY -> SHINY] " .. (#readyShiny > 0 and table.concat(readyShiny, ", ") or "None")) logTelemetry("[INVENTORY READY -> RAINBOW] " .. (#readyRainbow > 0 and table.concat(readyRainbow, ", ") or "None")) end, }) tabPets:CreateButton({ name = "Teleport to Selected Egg Stand", callback = function() task.spawn(function() positionNearSelectedEgg(config.selectedEggId) if logTelemetry then logTelemetry("[NAV] Positioned in front of " .. config.selectedEggId) end end) end, }) -- TAB 4: SESSION LOG (LIVE COUNTERS BY RARITY + SHINY / RAINBOW) tabSession:CreateSection({ name = "Active Session Tracker" }) tabSession:CreateText({ name = "Session Started", text = "Session initialized at " .. session.startedAt .. ". Automatically counts every confirmed Merchant purchase by rarity, every Egg pet hatched by rarity, and every Shiny / Rainbow crafted." }) local sessionBtnRow = tabSession:CreateGroup({ direction = "row" }) sessionBtnRow:CreateButton({ name = "Print Session Summary to Console", callback = function() local elapsed = math.floor(os.clock() - session.startedClock) logTelemetry(string.format("[SESSION %s | %dm %ds] MERCHANTS (Total %d): Common=%d Uncommon=%d Rare=%d Epic=%d Legendary=%d Mythic=%d Godly=%d", session.startedAt, elapsed // 60, elapsed % 60, session.merchant.Total, session.merchant.Common, session.merchant.Uncommon, session.merchant.Rare, session.merchant.Epic, session.merchant.Legendary, session.merchant.Mythic, session.merchant.Godly)) logTelemetry(string.format("[SESSION EGGS] (Total %d): Common=%d Uncommon=%d Rare=%d Epic=%d Legendary=%d Secret=%d | CRAFTED: Shiny=%d Rainbow=%d", session.hatch.Total, session.hatch.Common, session.hatch.Uncommon, session.hatch.Rare, session.hatch.Epic, session.hatch.Legendary, session.hatch.Secret, session.crafted.Shiny, session.crafted.Rainbow)) end, }) sessionBtnRow:CreateButton({ name = "Reset Session Counters", callback = function() resetSessionStats() end, }) tabSession:CreateSection({ name = "Merchants Purchased (By Rarity)" }) local merchRow1 = tabSession:CreateGroup({ direction = "row" }) statWidgets.merchant.Common = merchRow1:CreateStat({ name = "Common", value = 0 }) statWidgets.merchant.Uncommon = merchRow1:CreateStat({ name = "Uncommon", value = 0 }) statWidgets.merchant.Rare = merchRow1:CreateStat({ name = "Rare", value = 0 }) statWidgets.merchant.Epic = merchRow1:CreateStat({ name = "Epic", value = 0 }) local merchRow2 = tabSession:CreateGroup({ direction = "row" }) statWidgets.merchant.Legendary = merchRow2:CreateStat({ name = "Legendary", value = 0 }) statWidgets.merchant.Mythic = merchRow2:CreateStat({ name = "Mythic", value = 0 }) statWidgets.merchant.Godly = merchRow2:CreateStat({ name = "Godly", value = 0 }) statWidgets.merchant.Total = merchRow2:CreateStat({ name = "Total Bought", value = 0 }) tabSession:CreateSection({ name = "Eggs Hatched (By Rarity)" }) local hatchRow1 = tabSession:CreateGroup({ direction = "row" }) statWidgets.hatch.Common = hatchRow1:CreateStat({ name = "Common", value = 0 }) statWidgets.hatch.Uncommon = hatchRow1:CreateStat({ name = "Uncommon", value = 0 }) local hatchRow2 = tabSession:CreateGroup({ direction = "row" }) statWidgets.hatch.Rare = hatchRow2:CreateStat({ name = "Rare", value = 0 }) statWidgets.hatch.Epic = hatchRow2:CreateStat({ name = "Epic", value = 0 }) local hatchRow3 = tabSession:CreateGroup({ direction = "row" }) statWidgets.hatch.Legendary = hatchRow3:CreateStat({ name = "Legendary", value = 0 }) statWidgets.hatch.Secret = hatchRow3:CreateStat({ name = "Secret", value = 0 }) statWidgets.hatch.Total = tabSession:CreateStat({ name = "Total Hatched", value = 0 }) tabSession:CreateSection({ name = "Machines Crafted (Shiny & Rainbow)" }) local craftRow = tabSession:CreateGroup({ direction = "row" }) statWidgets.crafted.Shiny = craftRow:CreateStat({ name = "Shiny Crafted", value = 0 }) statWidgets.crafted.Rainbow = craftRow:CreateStat({ name = "Rainbow Crafted", value = 0 }) -- TAB 5: TELEMETRY CONSOLE tabTelemetry:CreateSection({ name = "Real-Time Operations Console" }) console = tabTelemetry:CreateConsole({ name = "Master Telemetry Stream", height = 200, follow = true, maxLines = 350, }) startUiPump() tabTelemetry:CreateButton({ name = "Dump Live Counters to Console", callback = function() logTelemetry(string.format("[STATS] Bolts: %s | Meter: %.1f/%d | Caught: %d | Banked: %d | Merch Buys: %d | Hatches: %d | Shiny: %d | Rainbow: %d", PitConfig.Short(getTotalBolts()), getBoltMeter(), getMeterCap(), runtime.totalCaught, runtime.totalDeposited, runtime.totalMerchantBuys, runtime.totalHatches, runtime.totalShinyCrafted, runtime.totalRainbowCrafted )) end, }) tabTelemetry:CreateButton({ name = "Clear Console", callback = function() console:Clear() end, }) -- TAB 5: SETTINGS & TEARDOWN tabSettings:CreateSection({ name = "Safety & Lifecycle" }) tabSettings:CreateToggle({ name = "Collision Bypass (Noclip during Lightning Walk)", flag = "noclip", value = true, callback = function(val) config.noclip = val end, }) tabSettings:CreateToggle({ name = "Anti-AFK Connection Keeper", flag = "antiAfk", value = true, callback = function(val) config.antiAfk = val end, }) tabSettings:CreateDropdown({ name = "Interface Theme", options = { "cobalt", "default", "amethyst", "ruby" }, value = "cobalt", callback = function(themeName) window:ChangeTheme(themeName) end, }) tabSettings:CreateButton({ name = "Unload Script", callback = function() if typeof(getgenv().Ritmada_DepthSuite_Cleanup) == "function" then getgenv().Ritmada_DepthSuite_Cleanup() end end, }) -- [9] Remote & Event Bindings -- 9A. Lightning Strike Interceptor table.insert(connections, W2LightningRemote.OnClientEvent:Connect(function(action, pos, landAt, isBig) if not config.lightningEnabled or runtime.merchantBusy then return end if action == "warn" then local currentMeter = getBoltMeter() if config.autoBank and currentMeter >= config.bankThreshold and not runtime.isBanking then performBankDeposit() return end if runtime.isBanking then return end local strikeType = isBig and "BIG (5x)" or "NORMAL (1x)" logTelemetry(string.format("[LIGHTNING] %s at (%.1f, %.1f) in %.2fs", strikeType, pos.X, pos.Z, math.max(0, landAt - workspace:GetServerTimeNow()))) local root = getRootPart() if not root then return end local targetV3 = Vector3.new(pos.X, root.Position.Y, pos.Z) moveToPosition(targetV3, function() local curRoot = getRootPart() if curRoot and config.centerSnap and not runtime.merchantBusy then curRoot.CFrame = CFrame.new(targetV3) end end) elseif action == "land" then local hitSuccess = landAt local gained = isBig if hitSuccess == true then runtime.totalCaught += 1 logTelemetry(string.format("[CATCH] +%s charge | Meter: %.1f / %d", tostring(gained or 1), getBoltMeter(), getMeterCap())) end if config.autoBank and getBoltMeter() >= config.bankThreshold and not runtime.isBanking then performBankDeposit() end elseif action == "bank" then logTelemetry("[SERVER-BANK] +" .. PitConfig.Short(pos) .. " Bolts banked!") end end)) -- 9B. Merchant Stock Listener & 5-Min Restock Scheduler table.insert(connections, MerchantStockRemote.OnClientEvent:Connect(function(stockTbl, isRestock, shopKey) local key = shopKey or "Trading" runtime.merchantStocks[key] = stockTbl or {} if isRestock then logTelemetry("[MERCHANT] Restock detected for: " .. key) end if config.merchantEnabled and not runtime.merchantBusy then task.defer(function() runMerchantSweep(false) end) end end)) task.spawn(function() task.wait(1.0) MerchantSyncRemote:FireServer() while runtime.alive do local bucket = math.floor(workspace:GetServerTimeNow() / 300) if bucket ~= runtime.lastRestockBucket then runtime.lastRestockBucket = bucket task.wait(1.5) if runtime.alive then MerchantSyncRemote:FireServer() if config.merchantEnabled and not runtime.merchantBusy then task.delay(0.8, function() runMerchantSweep(false) end) end end end task.wait(2.0) end end) -- 9C. Hatch Result Listener (Counts Every Hatched Pet By Rarity) table.insert(connections, W2HatchResultRemote.OnClientEvent:Connect(function(eggId, results, errReason) runtime.hatchPending = false runtime.lastHatchResult = results if type(results) == "table" and #results > 0 then runtime.totalHatches += #results local names = {} for _, r in ipairs(results) do local pid = type(r) == "table" and (r.id or r[1]) or r local pdef = PetConfig.PETS[pid] local rarity = (pdef and pdef.rarity) or "Common" session.hatch[rarity] = (session.hatch[rarity] or 0) + 1 session.hatch.Total += 1 table.insert(names, string.format("%s [%s]", pdef and pdef.name or tostring(pid), rarity)) end syncSessionStats() if config.petFarmEnabled then logTelemetry("[HATCH] " .. table.concat(names, ", ")) end elseif errReason and config.petFarmEnabled then logTelemetry("[HATCH ERR] " .. tostring(errReason)) end end)) -- 9C-2. Global Shiny & Rainbow Craft Session Counters (Counts Both Auto & Manual Crafts) table.insert(connections, W2ShinyCraftResultRemote.OnClientEvent:Connect(function(resId, perUsed, timesUsed, madeCount) local made = tonumber(madeCount) or 0 if made > 0 then session.crafted.Shiny += made syncSessionStats() end end)) table.insert(connections, W2RainbowCraftResultRemote.OnClientEvent:Connect(function(resId, perUsed, timesUsed, madeCount) local made = tonumber(madeCount) or 0 if made > 0 then session.crafted.Rainbow += made syncSessionStats() end end)) -- 9D. Attribute Watcher (BoltMeter Auto-Bank + Server-Confirmed Merchant Purchase Rarity Counter) table.insert(connections, LocalPlayer.AttributeChanged:Connect(function(attr) if attr == "BoltMeter" and config.lightningEnabled and config.autoBank and not runtime.isBanking and not runtime.merchantBusy then if getBoltMeter() >= config.bankThreshold then performBankDeposit() end elseif attr:sub(1, 6) == "Merch_" then local itemId = attr:sub(7) local newVal = LocalPlayer:GetAttribute(attr) or 0 local oldVal = merchSnapshot[itemId] or 0 if newVal > oldVal then local delta = newVal - oldVal merchSnapshot[itemId] = newVal local itemDef = PitConfig.MerchantById and PitConfig.MerchantById[itemId] local rarity = (itemDef and itemDef.rarity) or "Common" session.merchant[rarity] = (session.merchant[rarity] or 0) + delta session.merchant.Total += delta syncSessionStats() logTelemetry(string.format("[SESSION MERCH] +%d %s (%s) | %s Count: %d", delta, (itemDef and itemDef.name) or itemId, rarity, rarity, session.merchant[rarity])) else merchSnapshot[itemId] = newVal end end end)) -- 9E. Noclip (Lightning Walk only) & WalkSpeed Loop table.insert(connections, RunService.Stepped:Connect(function() if not runtime.alive then return end if config.noclip and config.lightningEnabled and not runtime.merchantBusy then local char = LocalPlayer.Character if char then for _, part in ipairs(char:GetDescendants()) do if part:IsA("BasePart") and part.CanCollide then part.CanCollide = false end end end end if config.lightningEnabled and not runtime.merchantBusy and config.movementMode == "Walk (Humanoid)" then local hum = getHumanoid() if hum and hum.WalkSpeed ~= config.walkSpeed then hum.WalkSpeed = config.walkSpeed end end end)) -- 9F. Anti-AFK table.insert(connections, LocalPlayer.Idled:Connect(function() if config.antiAfk then VirtualUser:Button2Down(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) task.wait(1) VirtualUser:Button2Up(Vector2.new(0, 0), workspace.CurrentCamera.CFrame) logTelemetry("[KEEPALIVE] Anti-AFK pulse sent.") end end)) -- [10] Clean Teardown Handler getgenv().Ritmada_DepthSuite_Cleanup = function() runtime.alive = false config.lightningEnabled = false config.merchantEnabled = false config.petFarmEnabled = false for _, conn in ipairs(connections) do if typeof(conn) == "RBXScriptConnection" and conn.Connected then conn:Disconnect() end end table.clear(connections) local hum = getHumanoid() if hum then hum.WalkSpeed = runtime.originalWalkSpeed end local hg = LocalPlayer.PlayerGui:FindFirstChild("HatchScreen") if hg and hg:IsA("ScreenGui") then hg.Enabled = true end pcall(function() Rayfield:Destroy() end) getgenv().Ritmada_DepthSuite_Loaded = nil getgenv().Ritmada_DepthSuite_Cleanup = nil end -- [11] Kickoff local initialHum = getHumanoid() if initialHum then runtime.originalWalkSpeed = initialHum.WalkSpeed end startPetFarmLoop() logTelemetry("[BOOT] Script ready. Session started at " .. session.startedAt .. " — tracking Merchants, Eggs & Shiny/Rainbow.") window:Notify({ title = "Depth Incremental Script", content = "Session Log active (" .. session.startedAt .. "): wide 2-col Egg counters & clean egg names ready.", duration = 5, })