|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Mon Mar 03, 2003 1:33 am
Triggers Firing |
I'm not able to get two triggers to fire on the same line of text. I thought it was possible by setting the trigger options to "Prompt".
Is this correct or is there another way? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Mar 03, 2003 1:41 am |
It depends what you are doing to the text you are triggering on and
the priority of the two triggers. You may want one "ahead" of the other.
For example, if you are #SUB'ing text with one, the other must be ahead of it.
What mudoutput text and what are you wanting to do? You can many
triggers based on the same mudoutput.
Ton Diening |
|
|
|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Mon Mar 03, 2003 2:08 am |
Actually, what I am doing is fairly simply or at least I think it should be.
The text which I am triggering on are thoughts and I want to capture the thoughts into a seperate window. What really causes the problem is when a thought will span varing lines.
Example of text would be:
You sense the thoughts of XXXX, "A bunch of text would be here."
So, this is what I have for my triggers where I am trying to open and close a class to capture the text. The trigger opens the class but then never recognizes the quote at the end of the thought so it just keeps capturing text.
Here are my triggers.
#TRIGGER {^You sense the thoughts of} {
#CAPTURE 1 thoughts
#PLAY chimes.wav
#T+ Thoughts
} "" {notrig}
#CLASS {Thoughts}
#TRIGGER {^*"$} {
#T- Thoughts} "" {nocr|prompt}
}
#TRIGGER {*$} {
#CAPTURE 1 thoughts} "" {nocr|prompt}
}
#CLASS 0 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Mar 03, 2003 4:39 am |
" is normally used to enclose strings and is stripped from the pattern. Use ~ to instruct zMUD to treat it as a normal character.
I would expect all "thoughts" will terminate with newline characters, so there's no reason to use the prompt setting on either trigger.
You should probably reverse the order of the triggers in Thoughts. You wouldn't want to disable the class BEFORE the final capture.
#TRIGGER {^You sense the thoughts of} {#T+ Thoughts;#PLAY chimes.wav}
#CLASS {Thoughts} disable
#TRIGGER {*} {#CAPTURE 1 thoughts}
#TRIGGER {~"$} {#T- Thoughts}
#CLASS 0
LightBulb
Advanced Member |
|
|
|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Mon Mar 03, 2003 7:38 am |
Thanks for the help. It cleared up some problems I was having but I am still left with one small problem which goes back to having two triggers fire on the same line of text.
If I have a one line thought, the thought class is left enabled and all of the text from the mud is captured and just not the thought itself.
Any other suggestions would be greatly appreciated.
Thanks! |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Mon Mar 03, 2003 5:06 pm |
What version are you using? i seem to remember some versions having problems with multi triggers/one line. a solution would be to combine the two triggers into one:
#class Thoughts {disable}
#tr {*} {
#cap 1 thoughts
#if (%ends(%trigger, %char(34))) {#t- Thoughts}
}
#class 0
--note: %char(34) = "
--------
moon.icebound.net:9000 |
|
|
|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Mon Mar 03, 2003 7:06 pm |
I'm using version 6.16 and was thinking about updating to the latest public version.
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Mar 03, 2003 7:26 pm |
Delete your old triggers. The ones I gave you will disable the class when the line ends with ", whether it's the same line that enabled the class or not. Since the only #CAPTURE trigger is IN the class, capturing will stop when the class is disabled.
LightBulb
Advanced Member |
|
|
|
Oracle Apprentice
Joined: 29 May 2002 Posts: 121
|
Posted: Tue Mar 04, 2003 7:02 am |
Thanks for the help, I used a combination of both your ideas and finally got it to work out.
|
|
|
|
|
|