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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » Finished MUD Scripts
illyism
Wanderer


Joined: 09 Dec 2007
Posts: 58

PostPosted: Mon Mar 31, 2008 7:30 pm   

Autologger
 
This is an autologger I made, with the commands LOGS, you get a pop-up window giving you further commands.

SETSTARTLOG <first text after password entry>
LOGS gives you a list of the other commands.

Code:
#CLASS {autologger}
#ALIAS StartTodayLog {#log %time( dd-mm-yy-hh-mm).txt;#additem loglist %time( dd-mm-yy-hh-mm).txt}
#ALIAS logs {#PICK {p:What log you do you want to view?} {list the logs:#echo copy the log you want to view to your clipboard and enter viewlogs;#forall @loglist {#echo %i}} {View Log in clipboard:viewlogs} {view last log:lastlog} {About:#echo This was made, written and coded by Illyism.}}
#ALIAS viewlogs {#WIN logreader read %clip}
#ALIAS lastlog {#var lognums %numitems( @loglist);#win logreader read %item( @loglist, @lognums)}
#ALIAS Setstartlog {#class autologger;#tr {%-1} {starttodaylog};#class 0}
#VAR loglist ""
#var lognums ""
#CLASS 0

correct me if you see any errors.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 31, 2008 7:46 pm   
 
If I were you, I'd use a static trigger for starting the log and change a variable with the SetStartLog trigger which is used in the pattern of that trigger. You might also want an alarm to change the date at midnight.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
illyism
Wanderer


Joined: 09 Dec 2007
Posts: 58

PostPosted: Mon Mar 31, 2008 9:04 pm   
 
I've forgotten to add, you'll need to run this manually(I don't know any other way).

#win logreader
#tr {read (*)} {#read %1}
Reply with quote
jlatessa
Newbie


Joined: 23 Dec 2007
Posts: 3

PostPosted: Thu May 15, 2008 6:10 pm   autologger
 
I'm looking for something to auto-log and change log files on a new date without having to reinstate the session.

Would this script work in such a fashion?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu May 15, 2008 9:14 pm   
 
Nope. Auto-logging is really simple:

#trig {some message you recieve at login, preferably after your password} {#log %concat(C:\yourlogpathhere\yourlognamehere-",%time(yyyy-mm-dd),".txt")}

then you have a couple of options for updating the log date. If your MUD has a message for when it's midnight, change the above to

#trig {{some message you recieve at login, preferably after your password|midnight message}} {#log %concat(C:\yourlogpathhere\yourlognamehere-",%time(yyyy-mm-dd),".txt")}

If it doesn't use this as well as the first trigger:

#alarm 00:00:00 {#log %concat(C:\yourlogpathhere\yourlognamehere-",%time(yyyy-mm-dd),".txt")}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Tue May 20, 2008 7:57 pm   
 
As an alternative, I use an #ALIAS of atconnect, which will start logging upon connection to the server. Not recommended if the server displays your password in clear text, though.

Code:
#ALIAS atconnect {#LOG %concat("C:\Documents and Settings\Administrator\Desktop\logs\", %time("yyyy-mm-dd"), ".txt")}


Used above with the #ALARM Fang posted, could work well.
_________________
Citrus: The Juicy Alternative
Reply with quote
trancelf
Newbie


Joined: 01 Sep 2008
Posts: 1

PostPosted: Wed Jun 03, 2009 3:48 pm   I found I had to use quotes in CMUD 2.37
 
Just an update I found using CMUD 2.37.

I found the below listed trigger wouldn't fire correctly until I added quotes like Qaiia has in her code example.

Quote:

[quote="Fang Xianfu"]Nope. Auto-logging is really simple:


Code:
#trig {some message you recieve at login, preferably after your password} {#log %concat(C:\yourlogpathhere\yourlognamehere-",%time(yyyy-mm-dd),".txt")}


Changed to:
Code:

#trig {some message you recieve at login, preferably after your password} {#LOG %concat("C:\yourlogpathhere\yourlognamehere-",%time("yyyy-mm-dd"),".txt")}


After adding quotes it worked!
Thanks for the autolog code you two!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » Finished MUD Scripts 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