Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Gaging whole line via packet filtering

Gaging whole line via packet filtering

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Lisev   Poland  (8 posts)  Bio
Date Thu 13 Jan 2005 06:14 PM (UTC)
Message
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
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Thu 13 Jan 2005 06:31 PM (UTC)
Message
If youre gagging a complete line, why don't you just use a trigger?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Lisev   Poland  (8 posts)  Bio
Date Reply #2 on Fri 14 Jan 2005 10:36 AM (UTC)
Message
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
Top

Posted by Scypio   Poland  (50 posts)  Bio
Date Reply #3 on Fri 14 Jan 2005 05:25 PM (UTC)
Message
And did you check if packet filtering is faster?
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #4 on Sat 15 Jan 2005 10:01 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


15,893 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.