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 

Ban nicks with ugly characters

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


Joined: 09 Feb 2007
Posts: 12

PostPosted: Fri Feb 09, 2007 8:17 pm    Post subject: Ban nicks with ugly characters Reply with quote

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
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Feb 09, 2007 9:04 pm    Post subject: Reply with quote

try banning *|*!*@* (on rfc compliant networks, "|" is the lowercase version of "\")
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
hellohello
Voice


Joined: 09 Feb 2007
Posts: 12

PostPosted: Sat Feb 10, 2007 10:47 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Feb 10, 2007 12:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
hellohello
Voice


Joined: 09 Feb 2007
Posts: 12

PostPosted: Sun Feb 11, 2007 2:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Feb 11, 2007 9:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
hellohello
Voice


Joined: 09 Feb 2007
Posts: 12

PostPosted: Mon Feb 12, 2007 8:20 am    Post subject: Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Feb 12, 2007 8:42 am    Post subject: Reply with quote

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
View user's profile Send private message
hellohello
Voice


Joined: 09 Feb 2007
Posts: 12

PostPosted: Mon Feb 12, 2007 9:05 am    Post subject: Reply with quote

Yeah, works like a charm. Thanks!! Cool
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