Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Glinka
Wanderer


Joined: 20 Dec 2000
Posts: 53
Location: USA

PostPosted: Mon Oct 28, 2002 5:25 am   

log file- better than #write to file?
 
I have a file that opens when ever I connect
to my MUD, and I write to the file alot.
What i'm wondering is this...

would it be better to use #log
than to use #write?...are there any pros/cons to this?

I was hoping to open a file and write
to it but also include the current time.
The #log file i use now adds the date to the
file name like so...

#LO @logname-%time( "mm-dd-yy").txt
but this adds the date to my character's
name and creates mulitple log files for each
date.

Would it be possible to just open the #log
with the @logname variable , and then add
the date-time info Inside the log?

also,
I'm not getting the info into the log,
can parameters do this?
******************************
example:
#tr........
(%w) offers you a (*)
value........
#lo @logname-offerings.txt
accept offer from %1
#lo
******************************
the script runs faster than the mud, so i lose the info.
can you do summin like
#lo @logname-offerings.txt
#say %1,%2,%time()
#lo
#echo and #say don't seem to capture
does #log only capture mud OUTput?
sorry, kinda lost here..
Thanx for any..
G.








Love, Lyte, and Laughter...
Glink
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Mon Oct 28, 2002 8:42 am   
 
#LOG is intended to create a logfile, which will automatically save everything that happens. The idea is that you open the file at the beginning of a session, write everything to the file, then close the file at the end of the session, thereby creating a log of the entire session. You can, of course, log shorter periods if desired. Some people don't want to log everything but might sometimes want to log something special, such as a wedding or a council meeting.

#WRITE is intended for writing things to a file one line (for files 1 to 5) or one record (for 6 to 10) at a time. Before using it, you need to open the desired file with the #FILE command.

Which is better depends on what you are creating the file for. If you just want a record of everything that happened, use #LOG. If you are trying to keep records of different types of actions, such as offers people make to you, #WRITE might be better. It is, of course, possible to do both (preferably with different filenames).

To just open the #LOG with the @logname, do precisely that:
#LOG @logname
or #LOG @{logname}.txt
You should then be able to add the time/date with the %time function or with your MUD's time/date commands (most MUDs have them).
#SHOW {%time()}
If #SAY and #ECHO don't go to your logs, try #SHOW. If that doesn't either, then check your Logging preferences and see if there's anything you can enable that might help.

LightBulb
Senior Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net