Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ 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 page
Posted by
| forral
USA (79 posts) 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 | Top |
|
Posted by
| Daniel P
USA (97 posts) 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.. | Top |
|
Posted by
| Twisol
USA (2,257 posts) 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 | Top |
|
Posted by
| forral
USA (79 posts) 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 | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) 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:
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 | 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.
18,894 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top