Trigger with "omit from output" checked still displays CR/LF (?)

Posted by Jcampbell20 on Tue 01 Oct 2002 11:36 PM — 12 posts, 41,195 views.

#0
Hello folks.

I'm trying to create a trigger that matches an incoming line and then does nada, no output sent anywhere, no replacing of anything, no script execution, nothing.

To do that I tried setting a trigger to (for example) match "* enters." and checked the "omit from output" option. The trigger matches ok, no visible text is displayed, however, the display area still scrolls. It looks like LF/CR are still being sent to the display even though no visible text is.

Is this a bug?

Thanks,
Jerry



Canada #1
Try clicking the button (in the trigger edit screen) called "Convert to regular expression" (or something like that). Leave the ^ and $ which signify start and end of line respectfully. That may solve your problem.
Australia Forum Administrator #2
Your original trigger should have worked, however check you haven't inadvertently put a newline into the "Send" box. Put the cursor there and hit "delete" key a few times.

Also, the screen will briefly scroll because the line is displayed before the trigger is evaluated, however apart from a slight flicker you should not be getting blank lines.
#3
Actually, I'm having the same problem. I just recently made a batch of triggers to gag a really spammy mob and I get carriage returns whenever the triggers go off. I have checked to be sure I'm not sending anything so I have no idea what the problem is.

Basically, this mob has a prog that makes him do stuff everytime he enters the room. So I get something like this:


<100hp 100m 100mv>
The page arrives from the west.
The page bows.
The page asks 'Does anyone need anything?'

<100hp 100m 100mv>
The page leaves east.


When the triggers go off I get this:

<100hp 100m 100mv>

<100hp 100m 100mv>

<100hp 100m 100mv>


I have all the triggers set up, in the form:
^The page arrives from (.*?)\.$

Yes, regular expression is checked, and no, I'm not sending anything (or I shouldn't be anyway. I've checked). Any ideas?
Australia Forum Administrator #4
Judging by your output it is working as designed. However you have a blank line, see here ...


<100hp 100m 100mv>
The page arrives from the west.
The page bows.
The page asks 'Does anyone need anything?'
<-- blank line here remains 
<100hp 100m 100mv>


You could make a trigger to omit blank lines. Make sure you check under global preferences "regular expressions can match on an empty string". The regexp would be:

^$
Australia Forum Administrator #5
Of course, you will still get the prompts. You could conceivably set a flag (using a script) and then after the trigger goes off, omit the next prompt that follows.
Greece #6
No, they're right. MUSHClient still sends a CR/LF to the MUD. The line you're pointing at is user configurable from the MUD (on SMAUG servers it's config +blank), and sends a blank line before the prompt.
I have tried to omit from output, and it DOES send a CR/LF. My guess though would be that, although it evaluates the entire line (together with the prompt) as part of the trigger, and removes them all, it doesn't consider the CR/LF as part of the text to be matched, and sends that to the output, thinking that the user didn't want to omit that.
Australia Forum Administrator #7
A blank line before the prompt effectively makes a new line. MUSHclient matches on lines not groups of lines.
Greece #8
Ahh, now i understand what you mean... Is it possible to use the multiline edit bot ox MUSHClient to make it match on multiple lines? It would be very useful, since MUDs have the option of displaying multi-line prompts...
#9
I didn't realize that "config +blank" would make a difference. So I've been playing with it and found that the only thing that really works is going "config -blank" and having a trigger that omits my prompt from the output. However, this squishes my output and makes it hard to read. Oh, well, thanks anyway, Nick.
Australia Forum Administrator #10
Quote:

Is it possible to use the multiline edit bot ox MUSHClient to make it match on multiple lines?


It is hard to design a trigger that will match on multiple lines. At present the newline character is a logical place to do trigger matching. For instance, with the following lines:

a
b
c
d

What would you send to trigger matching? a/b? a/b/c? b/c? a/b/c/d? b/c/d? You see what I mean?

I think in the earlier problem, you could have a trigger that omits a blank line, as I suggested, and enable that trigger when you get the annoying player trigger match, and disable that trigger when the next prompt arrives. That way you only omit the relevant blank lines.
Greece #11
Hmm, yes, you have a point... You'd either have to pass it character by character or pass all the different combinations, which is almost impossible...