using BrawlLib.SSBB.ResourceNodes; using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Drawing; using System.Diagnostics; namespace test { class Program { static void Main(string[] args) { foreach (string path in Directory.EnumerateDirectories(Environment.CurrentDirectory, "STG*")) { Console.WriteLine(path); string basename = Path.GetFileName(path); string zipfile = path + "\\" + basename + " (June 2014).zip"; if (File.Exists(zipfile)) File.Delete(zipfile); string ag = "a \"" + zipfile + "\" " + string.Join(" ", from f in Directory.EnumerateFiles(path) let l = f.ToLower() where !l.Contains(".html") && !l.Contains(".zip") && !l.Contains(".db") select '"' + f + '"'); ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\Program Files\7-zip\7z.exe", ag); Process.Start(startInfo); ResourceNode root = NodeFactory.FromFile(null, path + "\\" + basename + ".pac"); MSBinNode msbin = root.FindChildByType("MiscData[0]", true, ResourceType.MSBin) as MSBinNode; string stagename = msbin._strings[0].Replace("*", ""); if (stagename.Contains(" - ")) stagename = stagename.Substring(0, stagename.IndexOf(" - ")); var musiclist = from f in Directory.EnumerateFiles(path, "*.brstm") let b = Path.GetFileName(f) orderby Path.GetFileNameWithoutExtension(b) select "
  • " + b + "
  • "; var images = from f in Directory.EnumerateFiles(path, "*.png") let b = Path.GetFileName(f) orderby Bitmap.FromFile(f).Width * -1 select ""; string str = String.Format(@" {0}

    ?? {0}


    Download .pac (black border)

    Download .pac (no border)

    Download all files (.zip)

    {5}

    Music

    Stage select icons

    {4} ", stagename, basename, zipfile, string.Join("\n\t\t", musiclist), string.Join("
    \n\t", images), string.Join("\n", msbin._strings)); File.WriteAllText(path + "/index.html", str); } } } }