xabbo-scripts/Catalog Exporter.csx
Administrator 7bfc390ed6 Initial commit: 68 Xabbo Scripter scripts
Habbo Hotel automation scripts including:
- Game solvers (Snake, Color Puzzle, Tetris, Flappy Bird, Flood-IT)
- Room utilities (Autogate, One-Way Door, Furni Scanner)
- Bot tools (Heal Bot, Pet Trainer, User Collector)
- Trading & economy (Furni-Matic, Seed Trade, Trade Spam)

Cleaned up: removed 5 duplicates and 2 broken scripts,
renamed 37 gibberish filenames to descriptive names.
2026-03-16 09:38:59 +01:00

61 lines
1.7 KiB
C#

/// @name Catalog Scraper
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.Encodings.Web;
var catalog = GetCatalog();
var nodes = catalog.Where(x => x.Id > 0).ToArray();
var pages = new List<(ICatalogPageNode Node, ICatalogPage Page)>();
for (int i = 0; i < nodes.Length; i++) {
var node = nodes[i];
Status($"Loading page {i+1}/{nodes.Length}...");
pages.Add((node, GetCatalogPage(node)));
await Task.Delay(300);
}
var opts = new JsonSerializerOptions {
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true
};
static bool IsFurni(IItem it) => it.Type == ItemType.Floor || it.Type == ItemType.Wall;
string json = JsonSerializer.Serialize(
pages.Select(x => new {
PageId = x.Node.Id,
x.Node.Name,
x.Node.Title,
x.Node.Icon,
x.Node.IsVisible,
x.Page.LayoutCode,
x.Page.Images,
x.Page.Texts,
x.Page.AcceptSeasonCurrencyAsCredits,
Offers = x.Page.Offers.Select(offer => new {
offer.Id,
offer.FurniLine,
offer.PriceInCredits,
offer.PriceInActivityPoints,
ActivityPointType = offer.ActivityPointType.ToString(),
offer.CanPurchaseAsGift,
offer.CanPurchaseMultiple,
offer.ClubLevel,
Products = offer.Products.Select(product => new {
Identifier = IsFurni(product) ? product.GetIdentifier() : null,
Name = IsFurni(product) ? product.GetIdentifier() : null,
Type = product.Type.ToString(),
product.Variant,
product.Count,
product.IsLimited
})
})
}),
opts
);
Directory.CreateDirectory("catalog");
File.WriteAllText($"catalog/{DateTime.Now:yyyyMMddHHmmssfff}.json", json);