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.

Correct accidental single wildcard character banmasks

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Correct accidental single wildcard character banmasks

Post by simo »

Greetz gentz,

im wondering how to detect a single character banmask with wildcard like :


+b *a*!*@*
+b *b*!*@*
+b *c*!*@*
+b *1*!*@*
+b *2*!*@*
+b *3*!*@*
+b *{*!*@*
+b *}*!*@*

or any single character banmask with wildcard really

s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tried this but it seems to unset every ban regardless:
bind mode - "* +b" correct:single-char-banmask

proc correct:single-char-banmask {nick uhost hand chan mc ban} {
if {[string match "\*?\*!*@*" $ban]} { putnow "mode $chan -b $ban" }
}
Online
User avatar
CrazyCat
Revered One
Posts: 1216
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

The character is alway in the nick part ?

Code: Select all

if {[regexp {\*([^\*!@]{1})\*!\*@*} $ban]} {
   pushmode $chan -b $ban
}
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

this seems working but im not sure if its proper :

Code: Select all

bind mode - "* +b" correct:single-char-banmask

proc correct:single-char-banmask {nick uhost hand chan mc ban} {
      if {[regexp -nocase {(\*).(\*)!(\*)@(.*)}  $ban]} { putnow "mode $chan -b $ban" }
}
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

oh euhm yes it is CrazyCat
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

tested your posted code and it seems to work as expected thanks CrazyCat
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

i tested again and found it also removes banmasks like :
*mwf*u*!*@*
while we only wanted it to trigger on a single banmask character like:


+b *a*!*@*
+b *b*!*@*
+b *c*!*@*
+b *1*!*@*
+b *2*!*@*
+b *3*!*@*
+b *{*!*@*
+b *}*!*@*

or any single character banmask really
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Code: Select all

regexp {^(\*).(\*)!(\*)@(\*)$} $ban
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

Thanks SpiKe^^ that seems to work as expected

thanks CrazyCat as well
Post Reply