| View previous topic :: View next topic |
| Author |
Message |
hellohello Voice
Joined: 09 Feb 2007 Posts: 12
|
Posted: Fri Feb 09, 2007 8:17 pm Post subject: Ban nicks with ugly characters |
|
|
I have a script request that hopefully won't be too difficult.
We would like to ban users that have a \ in their nick. Why not add a banmask? The server we are on ignores the \ due to a current bug, so it must be in the form of *!*user@host with a 1 minute unban period.
Thank you in advance! |
|
| Back to top |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Fri Feb 09, 2007 9:04 pm Post subject: |
|
|
try banning *|*!*@* (on rfc compliant networks, "|" is the lowercase version of "\") _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
hellohello Voice
Joined: 09 Feb 2007 Posts: 12
|
Posted: Sat Feb 10, 2007 10:47 am Post subject: |
|
|
| Hi, thanks for the tip, I'm aware of the rfc. However, this ban doesn't work and has been a known bug they just don't want to fix! |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Feb 10, 2007 12:21 pm Post subject: |
|
|
Something like this should do the trick:
| Code: | #Mask is matched against "#channel nick!user@host", % matches any single word (in this case the channel)
#Replace % if you wish to limit this script to only operate on a single channel
bind join - "% *\\*!*@*" join:badnick
proc join:badnick {nick host hand chan} {
#Make sure we don't ban friendly people (owner, master, op, or friend)
if {[matchattr $hand +fomn| $chan]} {return 1}
newchanban $chan "*!$host" $::botnick "Bad nickname, please try again." 1
} |
Edit:
To clarify, this will only kick ppl with "bad nicks" when they join the channel. It will not check when ppl change nicknames within the channel.
To handle nick-changing, add something like this:
| Code: | #Mask is matched against "#channel newnick", % matches any single word (in this case the channel)
#Replace % if you wish to limit this script to only operate on a single channel
bind nick - "% *\\*" nick:badnick
proc nick:badnick {nick host hand chan newnick} {
#Make sure we don't ban friendly people (owner, master, op, or friend)
if {[matchattr $hand +fomn| $chan]} {return 1}
newchanban $chan "*!$host" $::botnick "Bad nickname, please try again." 1
} |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
hellohello Voice
Joined: 09 Feb 2007 Posts: 12
|
Posted: Sun Feb 11, 2007 2:15 pm Post subject: |
|
|
| Hey there, thanks for the help... I couldn't get them to work though. They don't do anything when a user joins who has \ in his nick.... I don't know why though. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Feb 11, 2007 9:44 pm Post subject: |
|
|
Current code will not ban people who are recognized as "friend", "op", "master", or "owner".
Do you have problems with random users, or just the ones above? _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
hellohello Voice
Joined: 09 Feb 2007 Posts: 12
|
Posted: Mon Feb 12, 2007 8:20 am Post subject: |
|
|
| I added a user to the bots and gave it a global +f flag, after I removed the 'f' flag from the script. This to prevent 'join flood' messages when testing. It still doesn't work... |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Feb 12, 2007 8:42 am Post subject: |
|
|
Sorry, my bad;
bindings need to be something like this:
| Code: | bind nick - "% *\\\\*" nick:badnick
bind join - "% *\\\\*!*@*" join:badnick |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
hellohello Voice
Joined: 09 Feb 2007 Posts: 12
|
Posted: Mon Feb 12, 2007 9:05 am Post subject: |
|
|
Yeah, works like a charm. Thanks!!  |
|
| Back to top |
|
 |
|