Hello all.
Do anybody know of a tool or script able to exctract the logbook of a game?
In MSCI I find only commands to write in it.
I guess the data is in the savegame, but I don't have the keys to read it.
Many thanks,
Loog book extraction (script or savegame reading, whatever)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
-
- Posts: 161
- Joined: Tue, 22. Aug 17, 13:14
UPDATE:
- All formatting tags are now stripped, colors included.
- Empty lines are removed.
- Added curly braces {} around messages.
- Message origin is encased with <>.
- perl cascade is brutal but it works
The messages aren't stored in order in the save file and the time-stamps are lost : that info isn't adjacent to the message content and likely stored elsewhere in binary form...
But hopefully, that's good enough.
Perl is available at the command line for Linux and OSX. For windows, you can use:
- Cygwin (perl can be called at the terminal)
- Strawberry Perl (don't know about that one, might be friendlier)
You'll need to unzip the save file before extracting the data (.sav are actually zipped containers). Replace X05 at line 1 with your save number and out1.txt at line 5 with whatever you like.
Let me know if this works for you,
-lpa
- All formatting tags are now stripped, colors included.
- Empty lines are removed.
- Added curly braces {} around messages.
- Message origin is encased with <>.
- perl cascade is brutal but it works
Code: Select all
perl -0777 -nE 'print "{\n<$1>\n$2\n}\n" while m/(?s)\[author\](.*?)\[\/author\](.*?)\0/gm' X05 |
perl -pe 's/\[.*?(green|yellow|red|blue|magenta|orange|cyan|white|black|text.*?|select|center|author|title|justify|article?)]/ /g' |
perl -pe 's/\x20\x20?+/ /g' | perl -pe 's/^\x20|^\n//' |
perl -pe 's/\n/\r\n/' |
perl -pe 's/\x1B[A-Z]//g'> out1.txt
But hopefully, that's good enough.
Perl is available at the command line for Linux and OSX. For windows, you can use:
- Cygwin (perl can be called at the terminal)
- Strawberry Perl (don't know about that one, might be friendlier)
You'll need to unzip the save file before extracting the data (.sav are actually zipped containers). Replace X05 at line 1 with your save number and out1.txt at line 5 with whatever you like.
Let me know if this works for you,
-lpa