xabbo-scripts/CatalogScraper.csx
Administrator b6c31a7feb Add 165 scripts from desktop collection + update README
Added scripts from C:\Users\ploet\Desktop\Habbo\Xabbo Scripte:
- 39 KI/Chatbot scripts (ChatGPT, Gemini, Grok, DeepSeek, Ollama)
- Game solvers (Domino, Dodgeball, Obsidian Maze, IceBall)
- Collision avoidance bots (5 versions)
- Plant/breeding automation (12 scripts)
- Trading tools, packet debuggers, room utilities
- Navigation & teleport helpers

Removed: 9 files (3 empty, 2 trivial, 4 cross-duplicates)
Updated README with full categorized index of all 230+ scripts.

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

59 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);