Page 1 of 2
ZMUD Help: Log Script
Posted: Tue Jul 11, 2017 11:43 pm
by Lykan
Hi friends,
I've been re-making my zmud files since my hard drive crash and just discovered that my logging script is creating files, but not writing. When I go to open the file, it says "Cannot find the *insertfilelocation*.txt file. Do you want to create a new file?"
I know I've dealt with this before on a new computer, but cant remember how. Any suggestions?
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 12:07 am
by Maeglin
This is the script I use for Cmud. It might be compatable.
Code: Select all
#EVENT onConnect {#show LOGGING STARTED: %time(yyyymmd).txt
#log "C:\Users\insert-path-file-here\"%time(yyyymmdd).txt
}
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 9:57 am
by Taziar
That won't work for zMUD, zMUD doesn't use #EVENT.
Running zMUD as admin? Installed in different folder than program files?
*Edit for clarity*
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 12:57 pm
by Naerin
I'll post mine when I get home in ~6 hours.
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 2:08 pm
by Maeglin
Taziar wrote:That won't work for zMUD, zMUD doesn't use #EVENT.
Running it as admin? Installed in different folder than program files?
Well, hot damn. Didn't realize they had added extra triggers and such. My bad.
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 4:44 pm
by Taziar
Yeah, some different commands added and some were changed/depreciated. cMUD has the ability to make some older zMUD scripts work, but zMUD most likely will have a problem with stuff written for cMUD.
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 4:47 pm
by Naberius
#ALIAS startlog {#LOG Wotmud_%time( mmmddyy).log}
You can use any trigger or alias to start recording. For example:
#KEY F12 {startlog}
- starts loggin if you press F12.
#ALIAS atconnect {startlog}
- starts logging at soon as your "atconnect" alias goes. which always goes when you first login to the mud, as long as zmud is working correctly.
You could have something like this as well:
#TRIGGER {You receive your change from rent.} {startlog}
- this will start logging as soon as you unrent any character.
This will create log files in the root folder and should work with zmud, since it's what i've used and I've had this for like ever. It can get more complicated for that, and it's not in a beautiful "paste-in" script format, but if you're using zmud, I suggest you learn enough to at least learn where to put these lines of code. I'm sure Taziar can pretty it up and make it user friendly.
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 5:18 pm
by Naerin
#CLASS {Logging}
#ALIAS setuplogging {
#VARIABLE PathToCurrentLog {%concat( @PathToLog, %time( yyyymmdd), ".txt")}
#LOG @PathToCurrentLog
}
#ALIAS readlog {#LAUNCH {notepad.exe @PathToCurrentLog}}
#ALIAS gologs {#IF (@PathToLog ="") {#LAUNCH {explorer ..\wotMUD}} {#LAUNCH {explorer @PathToLog}}}
#ALIAS logpath {
#VARIABLE PathToLog {%1}
#IF (@PathToLog ="") {#VARIABLE PathToLog {}} {
#IF (%numparam( ) > 1) {#LOOP 2,%numparam( ) {#VARIABLE PathToLog %concat( @PathToLog, " ", %param( %i))}}
#IF (NOT %ends( @PathToLog, "\")) {#VARIABLE PathToLog {%concat( @PathToLog, "\")}}
}
setuplogging
#NOOP
}
#VAR PathToLog {}
#VAR PathToCurrentLog {20170712.txt}
#TRIGGER "SetupLoggingAtMUDLogon" {^%sMichael Seifert, and Sebastian Hammer$} {setuplogging}
#CLASS 0
Re: ZMUD Help: Log Script
Posted: Wed Jul 12, 2017 5:50 pm
by Sanguine
FWIW here is mine (for CMUD), it creates only a single log for each day upon connection. Also turns tick timer on:
Code: Select all
#event OnConnect {
#LOG D:\username\My%char(32)Documents\Games\WoTMUD\Logs\CMUD\%time("yyyymmdd").txt
#timer 1}
#event OnDisconnect {#LOG 0
#timer 0} "AliasesMacros"
Re: ZMUD Help: Log Script
Posted: Thu Jul 13, 2017 11:14 am
by Lykan
Thanks all - I'd apparently already fixed this with switching on "run as admin" but didn't realize it. Sorry :p
Side note - my zmud crashes sometimes and I will lose any changes I've made since last time I opened it (which is usually weeks at least). If I manually close it, changes save fine. It seems like if I manually save settings, sometimes it will save and sometimes it won't. Any advice other than regularly close/re-open?