Tiandel

Member
Hello everyone,


I’m looking for a solution to generate a list of items with names and IDs from ServUO and my client, either via a command in ServUO or another method—ideally categorized. For example, based on where the information comes from, such as a path that could later serve as a category.


Why do I need this? I want to find my items more quickly, for example all walls or doors. Right now, it’s difficult to keep an overview. With around 65,000 items, things become very confusing. Are there any existing solutions for this? Maybe something I can use as a database while scripting?


How do you handle this when scripting, for example when you quickly need all tile IDs and names for house walls or axes?


Thanks for your help.
 
It's possible to make a gump with categories which can be filled automatically based on item FLAGS, like: Door, Wall, Stairs, Surface, Wet, Wearable, etc. You can get this info based on IDs from TileData & ItemData in ServUO.
1778026017761.png
 
Code for UO Fiddler "Item Export to csv":

Add the CSV export code to ItemsControl.cs, add a button (or menu item), wire its click handler to call ExportAllItemsToCsv();, and you’re good to go.

C#:
Expand Collapse Copy
 private void ExportAllItemsToCsv()
 {
     using (SaveFileDialog sfd = new SaveFileDialog())
     {
         sfd.Filter = "CSV (*.csv)|*.csv";
         sfd.FileName = "items_details.csv";

         if (sfd.ShowDialog() != DialogResult.OK)
             return;

         var sb = new StringBuilder();

         // Header = exakt UpdateDetail
         sb.AppendLine(
             "Name;Graphic;Height;Weight;Animation;Quality;Quantity;Hue;" +
             "StackingOffset;Flags;PixelWidth;PixelHeight;" +
             "xMin;yMin;xMax;yMax;AnimFrameCount;AnimInterval"
         );


         for (int graphic = 0; graphic < TileData.ItemTable.Length; graphic++)
         {
             ItemData item = TileData.ItemTable[graphic];

             // ItemData ist struct → Null geht NICHT
             if (string.IsNullOrEmpty(item.Name))
                 continue;

             sb.AppendLine(BuildCsvLineFromGraphic(graphic));
         }


         File.WriteAllText(sfd.FileName, sb.ToString(), Encoding.UTF8);
         MessageBox.Show("CSV Export completed.", "Export",
             MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }

 private string BuildCsvLineFromGraphic(int graphic)
 {
     ItemData item = TileData.ItemTable[graphic];
     Bitmap bit = Art.GetStatic(graphic);

     int xMin = 0;
     int xMax = 0;
     int yMin = 0;
     int yMax = 0;

     if (bit != null)
     {
         Art.Measure(bit, out xMin, out yMin, out xMax, out yMax);
     }

     int? animFrames = null;
     int? animInterval = null;

     if ((item.Flags & TileFlag.Animation) != 0)
     {
         var info = Animdata.GetAnimData(graphic);
         if (info != null)
         {
             animFrames = info.FrameCount;
             animInterval = info.FrameInterval;
         }
     }

     return string.Format(
         "\"{0}\";0x{1:X4};{2};{3};{4};{5};{6};{7};{8};\"{9}\";" +
         "{10};{11};{12};{13};{14};{15};{16};{17}",
         item.Name?.Replace("\"", "\"\""),
         graphic,
         item.Height,
         item.Weight,
         item.Animation,
         item.Quality,
         item.Quantity,
         item.Hue,
         item.StackingOffset,
         item.Flags,
         bit?.Width ?? 0,
         bit?.Height ?? 0,
         xMin,
         yMin,
         xMax,
         yMax,
         animFrames?.ToString() ?? "",
         animInterval?.ToString() ?? ""
     );
 }

 private void exportAllToCsvToolStripMenuItem_Click(object sender, EventArgs e)
 {
     //Item Export so csv -> Only Meta Daten
     ExportAllItemsToCsv();
 }
 

Donations

Total amount
$80.00
Goal
$500.00

Shards

Back