Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Zene
Beginner


Joined: 10 Jul 2002
Posts: 26
Location: Canada

PostPosted: 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..:)
Reply with quote
EdwinDroom
Wanderer


Joined: 25 Jan 2002
Posts: 77
Location: Ireland

PostPosted: 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
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: 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
Reply with quote
Zene
Beginner


Joined: 10 Jul 2002
Posts: 26
Location: Canada

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net