[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Convert text logs to color?

Convert text logs to color?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by forral   USA  (79 posts)  [Biography] bio
Date Sat 12 Feb 2011 12:40 AM (UTC)
Message
Hi all

I'm sorting through years' of MUD files and I have found a bunch of old .txt logs (mostly from Portal Client, but the logs are just generic, nothing client-specific).

I'd like to convert them to full-color HTML files, and I know it can be done but I'm not sure how. There is a website for the MUD I play that allows players to upload their logs (www.clanannwn.net) and I've asked the webmaster how it converts to color but I have not received a response.

Perhaps one of you lovely knowledgeable people will be able to guide me?

Thanks very much,
Forral
[Go to top] top

Posted by Daniel P   USA  (97 posts)  [Biography] bio
Date Reply #1 on Fri 08 Apr 2011 05:09 PM (UTC)
Message
I've not considered this...since it's possible to log straight to HTML from the beginning.

I'm sure the most straightforward way would be to open the text file in something like Word/OpenOffice, do a regexp search and replace with colored formatting. Except I don't have much of an idea of how to do that.

Another option might be to set up MUSHClient with triggers to change the output color for each line based on what the line is, and then somehow (??) parse the text files through MUSHClient line-by-line with the Simulate() function.

Or you could turn yourself into a zombie by manually converting every single file in a text editor. Actually, this might be easier than you'd think...a simple <body bgcolor="black">...</body> on the ends, and then <font face="courier" color="color-code"> for the beginning each line. Do one color at a time. It'd be fairly easy to spot similar lines just by scanning down, and hopefully your text editor would automatically move your cursor to the beginning of each line as you scroll down through.

I know it's not much of an answer, but it could be a starting point..
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] bio
Date Reply #2 on Fri 08 Apr 2011 09:10 PM (UTC)

Amended on Fri 08 Apr 2011 09:12 PM (UTC) by Twisol

Message
I've actually got an answer for you! :D Unfortunately, I won't have something I can give you until the end of the day (it's 1pm here). I'm writing a browser-based client, and the front-end is written in Javascript. I just need to finish migrating the ANSI parser itself (which seems to work fantastically) into the front-end, then I'll be able to extract the relevant parts into a web page you can use. :)

(I'm assuming you have raw logging enabled. If not, then all that's being logged is plain text, meaning the color information was totally lost. But raw logging will preserve the color info.)

EDIT: Oh, wait. The OP posted two months ago. I have some other things I should probably be doing instead, so if anyone out there does want this conversion utility, just poke me and I'll build it.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by forral   USA  (79 posts)  [Biography] bio
Date Reply #3 on Thu 05 May 2011 04:53 PM (UTC)
Message
Wow, this is an old thread of mine -_-

Twisol, the logs I have are from YEARS ago when I played on Portal (A 16-bit client with no support for HTML tagging or other functionality). All the logs are PLAIN .txt documents, with no HTML color codes or otherwise.

There is a website for the mud I play, www.clanannwn.net, which has the ability for players to upload .txt logs and it somehow parses and converts them to the correct colors for our specific mud. I haven't been able to talk to the website owner but I'd love to find some way of doing this
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Thu 05 May 2011 10:39 PM (UTC)
Message
Sounds like the way some editors syntax-colour C code. You just follow some rules. Say you make a regular expression that breaks up a line like this:


Nick says, "hi there".


So you might make "Nick" one colour, "says" another, and what he says a third.

Effectively it would be like trigger-matching. You would also detect stuff like combat messages, etc.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,821 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]