Code :
bind pubm - * pub:mod
proc pub:mod { nick host hand chan arg } {
set arg [stripcodes bcruag [mirc:strip $arg]]
set host [getchanhost $nick $chan]
set host "*!*[string range $host [string first @ $host] e]"
set boxscan [string tolower [lrange $arg 0 end]]
set chan [string tolower $chan]
# Badword
if {[sql:boxchan $chan]} {
service:connect
mysqlsel $::mysqlink "SELECT * FROM `box`"
if {[mysqlresult $::mysqlink rows] ne 0} {
while {[set row [mysqlnext $::mysqlink]] != ""} {
set spam [lindex $row 0]
set type [lindex $row 1]
set protect [lindex $row 2]
foreach words $spam {
if {[string match *$words* $boxscan]} {
if { $nick != $::botnick } {
putserv "PRIVMSG $::back(chan) :\[\2$type\2\] $chan $nick : $boxscan"
putserv "privmsg $::back(chan) :$spam <= Ok"
}
}
}
}
}
service:deconnect
}
}
proc sql:boxchan {arg} {
service:connect
set res [mysqlsel $::mysqlink "select * from `chanbox` where salon = '$arg'"]
service:deconnect
return $res
}
Si quelqu'un a une idée @alias_angelius est aussi preneur, pour l'instant cette procédure fonctionne mais elle parait très lourde (de la latence est repérée)