First off, you should use:
* punches you *
or a regular expression like:
^/w+ punches you
Which as long as you don't add $ to specify (end of line) will match anyway. It is also safer, since yours could match on:
Fred says: Methuselah punches you
Which is almost certainly not what you wanted. ;)
As to why no partial lines can be matched, as Nick has often explained, the design of the trigger system needs to know if the full line has arrived 'before' it can be 100% certain that a match has happened. Making it match on partial lines without a newline would require something sneaky to work right and may slow down the client slightly. Basically what happens now is this:
Packet> <Hello t>
Packet> <here!{Newline}>
Test> Hello - Match
Test> Hello fred! - Fail
Test> Hello there! - Match
Test> Go away! - Fail
To do what you want it would need to do:
Packet> <Hello t>
Test> all triggers, "Hello" matches.
Packet> <here!{newline}>
Test> all triggers, "Hello there!" matches.
This is possible, but requires testing at the arrival of every single data packet, not just when the newline arrives and you are 100% certain it is a complete line. The problem is when using "Omit From Output". When that is selected the client would have to automatically assume that you want the current behavior and only act on a complete line. Other things like scripts and such would then also 'require' the use of regular expressions that end with $ or a normal trigger that "doesn't" end with a * in order to work right in some existing cases where the complete line is needed. However, a new flag that specifies that the trigger should match a partial would fix that, since by default the triggers would work as they do now.
All in all, I am not sure how much retesting after the arrival of every new packet would slow stuff down. You can work around it currently if you design your trigger right though and the only 'major' issue is with coloring lines when there is lag. However, this would if introduced allow something that could do:
Match = "HP: 100/5000"
Send = "HP: Critical"
CustomColour = "Other"
OtherForeColor = "Red"
Regex = "y"
Sendto = "Replace"
Which is currently impossible, however it would mean that the contents would not be displayed until 'after' the triggers had all been run, while right now the line gets shown, then all the coloring and trigger stuff is done to it. This presents a slight mess, since in essence you would need to show each partial line as it arrived, but still have the client prepared to omit, color, or replace parts of or the entire line depending on what cropped up before the actual newline. And of course having the feature means it being used when better solutions exist,such as in your case, where a better match was needed, not a sloppier one. ;) |