Hi, I have mmysql working, and a way that someone can change the topic on a website, and it be reflected in the chatroom.
So, I have the following:
alias checktopic {
var %db = $mysql_connect(host, username, password, database)
var %sql = SELECT topic FROM sean where ID = 1
var %res = $mysql_query(%db, %sql)
if (%res) {
while ($mysql_fetch_row(%res, row, $MYSQL_ASSOC)) {
if $hget(row, topic) != $1($1).topic {
/topic #no-nick $hget(row, topic)
}
else {
halt
}
mysql_free %res
}
else {
echo -a Error executing query: %mysql_errstr
}
}
}
The alias is /timermytopic 0 20 checktopic $chan
It all seams to be working correctly..
[18:53] * test-bot changes topic to 'This is my topic!!!!'
But, in another 20 seconds, it will change it again, and it will continually change it.
I am wondering how this could be done to it doesn't keep updating the topic every 20 seconds?
Thank you for any help provided,:D