EnglishGermanFrenchRussianPolishItalianSpanish
Log inRegister
 
Loog book extraction (script or savegame reading, whatever)
Post new topic Reply to topic
View previous topic :: View next topic
Author Message
Kitty



MEDALMEDALMEDAL

Joined: 05 Sep 2005
Posts: 263 on topic

Thank you for registering your game
PostPosted: Mon, 4. Sep 17, 21:14    Post subject: Loog book extraction (script or savegame reading, whatever) Reply with quote Print

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,

Back to top
View user's profile Send private message
Joubarbe





Joined: 31 Oct 2006
Posts: 2566 on topic
Location: France
Thank you for registering your game
PostPosted: Mon, 4. Sep 17, 21:36    Post subject: Reply with quote Print

Hello


_________________
Mayhem - Satellites Monitoring - Internal Distribution Network - ADS (Joubarbian Edition) - Bounty Board - The Joubarbian Toolkit - EasyConnect
Back to top
View user's profile Send private message
Kitty



MEDALMEDALMEDAL

Joined: 05 Sep 2005
Posts: 263 on topic

Thank you for registering your game
PostPosted: Sun, 17. Sep 17, 09:43    Post subject: Reply with quote Print

Joubarbe wrote:
Hello


Allo Joubarde. An idea of the answer ?

Back to top
View user's profile Send private message
lostProfitssssArrgh





Joined: 22 Aug 2017

Location: Unknown Sector(23,19)

PostPosted: Tue, 19. Sep 17, 13:53    Post subject: Reply with quote Print

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 Smile


Code:
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

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

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic Reply to topic
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Control Panel
Login Data
The time now is Tue, 19. Sep 17, 22:38

All times are GMT + 2 Hours


Board Security

Copyright © EGOSOFT 1989-2017
Powered by phpBB © 2001, 2005 phpBB Group
Template created by Avatar & BurnIt!
Debug: page generation = 0.17152 seconds, sql queries = 18