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 

[Solved] nick too long

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


Joined: 04 Dec 2018
Posts: 24
Location: Italy

PostPosted: Sat Jan 30, 2021 7:30 pm    Post subject: [Solved] nick too long Reply with quote

is it possible to ban a nick that exceeds a certain number of characters (eg 10 or 11)?

Last edited by Carlin0 on Sun Jan 31, 2021 7:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sun Jan 31, 2021 12:49 am    Post subject: Reply with quote

Try this: http://forum.egghelp.org/viewtopic.php?p=5384

And of course you can ban too long nicks from joining channel all together like +b ?????????*!*@*
Back to top
View user's profile Send private message
Carlin0
Voice


Joined: 04 Dec 2018
Posts: 24
Location: Italy

PostPosted: Sun Jan 31, 2021 4:48 am    Post subject: Reply with quote

simo wrote:
Try this: http://forum.egghelp.org/viewtopic.php?p=5384



this works, but it only kicks and you risk making the bot work too much, I would have preferred a ban .
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sun Jan 31, 2021 10:57 am    Post subject: Reply with quote

try this:

Code:

set max_nick_len 10

bind join - * nick_join
bind nick - * nick_change



proc nick_join {nick uhost hand chan} {
  global botnick max_nick_len
   if {![botisop $chan]} { return 0 }
   if [isbotnick $nick] { return 0 }
        if {[string length $nick] > $max_nick_len} {
        pushmode $chan +b [maskhost $uhost 2]
        putkick $chan $nick "Your nickname is too long! use $max_nick_len characters or less"
 }
}


proc nick_change {nick uhost hand chan newnick} {
    if {![botisop $chan]} { return 0 }
    if [isbotnick $newnick] { return 0 }
        nick_join $newnick $uhost $hand $chan
}



as i mentioned u can block excessive use of chars with 1 banmask

like:
Quote:
+b ??????????*!*@*


this saves u the trouble of having to kickban each long nick
Back to top
View user's profile Send private message
Carlin0
Voice


Joined: 04 Dec 2018
Posts: 24
Location: Italy

PostPosted: Sun Jan 31, 2021 6:59 pm    Post subject: Reply with quote

thanks, I just made it so that only the nick and not the whole mask were banned, so that changing nick could re-enter
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sun Jan 31, 2021 8:10 pm    Post subject: Reply with quote

the issue is you will end up with a full banlist since having to set bans on a zillion paterns of nicks that are too long rather than just set 1 ban and get them all wich i mentioned few times

like this banmask bans all nicks that are longer than 9 characters and allow all that are 9 or less

Quote:
/mode #channel +b ?????????*!*@*
Back to top
View user's profile Send private message
Carlin0
Voice


Joined: 04 Dec 2018
Posts: 24
Location: Italy

PostPosted: Mon Feb 01, 2021 5:37 am    Post subject: Reply with quote

however with your method people will find themselves banned without knowing why Wink
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Mon Feb 01, 2021 10:04 am    Post subject: Reply with quote

i assume your users connect throu your website you could have some house rules set there but then again im not sure how your users connect.
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