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.

capital letter nicks

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
User avatar
piggy
Voice
Posts: 14
Joined: Sun Aug 21, 2005 11:51 am
Location: London

capital letter nicks

Post by piggy »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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]
 }
}
User avatar
piggy
Voice
Posts: 14
Joined: Sun Aug 21, 2005 11:51 am
Location: London

Post by piggy »

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

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.
User avatar
piggy
Voice
Posts: 14
Joined: Sun Aug 21, 2005 11:51 am
Location: London

Post by piggy »

Thank you very much Sir_Fz :)
Post Reply