
I have tried to merge my script with this instruction
Code: Select all
if {![info exists myproc_running]} {
timer 20 myproc
set myproc_running 1
}
proc myproc {} {
# your stuff here ...
# ...
timer 20 myproc
return 1
}
Code: Select all
#Ausgabescript
#!/usr/bin/tclsh8.3
bind pub - .test nicksql
proc nicksql {nick uhost hand chan args} {
putserv "PRIVMSG $chan :Bot is listening"
set mysql_handler [mysqlconnect -host localhost -port 3306 -user XXX -password XXX -db XXX]
#putserv "PRIVMSG $chan :After Database connect"
mysqlexec $mysql_handler "DELETE FROM irc_online"
foreach nick [chanlist $chan] {
#putserv "PRIVMSG $chan :$nick"
mysqlexec $mysql_handler "INSERT INTO irc_online (Nickname) VALUES ('$nick');"
}
#putserv "PRIVMSG $chan :After Database insert"
mysqlclose $mysql_handler
}
Kato