xabbo-scripts/Scripts/Dave 2.csx
Administrator 7a548130a3 Move all scripts into Scripts/ subfolder
Keeps the repo root clean - only README.md visible on landing page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 09:49:37 +01:00

30 lines
1.1 KiB
C#

/// @name Catalog Item Finder
var targetIdentifier = "clothing_r25_kittybag";
var catalog = GetCatalog();
var nodes = catalog.Where(x => x.Id > 0).ToArray();
for (int i = 0; i < nodes.Length; i++) {
var node = nodes[i];
Status($"Searching {i+1}/{nodes.Length}...");
var page = GetCatalogPage(node);
foreach (var offer in page.Offers) {
foreach (var product in offer.Products) {
if (product.Type != ItemType.Floor && product.Type != ItemType.Wall) continue;
if (product.GetIdentifier() != targetIdentifier) continue;
var pointsLabel = offer.ActivityPointType.ToString() == "Diamond"
? "PriceInDiamonds"
: "PriceInActivityPoints";
Log($"Found: {targetIdentifier} | id: {offer.Id} | pageId: {node.Id} | pageName: {node.Name} | furniLine: {offer.FurniLine} | priceInCredits: {offer.PriceInCredits} | {pointsLabel}: {offer.PriceInActivityPoints} | canPurchaseMultiple: {offer.CanPurchaseMultiple} | canPurchaseAsGift: {offer.CanPurchaseAsGift} | type: {product.Type} | isLimited: {product.IsLimited}");
return;
}
}
await Task.Delay(150);
}
Log("Item not found in catalog");