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 

capital letter nicks

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


Joined: 21 Aug 2005
Posts: 14
Location: London

PostPosted: Sun Jan 21, 2007 8:05 pm    Post subject: capital letter nicks Reply with quote

Hey Guys

I have taken a look at the "bad nick" tcl's in the archive, most of them see to respond to bad nicks that you specify in a list.

I am looking for a tcl that when a user joins the channel with a nick that is in complete capital letters it gets banned and kicked with a reason i can specify.
The second thing is if possible the bot must remove the ban 5 seconds later to prevent users with auto-rejoin on.

If anyone can suggest something that will be great.

Thanks in advance.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Jan 21, 2007 9:14 pm    Post subject: Reply with quote

Code:
bind join - * kickcapitals

proc kickcapitals {nick uhost hand chan} {
 if {[regexp {^[A-Z]{1,}$} $nick]} {
  putserv "kick $chan $nick :Bad nick detected."
  putserv "mode $chan +b [set b *!*@[lindex [split $uhost @] 1]]"
  utimer 5 [list pushmode $chan -b $b]
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
piggy
Voice


Joined: 21 Aug 2005
Posts: 14
Location: London

PostPosted: Mon Jan 22, 2007 2:32 am    Post subject: Reply with quote

Sir_Fz

Thanks, its exactly what i wanted thank you.

Is it possible to extend on that and add a second section where by if that same user rejoins with a nick in all capitals the second time round he gets kicked with a msg and banned for 2 minutes and then again when the 2 minutes is up the ban gets removed?

Thanks
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Jan 22, 2007 3:35 pm    Post subject: Reply with quote

Code:
set remtime 60

bind join - * kickcapitals
bind time - {?0*} {foreach {a b} [array get ::capCot] {if {[unixtime]-$b >= $::remtime} {unset ::capCot($a)}};#}

proc kickcapitals {nick uhost hand chan} {
 global capCot remtime
 if {[regexp {^[A-Z]{1,}$} $nick]} {
  putserv "kick $chan $nick :Bad nick detected."
  putserv "mode $chan +b [set b *!*@[lindex [split $uhost @] 1]]"
  if {[info exists capCot([set nc [string tolower $nick:$chan]])] && [unixtime]-$capCot($nc) < $remtime} {
   timer 2 [list pushmode $chan -b $b]
   unset capCot($nc)
  } {
   utimer 5 [list pushmode $chan -b $b]
   set capCot($nc) [unixtime]
  }
 }
}

Edit: The user will be banned for 2 minutes if he rejoin within $remtime seconds after being kicked the first time.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
piggy
Voice


Joined: 21 Aug 2005
Posts: 14
Location: London

PostPosted: Mon Jan 22, 2007 4:08 pm    Post subject: Reply with quote

Thank you very much Sir_Fz Smile
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