bind pubm - * Word:check
proc Word:check {nick host hand chan text} {
if {![channel get $chan badword]} { return 0 }
if {[isop $nick]} {return 0}
if {[matchattr $hand o|o $chan]} { return 0 }
set conx [getConnection]
set sqltext [::mysql::escape "SELECT * FROM ExceptWord where '$text' LIKE Mot"]
set wordcheck [mysqlsel $conx $sqltext]
if {$wordcheck > 0} {putlog "$text existant" ; return 0}
set sqltext [::mysql::escape "SELECT * FROM ExceptWord where '$text' LIKE Badword"]
set Badwordcheck [mysqlsel $conx $sqltext]
if {$Badwordcheck > 0} {
set why [mysqlsel $conx "SELECT Raison FROM BadWord WHERE '$text' LIKE Badword"]
if {[llength $why] > 0} {
set ban "*!*[string range $host [string first @ $host] e]"
putserv "PRIVMSG X :ban $chan $ban 5 75 [lindex $why 0]"
mysql::close $conx
}
return 0
}
}
there must be a way to close the open connection thanks
bind pubm - * Word:check
proc Word:check {nick host hand chan text} {
if {![channel get $chan badword]} { return 0 }
if {[isop $nick]} {return 0}
if {[matchattr $hand o|o $chan]} { return 0 }
set conx [getConnection]
set sqltext [::mysql::escape "SELECT * FROM ExceptWord where '$text' LIKE Mot"]
set wordcheck [mysqlsel $conx $sqltext]
if {$wordcheck > 0} {putlog "$text existant" ; return 0}
set sqltext [::mysql::escape "SELECT * FROM ExceptWord where '$text' LIKE Badword"]
set Badwordcheck [mysqlsel $conx $sqltext]
if {$Badwordcheck > 0} {
set why [mysqlsel $conx "SELECT Raison FROM BadWord WHERE '$text' LIKE Badword"]
if {[llength $why] > 0} {
set ban "*!*[string range $host [string first @ $host] e]"
putserv "PRIVMSG X :ban $chan $ban 5 75 [lindex $why 0]"
}
return 0
}
# here
mysql::close $conx
#
}