This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Help for those learning Tcl or writing their own scripts.
Fire-Fox
Master
Posts: 299 Joined: Sat Sep 23, 2006 9:01 pm
Location: /dev/null
Post
by Fire-Fox » Mon Nov 16, 2009 5:04 am
Hey
How do i get the bot to keep connection to the mysql database, without replying "The connection to the mysql server has been lost." almost all the time?
Code: Select all
##################
### Mysql path ###
##################
if {![info exists db_handle] } {
set db_handle [mysqlconnect -host xxxx.xxxx.xxxxx -port xxxx -user xxx -password xxxxx -db xxxxxx]
}
Code: Select all
if {[mysqlping $db_handle] != 1} {
putserv "PRIVMSG $channel :The connection to the mysql server has been lost."
return 0
}
DarkRaptor
Voice
Posts: 36 Joined: Sat Apr 15, 2006 2:39 am
Location: Trois-Rivières, Qc
Post
by DarkRaptor » Mon Nov 23, 2009 12:05 am
Hi Fire-Fox,
I'm using this in my script.
Code: Select all
proc name { all arguments } {
mysqlconnect
conditions
&
commands
mysqlclose
}
I'm sure to have a "fresh" connection to the mysql server.
Note: I put "mysqlclose" at each location that the script ends.
DarkRaptor @ irc.undernet.org