ZMUD Help: Log Script

... A place to ask for help on any topic whether it be starting out to player killing to IT issues.
Lykan
Posts: 269
Joined: Fri Mar 20, 2015 6:14 pm

ZMUD Help: Log Script

Post by Lykan » Tue Jul 11, 2017 11:43 pm

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?

Maeglin
Posts: 76
Joined: Wed Apr 15, 2015 9:47 pm

Re: ZMUD Help: Log Script

Post by Maeglin » Wed Jul 12, 2017 12:07 am

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
}

Taziar
Posts: 961
Joined: Sat Mar 21, 2015 10:28 pm

Re: ZMUD Help: Log Script

Post by Taziar » Wed Jul 12, 2017 9:57 am

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*

Naerin
Posts: 313
Joined: Sat May 23, 2015 12:29 pm

Re: ZMUD Help: Log Script

Post by Naerin » Wed Jul 12, 2017 12:57 pm

I'll post mine when I get home in ~6 hours.

Maeglin
Posts: 76
Joined: Wed Apr 15, 2015 9:47 pm

Re: ZMUD Help: Log Script

Post by Maeglin » Wed Jul 12, 2017 2:08 pm

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.

Taziar
Posts: 961
Joined: Sat Mar 21, 2015 10:28 pm

Re: ZMUD Help: Log Script

Post by Taziar » Wed Jul 12, 2017 4:44 pm

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.

Naberius
Posts: 67
Joined: Tue Jul 19, 2016 4:18 pm

Re: ZMUD Help: Log Script

Post by Naberius » Wed Jul 12, 2017 4:47 pm

#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.

Naerin
Posts: 313
Joined: Sat May 23, 2015 12:29 pm

Re: ZMUD Help: Log Script

Post by Naerin » Wed Jul 12, 2017 5:18 pm

#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

Sanguine
Posts: 357
Joined: Thu Oct 08, 2015 9:48 pm

Re: ZMUD Help: Log Script

Post by Sanguine » Wed Jul 12, 2017 5:50 pm

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"

Lykan
Posts: 269
Joined: Fri Mar 20, 2015 6:14 pm

Re: ZMUD Help: Log Script

Post by Lykan » Thu Jul 13, 2017 11:14 am

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?

Post Reply