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>
72 lines
2.7 KiB
C#
72 lines
2.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net.Http;
|
|
using System.Text.Json;
|
|
using System.Text.RegularExpressions;
|
|
using System.Threading.Tasks;
|
|
|
|
var catalog = GetBcCatalog();
|
|
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 pages {i + 1}/{nodes.Length}...");
|
|
pages.Add((node, GetCatalogPage(node)));
|
|
}
|
|
|
|
string[] regexPatterns = new string[]
|
|
{
|
|
@"^bc_block_",
|
|
};
|
|
|
|
string[] blacklistStrings = new string[]
|
|
{
|
|
"Small Block",
|
|
};
|
|
|
|
var furniData = await FetchFurniDataAsync();
|
|
|
|
string json = JsonSerializer.Serialize(
|
|
pages.SelectMany(x => x.Page.Offers
|
|
.SelectMany(offer => offer.Products.Select(product => new { Product = product, OfferId = offer.Id, PageId = x.Page.Id, FurniName = product.GetName() })))
|
|
.Where(item => IsFurni(item.Product)
|
|
&& regexPatterns.Any(pattern => Regex.IsMatch(item.Product.GetIdentifier(), pattern))
|
|
&& !blacklistStrings.Any(blacklistString => item.FurniName.Contains(blacklistString))) // Check against FurniName
|
|
.Select(item => new
|
|
{
|
|
Identifier = item.Product.GetIdentifier(),
|
|
OfferId = item.OfferId,
|
|
PageId = item.PageId,
|
|
FurniName = item.FurniName,
|
|
Color = furniData.GetValueOrDefault(item.Product.GetIdentifier())
|
|
}),
|
|
new JsonSerializerOptions
|
|
{
|
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
|
WriteIndented = true
|
|
}
|
|
);
|
|
|
|
Directory.CreateDirectory("Bc_Block_Data");
|
|
File.WriteAllText($"Bc_Block_Data/Bc_Block_Data.json", json);
|
|
|
|
static async Task<Dictionary<string, string>> FetchFurniDataAsync()
|
|
{
|
|
using var httpClient = new HttpClient();
|
|
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36");
|
|
|
|
var response = await httpClient.GetStringAsync("https://www.habbo.com/gamedata/furnidata_json/0");
|
|
using var jsonDoc = JsonDocument.Parse(response);
|
|
|
|
return jsonDoc.RootElement.GetProperty("roomitemtypes").GetProperty("furnitype").EnumerateArray()
|
|
.Where(furni => furni.TryGetProperty("partcolors", out var partColors) && partColors.TryGetProperty("color", out var colors) && colors.GetArrayLength() > 1)
|
|
.ToDictionary(
|
|
furni => furni.GetProperty("classname").GetString(),
|
|
furni => furni.GetProperty("partcolors").GetProperty("color")[1].GetString()
|
|
);
|
|
}
|
|
|
|
static bool IsFurni(IItem it) => it.Type == ItemType.Floor || it.Type == ItemType.Wall;
|