As for how I test it. I use a test world designed to connect to 127.0.0.1 port 1066 and a small program I wrote called Phantom, which fakes a proxy. Basically, instead of letting you connect through the proxy to another server, it simply takes anything sent through it and echoes it back to the client as input. This means you can simply type the line you are trying to match into the command box and it will be recieved as though from a mud. Other than some things like ansi codes, this is basically the same as connecting to a real mud and testing things there. You can find a copy of it at http://www.magnumsworld.com/muds where another player has been nice enough to host some of my stuff.
Now as to why it won't work. As I said, ^ means literally "the next character *must* be the first one on the line." If there is a space or anything else in front of 'INFO', it won't work. Obviously none of the others will either, because you keep changing the text, but your still telling it "This line should start with the following." Using ^ is "usually" safer, since without it someone could do:
OOC Fred: INFO: The gods shine upon Fred!
and it would fire anyway, even though this is obviously not when you want it to happen. But when you use ^ and $, you *must* make sure the stuff in between them is an 'exact' match to the line, including number of spaces, etc. For example, using the version of the trigger I gave you, this is what my test produces:
--- Connected on Sunday, March 20, 2005, 12:20 PM ---
IP list plugin started.
INFO: The gods shine upon Fred! <-command (success)
INFO: The gods shine upon Fred!
ooc Grats Fred <-command (from trigger)
ooc Grats Fred
INFO: The gods shine upon Fred! <-command (fails)
INFO: The gods shine upon Fred!
INFO: The gods shine upon Fred! <-command (fails)
INFO: The gods shine upon Fred!
INFO: The gods shine upon Fred! <-command (fails)
INFO: The gods shine upon Fred!
Just adding 1 or more spaces makes it completely fail. The only case that worked was the first one, which is immediately followed by the ooc command being sent out and recieved back. See what I mean? ;)
Basically, if it doesn't work, then its probably because you got the spacing wrong, its a appearing on a prompt line, or something else is making the line you said you wanted to match, and what is really arriving from the mud, different. It may even be a space at the 'end' of the line, so dropping $ from it could help. (Probably won't hurt anything anyway.) Oh, and you don't need the '\:', just use ':'. I tend to get confused if that is a 'special' character that needs to be forced into a normal one or not. It is used as a special, but only in things like :alphanumeric: or the like, just not where you need it. |