code:
bind pub "-|-" !from finduser
proc finduser {nick host handle channel arg} {
set dbhost "192.168.0.100"
set dbuser "xxx"
set dbpass "xxx"
set dbname "test"
set db_handle [mysqlconnect -host $dbhost -user $dbuser -password $dbpass]
mysqluse $db_handle $dbname
if {$arg == ""} {
return 0
} else {
set search [string map {" " "%"} [lindex $arg]]
set query [mysqlsel $db_handle "SELECT * FROM `HL2` WHERE `information` LIKE '$search' AND `nick` LIKE '%' AND `Channel` LIKE '%'" -list]
if {$query==""} { putquick "PRIVMSG $channel :$arg not found." ; return }
foreach result $query {
set nick [lindex $nick]
set Channel [lindex $Channel 2]
putquick "PRIVMSG $channel :SOURCE: $search from $nick - $Channel"
}
}
}
anyone who could assist me in this small script?
thanks for replys!