egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Correct accidental single wildcard character banmasks

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Aug 04, 2022 9:57 am    Post subject: Correct accidental single wildcard character banmasks Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Aug 04, 2022 10:08 am    Post subject: Reply with quote

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
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1058
Location: France

PostPosted: Thu Aug 04, 2022 10:21 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Aug 04, 2022 10:24 am    Post subject: Reply with quote

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
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Aug 04, 2022 10:24 am    Post subject: Reply with quote

oh euhm yes it is CrazyCat
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Thu Aug 04, 2022 10:28 am    Post subject: Reply with quote

tested your posted code and it seems to work as expected thanks CrazyCat
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Fri Aug 05, 2022 4:01 pm    Post subject: Reply with quote

i tested again and found it also removes banmasks like :

Quote:

*mwf*u*!*@*


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
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 809
Location: Tennessee, USA

PostPosted: Fri Aug 05, 2022 4:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 969

PostPosted: Fri Aug 05, 2022 5:04 pm    Post subject: Reply with quote

Thanks SpiKe^^ that seems to work as expected

thanks CrazyCat as well
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber