View previous topic :: View next topic |
Author |
Message |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Thu Aug 04, 2022 9:57 am Post subject: Correct accidental single wildcard character banmasks |
|
|
Greetz gentz,
im wondering how to detect a single character banmask with wildcard like :
Quote: |
+b *a*!*@*
+b *b*!*@*
+b *c*!*@*
+b *1*!*@*
+b *2*!*@*
+b *3*!*@*
+b *{*!*@*
+b *}*!*@*
or any single character banmask with wildcard really
|
|
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Thu Aug 04, 2022 10:08 am Post subject: |
|
|
i tried this but it seems to unset every ban regardless:
Quote: |
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" }
}
|
|
|
Back to top |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1058 Location: France
|
Posted: Thu Aug 04, 2022 10:21 am Post subject: |
|
|
The character is alway in the nick part ?
Code: | if {[regexp {\*([^\*!@]{1})\*!\*@*} $ban]} {
pushmode $chan -b $ban
} |
_________________ https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community. |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Thu Aug 04, 2022 10:24 am Post subject: |
|
|
this seems working but im not sure if its proper :
Code: |
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" }
} |
|
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Thu Aug 04, 2022 10:24 am Post subject: |
|
|
oh euhm yes it is CrazyCat |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Thu Aug 04, 2022 10:28 am Post subject: |
|
|
tested your posted code and it seems to work as expected thanks CrazyCat |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Fri Aug 05, 2022 4:01 pm Post subject: |
|
|
i tested again and found it also removes banmasks like :
while we only wanted it to trigger on a single banmask character like:
Quote: |
+b *a*!*@*
+b *b*!*@*
+b *c*!*@*
+b *1*!*@*
+b *2*!*@*
+b *3*!*@*
+b *{*!*@*
+b *}*!*@*
or any single character banmask really
|
|
|
Back to top |
|
 |
SpiKe^^ Owner

Joined: 12 May 2006 Posts: 809 Location: Tennessee, USA
|
Posted: Fri Aug 05, 2022 4:29 pm Post subject: |
|
|
Code: | regexp {^(\*).(\*)!(\*)@(\*)$} $ban |
_________________ SpiKe^^
Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
. |
|
Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 969
|
Posted: Fri Aug 05, 2022 5:04 pm Post subject: |
|
|
Thanks SpiKe^^ that seems to work as expected
thanks CrazyCat as well |
|
Back to top |
|
 |
|