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


Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  Log file tricks

Log file tricks

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


Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Sat 20 Sep 2003 09:16 PM (UTC)
Message
OK, hmm, this is what I want to do. I have MC log the output of the MUD in an .html file and have an http server point at it, so that people can see what i am doing (I call it MudTV :P). I am having 2 problems:
1) MC only updates the logfile in intervals, or when it gets enough data. Is there a way that i can forcefully update the logfile, like calling LogClose and OpenLog whenever a line comes in?
2) I need to limit the buffer, because it can get very large very fast, and if 2-3 people are looking at it (it refreshes, too) my connection is lagged a lot. Is there a way to make it write the last X lines? What i'm thinking is something like a timer that writes the last X lines to a file, possibly omitting built-in logging, but wouldn't that log in plaintext only? How can i do that and log in HTML?
Any help would be appreciated, i don't need the entire script :p

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Sat 20 Sep 2003 09:23 PM (UTC)
Message
I tried doing a:
CloseLog
OpenLog "I:\Exp\Xitami\webpages\feed\index.html", True
But the log won't open, the log button on the bar is still disabled.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (23,042 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sun 21 Sep 2003 10:41 PM (UTC)
Message
Quote:

What i'm thinking is something like a timer that writes the last X lines to a file, possibly omitting built-in logging, but wouldn't that log in plaintext only? How can i do that and log in HTML?


You could make that timer write in HTML easily enough.

For a start, check out:

http://www.gammon.com.au/scripts/doc.php?function=FixupHTML

This lets you convert < and > characters into &lt; and &gt; etc. which will fix up obvious problems in trying to write HTML. Then you would need a suitable HTML header (the log file generation supplies one) with <pre> and <code> tags, thus preserving formatting.

With only a couple of lines of code you could do an HTML log that writes a black-and-white log in HTML. If you want to preserve colours it will be harder, but check out the ANSI log plugin for a method of "walking" the style runs for each line. You could modify that to output the correct colour codes each time a style colour changed.

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #3 on Sun 21 Sep 2003 11:20 PM (UTC)
Message
Right now it's not even opening the logfile though...

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (23,042 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Sun 21 Sep 2003 11:48 PM (UTC)
Message
I meant by opening your own text file - there are examples here somewhere.

- Nick Gammon

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

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #5 on Sun 31 Oct 2004 08:21 PM (UTC)
Message
Bump! If anyone's interested, I've created a program that will allow you to stream your MUD connection to other users in real time (i.e. they will see what you see) with a minimal bandwidth hit (I can stream 30-40 connections with my 56k modem). The program is called Snoop, it's on the downloads page of www.poromenos.org and there's a tutorial at the wiki.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[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.


13,920 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]