|
illyism Wanderer
Joined: 09 Dec 2007 Posts: 58
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
illyism Wanderer
Joined: 09 Dec 2007 Posts: 58
|
Posted: 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} |
|
|
|
jlatessa Newbie
Joined: 23 Dec 2007 Posts: 3
|
Posted: 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? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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")} |
|
|
|
Qaiia Wanderer
Joined: 06 Apr 2007 Posts: 59
|
Posted: 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. |
|
|
|
trancelf Newbie
Joined: 01 Sep 2008 Posts: 1
|
Posted: 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! |
|
|
|
|
|