<?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/7716" />

	<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>2004-06-19T13:06:24-04:00</updated>

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

		<entry>
		<author><name><![CDATA[shanks]]></name></author>
		<updated>2004-06-19T13:06:24-04:00</updated>

		<published>2004-06-19T13:06:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37611#p37611</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37611#p37611"/>
		<title type="html"><![CDATA[error when var not exist (part is mysqltcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37611#p37611"><![CDATA[
Well i added that line... tested it today<br><br><br>didn't really go too well <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised"><br><br>&lt;NSP-Hub&gt; [17:51] Tcl error in script for 'timer28'<br>&lt;NSP-Hub&gt; [17:51] can't read "id": no such variable <br><div class="codebox"><p>Code: </p><pre><code>proc getpost {} {  global db_handle posttimer  putlog "\[ #ns.pcw \] - Processing queue slot 1"  set que1 "SELECT * FROM posts ORDER BY thetime ASC LIMIT 1"    set newpost [mysqlsel $db_handle $que1 -flatlist]  # INSERT CODE FOR DECOMPOSE + PUT ALL BOTS  foreach {id ircnick qauth thetime post} $newpost {     if {![info exists id]} {       set posttimer [utimer 30 getpost]       putlog "\[ #ns.pcw \] - Table empty - timer reset"       return 0    }     puthelp "PRIVMSG $::relay(adchan) :$id $ircnick $qauth $thetime $post"   }  set que2 "DELETE FROM posts WHERE id='$id'"    set result [mysqlexec $db_handle $que2]    puthelp "PRIVMSG $::relay(adchan) :Post \[ $id \] successfully copied and deleted."    set posttimer [utimer 30 getpost]  putlog "\[ #ns.pcw \] - Post deleted - timer reset"}</code></pre></div>any ideas? thanks for your help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3686">shanks</a> — Sat Jun 19, 2004 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2004-06-17T07:52:14-04:00</updated>

		<published>2004-06-17T07:52:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37509#p37509</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37509#p37509"/>
		<title type="html"><![CDATA[error when var not exist (part is mysqltcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37509#p37509"><![CDATA[
you just need to add a couple of lines to your foreach-loop<div class="codebox"><p>Code: </p><pre><code>  foreach {id ircnick qauth thetime post} $newpost {    if {![info exists id]} {       set posttimer [utimer 30 getpost]       putlog "\[ #ns.pcw \] - getpost proc timer reset"      return    }    puthelp "PRIVMSG $::relay(adchan) :$id $ircnick $qauth $thetime $post"   }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu Jun 17, 2004 7:52 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[shanks]]></name></author>
		<updated>2004-06-17T04:53:00-04:00</updated>

		<published>2004-06-17T04:53:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37501#p37501</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37501#p37501"/>
		<title type="html"><![CDATA[error when var not exist (part is mysqltcl)]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37501#p37501"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc getpost {} {  global db_handle posttimer  putlog "\[ #ns.pcw \] - Processing queue slot 1"  set que1 "SELECT * FROM posts ORDER BY thetime ASC LIMIT 1"    set newpost [mysqlsel $db_handle $que1 -flatlist]  foreach {id ircnick qauth thetime post} $newpost {    puthelp "PRIVMSG $::relay(adchan) :$id $ircnick $qauth $thetime $post"  }  set que2 "DELETE FROM posts WHERE id='$id'"    set result [mysqlexec $db_handle $que2]    puthelp "PRIVMSG $::relay(adchan) :Post \[ $id \] successfully copied and deleted."    set posttimer [utimer 30 getpost]  putlog "\[ #ns.pcw \] - getpost proc timer reset"}</code></pre></div><br>The proc will take a single line from the database, and then put it into an irc channel ($::relay(adchan)) then deletes it from the database - It works fine as long as there are rows in the table - however, if there isn't any thing in the table, then it has no definition for $id, so it gives an error and stops the proc...<br><br>so, need a re-write so it won't kill the loop if the table is empty....<br><br>any ideas? :/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3686">shanks</a> — Thu Jun 17, 2004 4:53 am</p><hr />
]]></content>
	</entry>
	</feed>
