| View previous topic :: View next topic |
| Author |
Message |
piggy Voice

Joined: 21 Aug 2005 Posts: 14 Location: London
|
Posted: Sun Jan 21, 2007 8:05 pm Post subject: capital letter nicks |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Jan 21, 2007 9:14 pm Post subject: |
|
|
| 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 |
|
 |
piggy Voice

Joined: 21 Aug 2005 Posts: 14 Location: London
|
Posted: Mon Jan 22, 2007 2:32 am Post subject: |
|
|
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Mon Jan 22, 2007 3:35 pm Post subject: |
|
|
| 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 |
|
 |
piggy Voice

Joined: 21 Aug 2005 Posts: 14 Location: London
|
Posted: Mon Jan 22, 2007 4:08 pm Post subject: |
|
|
Thank you very much Sir_Fz  |
|
| Back to top |
|
 |
|