Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ MUSH Logging
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Merilyn
(1 post) Bio
|
Date
| Sat 28 May 2011 03:18 PM (UTC) |
Message
| Alright, so i'm /trying/ to make it on my logging file so that channels on the game are kept out of the log so that all I have is the RP log.
I'm using Mushclient 4.61 | Top |
|
Posted by
| Daniel P
USA (97 posts) Bio
|
Date
| Reply #1 on Sat 28 May 2011 06:57 PM (UTC) |
Message
| Look at Regexp for your main capture trigger. I don't remember the exact switch, but there is probably one to exclude certain substrings such as "Capture everything except something that starts with '(Public):' '(Newbie):' '<Faction>:'" or whatever.
Here's an example I found on StackOverflow:
rx = /^(?!apple$|orange$|juice$)/
Apparently (according to the request made) it matches all combinations of the three words, but does not match the single words themselves. So applejuice is matched, but apple is not, nor is juice. Someone who knows regexp better than me will have to verify and expound.
As for logging (they often wonder why I do it this way), my technique has been to take the triggered line and paste it into a Notepad window. So your trigger would be something like:
Match: Everything except (Public): * ..etc.
Send: WriteNotepad("eventLog","%0")
Then write a few aliases that will start and stop the log among others.
In the start one I usually do something like:
Match:log event
Send:WriteNotepad("eventlog","<timestamp code>")
An interim alias which stores a temporary title:
Match:event title *
Send:SetVariable("eventTitle","%1")
Then finally a finish and close alias:
Match:stop event log
Send:SaveNotepad ("eventlog", "c:/Program Files/MUSHClient/Logs/EL_"..GetVariable("eventTitle")..".txt", 0)
CloseNotepad(WorldName().." EventLog",0)
Also adding a few more aliases allows me to pause and unpause logging. This is just a matter of a few EnableTrigger() functions.
To be very honest, I've kind of put off learning regexp in detail, and my own event logger actually relies on matched colours. This way I can change the colour of channels to something that WON'T trigger and so they will be skipped.
Finally, I was just made aware of the f:write/f:save/f:close functions. And apparently this nullifies any real need for the Notepad. But I like the Notepad idea myself, just because I can make edits if needed. Or if I forget to start it before the RP begins, I can start the log, copy the previous text into the notepad and then rely on the plugin to take it from there. | Top |
|
Posted by
| Nick Gammon
Australia (23,057 posts) Bio
Forum Administrator |
Date
| Reply #2 on Sat 28 May 2011 11:59 PM (UTC) |
Message
| You can do it without regular expressions even, if the channel is simple (but you need a trigger per channel), eg.
Check "omit from log" and "keep evaluating". Also give it a low sequence, so it fires before other triggers.
More stuff about regular expressions:
|
Regular expressions
- Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
- Also see how Lua string matching patterns work, as documented on the Lua string.find page.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,504 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top