<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/19759" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2014-07-30T14:08:21-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/19759</id>

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2014-07-30T14:08:21-04:00</updated>

		<published>2014-07-30T14:08:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103095#p103095</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103095#p103095"/>
		<title type="html"><![CDATA[TCL MySQL Select querstion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103095#p103095"><![CDATA[
There are a few issues with the script.<br><br>First off, your proc "myproc" expects a channel-name as an argument, yet you never provide one when calling it.<br><br>Secondly, the mysqlquery command returns a "query handle", which can be then used to retrieve the actual data from the database. This query also needs to be closed, by using mysqlendquery, to avoid resource-leaks.<br>A better option in this case would be the mysqlsel command with the -list option, which would return the data directly, and will close the query on its own.<br><br>Thirdly, it is not uncommon for mysql-servers to close connections that remain idle for some time, and your code does not check for that. You should consider opening and closing the connection as needed, or at least use mysqlping to verify and/or reconnect to the server when needed.<br>Also, leaving the connection open and idle wastes server resources, and can be an issue on server with high load.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Jul 30, 2014 2:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ReeVo]]></name></author>
		<updated>2014-07-30T12:15:16-04:00</updated>

		<published>2014-07-30T12:15:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=103094#p103094</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=103094#p103094"/>
		<title type="html"><![CDATA[TCL MySQL Select querstion]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=103094#p103094"><![CDATA[
Hello Ppl,<br><br>first sorry for my english <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> <br><br>i dont know if i`m on the right place here, but i have some question/problem with a tcl that i try to script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>I want that my Bot(Eggdrop) post every 30 Minutes news message that is stored in my Database and put it in my channel #news, it dont work <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Here my code<br><div class="codebox"><p>Code: </p><pre><code>load /usr/lib/libmysql/libmysqltcl3.05.soset db_handle [mysql::connect -host localhost -user XXX -password XXXX -db XXX]putlog "My first script successfully loaded"if {![info exists myproc_running]} {       timer 30 myproc                          set myproc_running 1                   }                                        proc myproc {channel} {                             set sql "SELECT * FROM news ORDER BY id desc limit 1"               set result [mysqlquery $db_handle $sql]        puthelp "PRIVMSG $channel: $news"      timer 30 myproc                          return 1                             }         </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12418">ReeVo</a> — Wed Jul 30, 2014 12:15 pm</p><hr />
]]></content>
	</entry>
	</feed>
