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 

detect nicks with excessive digits in it

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


Joined: 22 Mar 2015
Posts: 204

PostPosted: Wed Dec 07, 2016 1:23 pm    Post subject: detect nicks with excessive digits in it Reply with quote

is it possible to have this tcl check for digits like more than 6 digits anywhere in the nick

Code:
set badncks {
     "http:"
     "https:"
     "www."
     "fag"
     "aars"
     "whore"
     "ass"
     "anal"
     "puta"
   "[censored]"
   "gay"
   "rape"
   "fuk"
   "pussy"
   "porn"
   "p0rn"
   "sex"
   "s3x"
   "homo"
   "h0mo"
   "hom0"
   "h0m0"
}

set reasonnick "your nick is not allowed .... change your nick and reconnect ....thank you"

bind raw - NOTICE serv:connectnick


 
proc serv:connectnick {from key text} {
   if {[string match *!*@* $from]} {
      return 0; # not a server notice
   }
   if {![regexp -nocase { CONNECT: Client connecting on port (\d+) \(class (\S+)\): ([^!]+)!([^@]+)@(\S+) \(([0-9a-f.:]+)\) \[(.*)\]} $text -> port class nick ident host ip realname]} {
      return 0; # not a connect notice
   }
   foreach badn $::badncks {
      if {[string match -nocase *$badn* $nick]} {
         putquick "kill $nick :$::reasonnick"
         break
      }
   }
   return 0
}
Back to top
View user's profile Send private message
caesar
Ass Kicker


Joined: 14 Oct 2001
Posts: 3403
Location: Area 51

PostPosted: Thu Dec 08, 2016 2:09 am    Post subject: Reply with quote

Code:

if {[string length [regsub -all {[^0-9]} $nick ""]] > 6} {
   # do whatever
}

_________________
You may say anything about me, but don't misspell my name.
Back to top
View user's profile Send private message
simo
Master


Joined: 22 Mar 2015
Posts: 204

PostPosted: Thu Dec 08, 2016 4:43 pm    Post subject: Reply with quote

tested it and works fine thnx caesar
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