I believe AllProtection does.juanamores wrote:Ones I found a script to ban certain RealNames (no nicks).
I do not remember that post was published and can not find it.
If someone remembers a script to control RealNames users on joining the channel, thank you.
Why not work?
Code: Select all
.chanset #mychanel +badfullname
Tcl error [badrealname]: can not find channel named "#mychanel"channel set #mychanel +udef-flag-badfullname
Code: Select all
#######################################################################
#
# BadFullname vers 1.1
#
#
# BLaCkShaDoW Productions
#######################################################################
#######################################################################
#
#On join, if a user`s realname contains any of the restricted words #that are written in this script, the BoT will ban the user :)
#Contains protection for users who have access on the boT :)
#
# TO ACTIVATE TYPE IN DCC .chanset #canal +badfullname
#######################################################################
#Here You can set the words that are forbidden
set bad(fullnames) {
"*Radio Pepe*"
}
#Here you can set the reason for the kick / ban
set bad(reason) "Bad Fullname"
#Here you can set the time for the ban (hours)
set bad(time) "2"
#Here you can set the flags that are excepted
set bad(flags) "n|n"
set mychan "#mychanel"
########################################################################
# Here starts the config
#
#
#######################################################################
setudef flag badfullname
set Autor "BLaCkShaDoW"
set vers "1.1"
bind join -|- "* *" badrealname
proc badrealname {nick host hand chan} {
global botnick mychan
if {$chan != $mychan} { return }
set ::cchan $chan
set ::nnick $nick
set ::hhost $host
if { [chan get $chan badfullname] } {
if {![botisop $chan]} { return 0 }
if {[onchan $nick $chan]} {
putserv "WHOIS $nick $nick"
putlog "doing WHOIS to $nick..."
bind RAW - 311 badfullnames
}
}
}
proc badfullnames { from keyword arguments } {
global botnick bad mychan
set channel $::cchan
if {$channel != $mychan} { return }
set nickname $::nnick
set host $::hhost
set handle "[nick2hand $nickname]"
set fullname [string range [join [lrange $arguments 5 end]] 1 end]
if {[onchan $nickname $channel]} {
set banmask *!*@[lindex [split [getchanhost $nickname $channel] "@"] 1]
}
foreach realname [string tolower $bad(fullnames)] {
if {[string match $realname [string tolower $fullname]]} {
if {[matchattr $handle $bad(flags) $channel]} { return 0 }
newchanban $channel $banmask $botnick $bad(reason) [expr $bad(time) * 60]
}
}
unbind RAW - 311 badfullnames
}
putlog "Bad Fullname $vers by $Autor Loaded !"
Ok , it works.BLaCkShaDoW wrote:You should try the *unmodified* version. Do not try to modify, just add the tcl and activate it with the specific flag on the chan you desire.
Code: Select all
#######################################################################
#
# BadFullname vers 1.1
#
#
# BLaCkShaDoW Productions
#######################################################################
#######################################################################
#
#On join, if a user`s realname contains any of the restricted words #that are written in this script, the BoT will ban the user :)
#Contains protection for users who have access on the boT :)
#
# TO ACTIVATE TYPE IN DCC .chanset #canal +badfullname
#######################################################################
#Here You can set the words that are forbidden
set bad(fullnames) {
"*Radio Pepe*"
}
#Here you can set the reason for the kick / ban
set bad(reason) "Bad Fullname"
#Here you can set the time for the ban (hours)
set bad(time) "2"
#Here you can set the flags that are excepted
set bad(flags) "n|n"
########################################################################
# Here starts the config
#
#
#######################################################################
setudef flag badfullname
set Autor "BLaCkShaDoW"
set vers "1.1"
bind join -|- "* *" badrealname
proc badrealname {nick host hand chan} {
global botnick bad
set ::cchan $chan
set ::nnick $nick
set ::hhost $host
if { [channel get $chan badfullname] } {
if {![botisop $chan]} { return 0 }
if {[onchan $nick $chan]} {
putserv "WHOIS $nick $nick"
bind RAW - 311 badfullnames
}
}
}
proc badfullnames { from keyword arguments } {
global botnick bad
set channel $::cchan
set nickname $::nnick
set host $::hhost
set handle "[nick2hand $nickname]"
set fullname [string range [join [lrange $arguments 5 end]] 1 end]
if {[onchan $nickname $channel]} {
set ident [string tolower [lindex [split $host "@"] 0]]
set banmask $nickname!$ident@[lindex [split [getchanhost $nickname $channel] "@"] 1]
}
foreach realname [string tolower $bad(fullnames)] {
if {[string match $realname [string tolower $fullname]]} {
if {[matchattr $handle $bad(flags) $channel]} { return 0 }
newchanban $channel $banmask $botnick $bad(reason) [expr $bad(time) * 60]
}
}
unbind RAW - 311 badfullnames
}
putlog "Bad Fullname $vers by $Autor Loaded !"
Code: Select all
foreach realname [string tolower $bad(fullnames)] {
if {[string match $realname [string tolower $fullname]]} {
if {[matchattr $handle $bad(flags) $channel]} { return 0 }
newchanban $channel $banmask $botnick $bad(reason) [expr $bad(time) * 60]
}
}
Code: Select all
set realName [lindex [split [lassign $arguments bot nick user host] :] 1]
Code: Select all
foreach realname [string tolower $bad(fullnames)] {
if {[string match $realname [string tolower $fullname]]} {
if {[matchattr $handle $bad(flags) $channel]} { continue }
newchanban $channel $banmask $botnick $bad(reason) [expr $bad(time) * 60]
} else {continue}
}
Code: Select all
if {[matchattr $handle $bad(flags) $channel]} { continue }
lifetime is specified in minutes. If lifetime is not specified, ban-time usually 60) is used. Setting the lifetime to 0 makes it a permanent ban.
Code: Select all
if {[matchattr $handle $bad(flags) $channel]} return
foreach realname [string tolower $bad(fullnames)] {
if {[string match $realname [string tolower $fullname]]} {
newchanban $channel $banmask $botnick $bad(reason) $bad(time)
break
}
}