Paste Your small code(s) here, ex. small procs
by Cristian » Fri Jan 02, 2009 4:00 pm
It should ban nicknames like:
nickname32
nickname98
nickname76
nickname56
nickname78
- Code: Select all
namespace eval spambots {
namespace eval variable {
variable channel "#channel"
}
bind join - "%${::spambots::variable::channel} *" [namespace current]::onjoin
proc onjoin {nickname hostname handle channel} {
if {[string match *~* $hostname] > 0} {
set n [string range $nickname [expr [string length $nickname]-2] end]
if {[string is digit $n]} {
putquick "MODE $channel +b *!*[string trim $hostname "~"]"
putquick "KICK $channel $nickname :You have been classified as a \002spambot\002, due to your nickname \[ $nickname \]"
}
}
}
}
-
Cristian
- proof of advance

-
- Posts: 282
- Joined: Sun Nov 04, 2007 3:02 pm
- Location: Denmark
- Authnick: Sumsar
-
by fraguk » Fri Jan 02, 2009 4:14 pm
so would that mean it would kick a nick like sp00fed[1] ..?

-
fraguk
-
by Cristian » Fri Jan 02, 2009 4:17 pm
nah the sp00fed-nicks have [ ] in their nicks, only when the two last characters from a nickname is digits.
.chanset #channel +antispambot- Code: Select all
setudef flag antispambot
namespace eval spambots {
bind join - * [namespace current]::onjoin
proc onjoin {nickname hostname handle channel} {
if {[channel get $channel antispambot]} {
if {[string match *~* $hostname] > 0} {
set n [string range $nickname [expr [string length $nickname]-2] end]
if {[string is digit $n]} {
putquick "MODE $channel +b *!*[string trim $hostname "~"]"
putquick "KICK $channel $nickname :You have been classified as a \002spambot\002, due to your nickname \[ $nickname \]"
}
}
}
}
}
-
Cristian
- proof of advance

-
- Posts: 282
- Joined: Sun Nov 04, 2007 3:02 pm
- Location: Denmark
- Authnick: Sumsar
-
Return to TCL Scripting Snippets
Who is online
Users browsing this forum: No registered users and 0 guests