|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: Wed Jul 31, 2002 12:14 am
Capturing multiple lines? |
Hi I was wondering if/how I would be able to make a trigger that allows me to start logging when triggered and then stop logging when triggered again. (or even an alias can begin logging but then it has to be a certain trigger that ends the logging)
For example:
i want it to start logging when it sees:
You chant the words, 'rlhgx hekmuehyrhogfu.'
and then capture the contents between the previous lines until it reaches this line:
[Reply: (*)
which is my prompt..
does anyone have any idea?
I hope to append all that captured text to a text file...but more on that later..:) |
|
|
|
EdwinDroom Wanderer
Joined: 25 Jan 2002 Posts: 77 Location: Ireland
|
Posted: Wed Jul 31, 2002 2:01 am |
from help files:
LOG
Syntax: #LO [filename] [new]
Given a filename parameter, this command creates a logfile with the specified file name. If the file already exists, it is opened for appending. If the file does not exist, it is created. If the filename is omitted, then the logging flag is toggled.
If you open an existing log file, the results will be appended unless you specify "new" as the second parameter in which case a new log file is created.
LOG examples
#LO test.txt
start logging all input from the MUD to the file test.txt
#LO
toggle the logging flag.
So, if you use an alias
#ALIAS {lognow} {#LO mylogfile.txt}
Then
#TR {~[Reply: (*)} {#LO}
"I've got an allergy to Perrier, daylight and responsibility" - Marillion
Check out Moral Decay on 131.247.113.1 3003 |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Wed Jul 31, 2002 3:09 am |
The problem with #TR {~[Reply: (*)} {#LO} is that it will toggle logging after each and every prompt shows up. Also, you have said [Reply: (*) is your prompt. Since you didn't say otherwise, I'm assuming that it actually has the [, (, * and ) characters in it.
Something like is probably what you need:
#trigger {You chant the words, 'rlhgx hekmuehyrhogfu.'} {#log mylogfile.txt;#temp {~[Reply: ~(~*~)} {#log}}
- Charbal |
|
|
|
Zene Beginner
Joined: 10 Jul 2002 Posts: 26 Location: Canada
|
Posted: Wed Jul 31, 2002 5:33 pm |
Sounds great! Charbal, good call. The temp would have been easier than toggling the class on and off which is what i was going to do :) Thanks for the help guys.
|
|
|
|
|
|