[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  MUSH Logging

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: MUSH Logging
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Sat 28 May 2011 11:59 PM (UTC)  quote  ]
Message
You can do it without regular expressions even, if the channel is simple (but you need a trigger per channel), eg.


match = "(chat)*"


Check "omit from log" and "keep evaluating". Also give it a low sequence, so it fires before other triggers.

More stuff about regular expressions:

Template:regexp 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
[Go to top] top

Posted by Daniel P   USA  (77 posts)  [Biography] bio
Date Sat 28 May 2011 06:57 PM (UTC)  quote  ]
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.
[Go to top] top

Posted by Merilyn   (1 post)  [Biography] bio
Date Sat 28 May 2011 03:18 PM (UTC)  quote  ]
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
[Go to top] 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.


842 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]