This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Remove spaces from script

Old posts that have not been replied to for several years.
Locked
I
Illidan
Voice
Posts: 27
Joined: Sat Oct 26, 2002 1:49 am

Remove spaces from script

Post by Illidan »

I'm using no!spam and recently i see that some users are getting smart to actually making use of spaces to spam which will make the script undetectable. So how should I go about removing those spaces?
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is a major problem, and drawback of the script.

There is no simple way of making this detection, without adding code that will slow the bot down even more.

By taking a string, you can remove the spaces with one of these two

Code: Select all

set string [join [split $string] {}]

regsub -all -- " " $string "" string
However, this will prevent some of the better matching strings.

IE
using "*join #*" would no longer be valid, as there is a space in the string, which would never be there.

There is one possibility, of using new matching code, but this does not exist as of yet.

The current wildcards, are those of the Tcl "string match" command. These are * and ? (there is a third, which wouldn't work in this situation either, though is perfectly valid for a match, these can be looked at in detail at this page).

Eggdrop provides it's own matching system (uses the * and ?, plus two others % and ~. These are documented at the base of tcl-commands.doc), though this is still not suffiecient for this kind of matching.

It would need to be a new char, that would have one of the following matching properties
Match 0 or 1 characters of any type.
This would require that a second match take place, to determine in the matching character is a infact a space.
Match 0 or 1 whitespaces
This would be the better solution, as it would only require one match.

Tcl would simply not be fast enough to process such matching, and it would need implimentation is C.
Locked