From AdamWiki
Jump to: navigation, search

Perl script that converts a file full of many lines of pretty, indented, commented softcode commands into compact softcode commands like you'd see with the "@decompile" command. The tool lets you write human-readable (and human-writeable) code and turn it into a form that you can load onto a game. It works best as a filter for TinyFugue's /quote command.


The program was a replacement for Andrew Molitor's wonderful amolitor_mush_unformatter.c, a 108-line C program that implemented a handful of basic unformatting rules (comments, indentation, and line continuation). The program works fine, but requires people to know how to compile a C program, which is not a hard task if you're familiar with that kind of thing, but which is rather arcane if you're not. Worse, a lot of school accounts in the 90's didn't have access to C compilers. Since Perl isn't compiled, I felt a script version of his program would benefit a lot of people. It mostly replaced the C program throughout the community.

I wrote the 1.0 version of Unformat in 1995 or so. I released 1.1 to soon after — in 1996, I think. The 1.1 version is just over 200 lines long, but more than half of it is comments. It handles comments, indentation, line continuation, and a #include directive.

The 2.0 Beta version is around 460 lines long, but more than half of it is comments. It handles everything 1.1 does, plus "/@ inline comments @/" and an #ascii directive that converts formatted text to %b's and %r's and stuff. It theoretically handles #define'd macro substitution, but I cannot remember if I got this to work properly. It's optimized to work faster (not that it ever ran slowly). I stopped working on this version a long time ago, but should revisit it.

Unformat on Windows

Unformat was made less useful as people abandoned TinyFugue for modern Windows mush clients like SimpleMU and MUSHclient. MUSHclient has supported a built-in unformat option since version 2.15 (September 1999). Rick L. Bird / Nveid created an Unformat plug-in for MUSHclient (local mirror).

Today, on the MUSH Warehouse site, Mark A. Hassman maintains an interactive MUSH Unformatter CGI Interface, a web program that reads and unformats softcode for you. It uses Unformat to do the work.