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.

Banmask problem

Old posts that have not been replied to for several years.
Locked
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Banmask problem

Post by Reynaldo »

any1 can help about banmask *!*user@*.domain
my script allways set mode *!*~user@host.domain
ex my script:
set bannick($nick) "*!*$uhost" #will ban like "*!*~user@host.domain"
i want it be "*!*user@*.domain" or "*!*user@222.222.222.* or "nick!*user@*.domain
Please help! :cry:
User avatar
Linux
Halfop
Posts: 71
Joined: Sun Apr 04, 2004 4:20 pm
Location: Under The Sky

Post by Linux »

To set BAN like *!*ident@*.domain.com you have to set banmask as follow:

Code: Select all

*!*[lindex [split [maskhost $uhost] "!"] 1]
-REGARDS-
I'm an idiot, At least this one [bug] took about 5 minutes to find...
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You will also need to trim the '~' from the ident. This should do it:

Code: Select all

*!*[string trimleft [lindex [split [maskhost $uhost] "!"] 1] ~]
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Post by Reynaldo »

how to set BAN like *!*@*.domain ?

Code: Select all

*!*[lindex [split [maskhost $mhost] "!"] 1]
i can set like that?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Reynaldo wrote:how to set BAN like *!*@*.domain ?
Can't READ? Your query was answered. :P
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Reynaldo wrote:how to set BAN like *!*@*.domain ?

Code: Select all

*!*[lindex [split [maskhost $mhost] "!"] 1]
i can set like that?
no that will ban *!*~ident@*.domian

if you want to ban *!*@*.domain, use this:

Code: Select all

*!*@[lindex [split [maskhost $uhost] @] 1]
You can use the proc from this thread by user, it'll be much easier for you.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Sir_Fz wrote:You will also need to trim the '~' from the ident. This should do it:

Code: Select all

*!*[string trimleft [lindex [split [maskhost $uhost] "!"] 1] ~]
maskhost doesnt use ~, because ~ would match 1 or more white spaces, but never ? literally. instead it will give you an ? witch matchs knowingly any single character.

so imho the easiest way for *!*ident@*.host is:
*!*[string trimleft [maskhost $uhost] *!?]

ex:
tcl: evaluate (.tcl): return *!*[string trimleft [maskhost ~ident@my.host.com] *!?]
Tcl error: *!*ident@*.host.com
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

if strict-host is set to 0, maskhost will return *!*ident@host
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

.tcl maskhost ~ident@host.doms.net
Tcl: *!*ident@*.doms.net
It does the job by itself, no need to trim any ~ or ? ... Interresting how we find out :P

So to get *!*ident@*.domain, use

Code: Select all

[maskhost $uhost]
R
Reynaldo
Halfop
Posts: 54
Joined: Wed May 11, 2005 2:51 am

Banmask problem

Post by Reynaldo »

:arrow: Thank's for you guys :o
Locked