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.
#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:
#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
}
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.
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?
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...