Code: Select all
variable sql
variable libMySQLTcl "/usr/local/lib/mysqltcl-3.03/libmysqltcl3.03.so"
# SQL info
set sql(host) "localhost"
set sql(user) ""
set sql(pass) ""
set sql(db) ""
set sql(port) ""
## END CONF ##
set channel "#eTicker"
set time 30
if {[string compare [string index $time 0] "!"] == 0} { set timer [string range $time 1 end] } { set timer [expr $time * 60] }
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
proc go {} {
global sql libMySQLTcl
set sql(handle) [mysqlconnect -host $sql(host) -user $sql(user) -password $sql(pass) -db $sql(db) -port $sql(port)]
set query [::mysql::query $sql(handle) "SELECT werbung FROM advert ORDER BY DESC LIMIT 1 "]
while {[set row [::mysql::fetch $query]] != ""} {
set werbung [lindex $row 0]
global channel time text timer
foreach chan $channel {
putserv "PRIVMSG $chan :$werbung"
}
}
::mysql::endquery $query
mysqlclose $sql(handle)
}
if {[lsearch -glob [utimers] "* go *"] == -1} { utimer $timer go }
why does work this script
1 time it will be work after rehash no more function from it
mfg freak