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.

[Solved] nick too long

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
Carlin0
Voice
Posts: 28
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

[Solved] nick too long

Post by Carlin0 »

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.
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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 ?????????*!*@*
User avatar
Carlin0
Voice
Posts: 28
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Post by Carlin0 »

this works, but it only kicks and you risk making the bot work too much, I would have preferred a ban .
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

try this:

Code: Select all

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:
+b ??????????*!*@*
this saves u the trouble of having to kickban each long nick
User avatar
Carlin0
Voice
Posts: 28
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Post by Carlin0 »

thanks, I just made it so that only the nick and not the whole mask were banned, so that changing nick could re-enter
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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
/mode #channel +b ?????????*!*@*
User avatar
Carlin0
Voice
Posts: 28
Joined: Tue Dec 04, 2018 3:41 pm
Location: Italy

Post by Carlin0 »

however with your method people will find themselves banned without knowing why ;)
s
simo
Revered One
Posts: 1070
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

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.
Post Reply