Gaging whole line via packet filtering

Posted by Lisev on Thu 13 Jan 2005 06:14 PM — 5 posts, 20,876 views.

Poland #0
I've done this:

Function OnPluginPacketReceived (s)
dim RegExp, Match
Set regEx = new RegExp
regEx.Pattern = "^.+ (?:smiles|laughts)\.$"
regEx.Global = True
regEx.Multiline = True
Match = regEx.Replace(s, "")
OnPluginPacketReceived = Match
end function

To gag lines, but it it doesn't erese whole line it just converts it into blank line. Anyone has an idea how to remove the line completely?
I've tried adding \n, \r and other combinations i could think of in regEx.Pattern in the end but then it didn't match the text at all.

Lisev
USA #1
If youre gagging a complete line, why don't you just use a trigger?
Poland #2
Because it generates gigantic lag and mushclient freezes.
I did a test of speed. Without about 20 gaging triggers it processed 2000 lines in about 2,9 sec. With gaging triggers time raised to about 18,5 secs
Poland #3
And did you check if packet filtering is faster?
Australia Forum Administrator #4
For one thing I would try to use the Lua version of the OnPluginPacketReceived. That uses the internal PCRE regexp matcher and not the one from VBscript. That might work better.

Also, the speed should be *much* faster than that for trigger handling. There is no way that 20 triggers should take 18 seconds to process 2000 lines, unless you are running on an extremely slow PC, or there is something seriously wrong with the match expression in the trigger.

Can you post a couple of the triggers, and a sample of the line it is matching?

In the trigger configuration window for each trigger you can see how much time it takes to match. I pumped about 1000 lines through and one of my triggers (like yours) only took 0.001 seconds of match time.