I have a bot that uses mysql but to do so when it first comes online I have to tell it to connect to the sql.
Is there anyway to have the bot do this automatically?
Code: Select all
bind evnt - init-server my:connect
proc my:connect init-server {
# Code for connecting to mysql goes here
}
so with the proc called by init-server you would also connect to the dbase when you are reconnecting to a server. so either use loaded or add a check if the bot is allready connected to the databasebind evnt <flags> <type> <proc>
proc-name <type>
sighup
called on a kill -HUP <pid>
sigterm
called on a kill -TERM <pid>
sigill
called on a kill -ILL <pid>
sigquit
called on a kill -QUIT <pid>
save
called when the userfile is saved
rehash
called just after a rehash
prerehash
called just before a rehash
prerestart
called just before a restart
logfile
called when the logs are switched daily
loaded
called when the bot is done loading
connect-server
called just before we connect to an IRC server
init-server
called when we actually get on our IRC server
disconnect-server
called when we disconnect from our IRC server