|
128 Bit Converters (again) [by The Count] |
|
|
|
Posted Wednesday, August 12th @ 11:23:23 PM, by George Greer in the Utils dept.
Added Jul 3, 1997. Click the link below to read it or download it.
From: the count <eglamkowski@mathematica-mpr.com>
Subject: 128-bit conversion scripts
Hello :)
#!/usr/local/bin/perl -i.bak
#usage: mobfilt #.mob
$D = 0;
while (<>) {
chop;
if (/^\#\d+\s*/) {
$D = 1;
}
if (/^(\w+) (\w+) (-?\d+) (\w)\s*/) {
if ($D == 1) {
print $1, " 0 0 0 ", $2, " 0 0 0 ", $3, "\n";
$D = 0;
} else {
print "$_\n";
}
} else {
print "$_\n";
}
}
----------------------------------------------------
#!/usr/local/bin/perl -i.bak
#usage: objfilt #.obj
$D = 0;
while (<>) {
chop;
if (/^\#\d+\s*/) {
$D = 1;
}
if (/^(\d+) (\w+) (\w+)\s*/) {
if ($D == 1) {
print $1, " ", $2, " 0 0 0 ", $3, " 0 0 0\n";
$D = 0;
} else {
print "$_\n";
}
} else {
print "$_\n";
}
}
----------------------------------------------------
#!/usr/local/bin/perl -i.bak
#usage: wldfilt #.wld
$D = 0;
while (<>) {
chop;
if (/^\#\d+\s*/) {
$D = 1
}
if (/^(\d+) (\w+) (\d+)\s*/) {
if ($D == 1) {
print $1, " ", $2, " 0 0 0 ", $3, "\n";
$D = 0;
} else {
print "$_\n";
}
} else {
print "$_\n";
}
}
<< 128 Bit Converters [by T-Rex] | Reply | View as text | Flattened | Abbreviations [by Zigg] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|