hello,
I can see coming because I meet with a concern for users with special characters. I use the blacklist of Opposing version 1.3 and I can not have that at the join of the users it is a own ban on nickname
########
# Blacklist #
########
#################
# Création et Gestion Db #
#################
if {![file exist database/blacklist.db]} {
set load [open database/blacklist.db w+]
close fcreate
putlog "\2Je créé le blacklist.db\2"
}
proc progfile {file action arg} {
set return 0
set dbr [open database/$file.db r+]
set dbw [open tmp.tmp w+]
while {![eof $dbr]} {
set r [gets $dbr]
if {$r!=""} {puts $dbw $r}
}
close $dbr
close $dbw
set dbr [open tmp.tmp r+]
set dbw [open database/$file.db w+]
while {![eof $dbr]} {
set r [gets $dbr]
if {$action=="add"} {
if {$r!=""} {
puts $dbw $r
} else {
puts $dbw $arg
}
set return 1
}
if {$action=="del"} {
if {$r!=""} {
if {![string match -nocase $arg [lindex $r 0]] && ![string match -nocase $arg [lindex $r 1]]} {
puts $dbw $r
} else {
set return 1
}
}
}
if {$action=="chk"} {
if {$r!=""} {
puts $dbw $r
if [string match -nocase [lindex $arg 0] [lindex $r 1]] {
set return [lindex $r 0]
if ![string match -nocase [lindex $arg 1] [lindex $r 2]] {set return 2}
if ![string match [lindex $arg 2] [lindex $r 3]] {set return 3}
}
}
}
if {$action=="icr"} {
if {$r!=""} {
puts $dbw $r
if [string match -nocase $arg [lindex $r 0]] {
set return 1
}
}
}
if {$action=="cf"} {
if {$r!=""} {
puts $dbw $r
if [string match -nocase [lindex $r 0] $arg] {
set return 1
}
}
}
if {$action=="ibr"} {
if {$r!=""} {
puts $dbw $r
if [string match -nocase $arg [lindex $r 1]] {
set return 1
}
}
}
}
close $dbr
close $dbw
return $return
}
###########
# Add blacklist #
###########
bind pub n .+blacklist +bl
proc +bl {nick uhost hand chan args} {
set verifexempt "[split [lindex $args 0] |]"
set nickverife "[lindex $verifexempt 0]"
if {[lindex $args 0]!=""} {
if {[progfile blacklist icr $nickverife]!="0"} {
putserv "notice $nick :Attention le Nick: \2$nickverife\2 est déjà dans la Blacklist."
return 0
}
progfile blacklist add $nickverife
putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été ajouté à la blacklist."
putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était ajouter au pseudo des (\0034Blackliste\00314)"
putserv "privmsg $::log :\00314Commande \0036Blacklist ajouté par \0031: \0034$hand"
return
} else {
puthelp "PRIVMSG $chan :Il faut une victime"
return
}}
###########
# Del Blacklist #
###########
bind pub n .-blacklist -bl
proc -bl {nick uhost hand chan args} {
set verifexempt "[split [lindex $args 0] |]"
set nickverife "[lindex $verifexempt 0]"
if {[lindex $args 0]!=""} {
if {[progfile blacklist del $nickverife]!="1"} {
putserv "notice $nick :Attention le Nick: \2$nickverife\2 n'est pas dans la Blacklist."
return 0
}
progfile blacklist del $nickverife
putserv "notice $nick :Le Nick: \2$nickverife\2 a bien été supprimé de la blacklist."
putquick "PRIVMSG $chan :\00314Le pseudo\002\0031 $nickverife\002 \00314a bien était retiré au pseudo des (\0034Blackliste\00314)"
putserv "privmsg $::log :\00314Commande \0036Blacklist retiré par \0031: \0034$hand"
return
} else {
puthelp "PRIVMSG $chan :Il faut une victime"
return
}}
###########
# List Blacklist #
###########
bind pub n .blacklist blist
proc blist {nick uhost hand chan args} {
set nickb [lindex $args 0]
set blusers [open database/blacklist.db r]
putserv "notice $nick :\2Voici la Blacklist:\2"
putserv "notice $nick :\2\2"
while {![eof $blusers]} {
set bluser [gets $blusers]
if {$bluser!="" && $nickb==""} {
putserv "notice $nick :\2Nick:\2 $bluser"
} elseif [string match -nocase $nickb $bluser] {
putserv "notice $nick :\2Nick:\2 $bluser."
}
}
putserv "notice $nick :\2Fin de la Blacklist\2."
putserv "privmsg $::log :\00314Commande \0036Blacklist par \0031: \0034$hand"
close $blusers
putserv "notice $nick :\2\2"
}