Triggering the last line

Posted by Neijel on Wed 03 Aug 2005 08:00 PM — 3 posts, 16,776 views.

#0
Hello everybody!

I'm not sure this is a bug, probably I'm missing something in the config options but, anyway, there it goes!

I've been having this weird problem with triggers when they have to match a pattern in the last line: they do match it, but only after a new line comes in. Let me give you an example, as I know it's quite confusing.

----------------------------------
[...]
You see exits leading north, southeast, south, and southwest.
4024h, 3568m exdb-
----------------------------------

I guess that's quite clear. The last line is the prompt. Now, I have a trigger that should be matching it and calling a vbscript function called GetPrompt().

The problem is that that function is not called when the prompt is written, but right after a new line comes. Then it matches it and calls the function.

I've tried changing colors instead of calling functions, just in case, but there's the same problem.. the line doesn't change until something happens, like:

------------------------------------

[...]
You see exits leading north, southeast, south, and southwest.
4024h, 3568m exdb-
Occasional raindrops fall on your head as the drizzle continues.
4024h, 3568m exdb-

-------------------------------------

In this case, the first promt would call the function as soon as "Occasional raindrops..." appeared, and the second prompt would stay there, like waiting.

This is the trigger:

Pattern: ^(.*)h\, (.*)m (.*)\-$
Send: GetPrompt %1, %2
Send to: Script

Optiones checked: Enabled, Keep evaluating, Regular expression.


I haven't been really worrying about it because, even if it doesn't really call the function right after getting the prompt, usually something else comes in before one or two seconds, but I'm trying to tune all the whole system and this is becoming a bit annoying.

Maybe it has something to do with wrapping? Is the pattern wrong? Any ideas?

Thanks in advance!

Neijel.
USA #1
this is an old problem actually which has quite a history on these boards. anyways, whats happening is that the IRE mud you are playing is not sending a newline, but IAC EOR. in order to remedy this get the latest version of MC, 3.66 isn't it?, and use that.

then under world options you will find a nice little check box called 'convert IAC EOR to newline' or something like that. check that, and your triggers will begin to match prompt lines immediately as they come in.

what you will also notice is a lot of extra whitespace. what i do is just have a regex trigger '^$' set to gag which i turn on during combat so i don't have a lot of extra spam. hope that helps!
#2
Thank you very much!

I already tried downloading the last version before asking, but I didn't check for new options, yep :-)

Thanks, really :-)