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.
98 lines
2.5 KiB
C#
98 lines
2.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
string Safe(string s)
|
|
{
|
|
return string.IsNullOrWhiteSpace(s) ? "" : s.Replace("\r", " ").Replace("\n", " ").Trim();
|
|
}
|
|
|
|
int GetKind(dynamic item)
|
|
{
|
|
try { return (int)item.Kind; }
|
|
catch { return -1; }
|
|
}
|
|
|
|
int GetState(dynamic item)
|
|
{
|
|
try { return int.Parse(item.State?.ToString() ?? "0", CultureInfo.InvariantCulture); }
|
|
catch { return 0; }
|
|
}
|
|
|
|
int GetDir(dynamic item)
|
|
{
|
|
try { return (int)item.Direction; }
|
|
catch { return 0; }
|
|
}
|
|
|
|
string GetNameSafe(dynamic item)
|
|
{
|
|
try { return Safe(item.GetName()); }
|
|
catch { return ""; }
|
|
}
|
|
|
|
string EscCsv(string s)
|
|
{
|
|
s = s ?? "";
|
|
if (s.Contains(",") || s.Contains("\"") || s.Contains("\n"))
|
|
return "\"" + s.Replace("\"", "\"\"") + "\"";
|
|
return s;
|
|
}
|
|
|
|
var rows = new List<string>();
|
|
rows.Add("id,kind,name,x,y,z,state,dir");
|
|
|
|
int count = 0;
|
|
foreach (var item in FloorItems)
|
|
{
|
|
if (item == null) continue;
|
|
count++;
|
|
|
|
long id = item.Id;
|
|
int kind = GetKind(item);
|
|
string name = GetNameSafe(item);
|
|
int x = item.Location.X;
|
|
int y = item.Location.Y;
|
|
double z = item.Location.Z;
|
|
int state = GetState(item);
|
|
int dir = GetDir(item);
|
|
|
|
rows.Add(string.Join(",", new[] {
|
|
id.ToString(CultureInfo.InvariantCulture),
|
|
kind.ToString(CultureInfo.InvariantCulture),
|
|
EscCsv(name),
|
|
x.ToString(CultureInfo.InvariantCulture),
|
|
y.ToString(CultureInfo.InvariantCulture),
|
|
z.ToString("0.###", CultureInfo.InvariantCulture),
|
|
state.ToString(CultureInfo.InvariantCulture),
|
|
dir.ToString(CultureInfo.InvariantCulture)
|
|
}));
|
|
}
|
|
|
|
if (count == 0)
|
|
{
|
|
Log("ERROR: No floor items found.");
|
|
return;
|
|
}
|
|
|
|
string roomName = "room";
|
|
try { roomName = Safe(Room?.Name ?? "room"); } catch { roomName = "room"; }
|
|
if (string.IsNullOrWhiteSpace(roomName)) roomName = "room";
|
|
|
|
var invalid = Path.GetInvalidFileNameChars();
|
|
foreach (char c in invalid) roomName = roomName.Replace(c, '_');
|
|
|
|
string stamp = DateTime.Now.ToString("yyyyMMdd_HHmmss", CultureInfo.InvariantCulture);
|
|
string exportDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "HabboFloorExports");
|
|
Directory.CreateDirectory(exportDir);
|
|
|
|
string filePath = Path.Combine(exportDir, $"{roomName}_floor_{stamp}.csv");
|
|
File.WriteAllText(filePath, string.Join(Environment.NewLine, rows), Encoding.UTF8);
|
|
|
|
Log("=== Floor Export Complete ===");
|
|
Log($"Items exported: {count}");
|
|
Log($"File: {filePath}");
|