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

	<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>2003-08-27T18:38:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T18:38:20-04:00</updated>

		<published>2003-08-27T18:38:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25803#p25803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25803#p25803"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25803#p25803"><![CDATA[
<blockquote class="uncited"><div>If you're writing a file, just 'puts' from within the loop and everything should be fine.<br><br>eg:<div class="codebox"><p>Code: </p><pre><code>set file [open output.txt w]foreach user $users {  puts $file "$user:"  foreach xtra [getuser $user XTRA] {    puts $file "[lindex $xtra 0] = [lindex $xtra 1]"  }}close $file</code></pre></div></div></blockquote>Ok user thanks for all the time you spent with me I greatly appreciate your help.<br><br>if this doesn't work i'm gonna backup 4 paces and chuck the code.<p>Statistics: Posted by Guest — Wed Aug 27, 2003 6:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T18:31:39-04:00</updated>

		<published>2003-08-27T18:31:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25802#p25802</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25802#p25802"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25802#p25802"><![CDATA[
If you're writing a file, just 'puts' from within the loop and everything should be fine.<br><br>eg:<div class="codebox"><p>Code: </p><pre><code>set file [open output.txt w]foreach user $users {  puts $file "$user:"  foreach xtra [getuser $user XTRA] {    puts $file "[lindex $xtra 0] = [lindex $xtra 1]"  }}close $file</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 6:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T17:49:24-04:00</updated>

		<published>2003-08-27T17:49:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25795#p25795</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25795#p25795"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25795#p25795"><![CDATA[
no it sends me a file with the data. I just can't get it to send the user info on the file. not all of it anyway.<p>Statistics: Posted by Guest — Wed Aug 27, 2003 5:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T17:45:54-04:00</updated>

		<published>2003-08-27T17:45:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25794#p25794</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25794#p25794"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25794#p25794"><![CDATA[
what is your goal? are you going to display/write the data some where or just collect it in one big "pile" inside a variable?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 5:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T17:42:39-04:00</updated>

		<published>2003-08-27T17:42:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25793#p25793</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25793#p25793"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25793#p25793"><![CDATA[
<blockquote class="uncited"><div>Doing it like that will overwrite the var each time and you'll end up only keeping the last value. Use '<a href="http://tcl.tk/man/tcl8.4/TclCmd/append.htm" class="postlink">append</a>' or '<a href="http://tcl.tk/man/tcl8.4/TclCmd/lappend.htm" class="postlink">lappend</a>' to add to the variable <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>use it where, I need another example<p>Statistics: Posted by Guest — Wed Aug 27, 2003 5:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T17:36:41-04:00</updated>

		<published>2003-08-27T17:36:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25790#p25790</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25790#p25790"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25790#p25790"><![CDATA[
Doing it like that will overwrite the var each time and you'll end up only keeping the last value. Use '<a href="http://tcl.tk/man/tcl8.4/TclCmd/append.htm" class="postlink">append</a>' or '<a href="http://tcl.tk/man/tcl8.4/TclCmd/lappend.htm" class="postlink">lappend</a>' to add to the variable <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 5:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T17:40:12-04:00</updated>

		<published>2003-08-27T17:29:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25787#p25787</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25787#p25787"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25787#p25787"><![CDATA[
foreach xtra [getuser $user XTRA] { <br>   if {[string match info* [lindex $xtra 0]]} { <br>      set desc $xtra <br>   } <br>}<br>I tried  the code in the loop and after the loop.<br><br>both places had same result.<br><br>seems I should be able to do just <br>set desc [getuser $user XTRA info] this set command is already inside a foreach command.<br>foreach user $users {<br>set nikk [getuser $user XTRA nik]<br>set nikk [stripit $nikk]<br>set desc [getuser $user XTRA info]  <br>{<p>Statistics: Posted by Guest — Wed Aug 27, 2003 5:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T17:14:21-04:00</updated>

		<published>2003-08-27T17:14:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25784#p25784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25784#p25784"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25784#p25784"><![CDATA[
<blockquote class="uncited"><div>that didn't do it, what I got from it was on users that had only one note it gave me that note, but if a user had multiple notes it gave me like only note 14.</div></blockquote>Show us some code? Did you do the output/whatever inside the loop or after it?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 5:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T17:06:24-04:00</updated>

		<published>2003-08-27T17:06:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25780#p25780</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25780#p25780"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25780#p25780"><![CDATA[
<blockquote class="uncited"><div>You mean there's note1-50 in the user's XTRA info? How about this then:<br><div class="codebox"><p>Code: </p><pre><code>foreach xtra [getuser $user XTRA] {if {[string match note* [lindex $xtra 0]]} {# insert code doing what ever you like with $xtra here}}</code></pre></div>Why are you storing things this way? Why not use the notes module?</div></blockquote>that didn't do it, what I got from it was on users that had only one note it gave me that note, but if a user had multiple notes it gave me like only note 14.<p>Statistics: Posted by Guest — Wed Aug 27, 2003 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T15:11:38-04:00</updated>

		<published>2003-08-27T15:11:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25777#p25777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25777#p25777"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25777#p25777"><![CDATA[
its not really a note, i just used that for an example. its really info stored on a user.<p>Statistics: Posted by Guest — Wed Aug 27, 2003 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T15:06:43-04:00</updated>

		<published>2003-08-27T15:06:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25776#p25776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25776#p25776"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25776#p25776"><![CDATA[
You mean there's note1-50 in the user's XTRA info? How about this then:<br><div class="codebox"><p>Code: </p><pre><code>foreach xtra [getuser $user XTRA] {if {[string match note* [lindex $xtra 0]]} {# insert code doing what ever you like with $xtra here}}</code></pre></div>Why are you storing things this way? Why not use the notes module?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 3:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T15:09:44-04:00</updated>

		<published>2003-08-27T14:48:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25773#p25773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25773#p25773"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25773#p25773"><![CDATA[
it has 1 to 50 items in note, i get the first note using set desc [getuser $user XTRA note1] but i don't get all the notes doing that. what i want to do is get all the notes. this is in my send tcl that sends me stored info on a user. the data is stored in a file that stores all users, in the file each user is listed labeled user and then under user are entries note1, note2 and so on. hope I explained this so it can be understood how the file is structured.<br><br>userfile.tx<br><br>joh doe<br><br>note1<br>note2<br>note3<p>Statistics: Posted by Guest — Wed Aug 27, 2003 2:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T14:38:40-04:00</updated>

		<published>2003-08-27T14:38:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25771#p25771</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25771#p25771"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25771#p25771"><![CDATA[
<blockquote class="uncited"><div>Thanks, but I'm not sure how to use list either, its not in the tcl-commands.doc. My knowledge of tcl is very limited. I needan example.</div></blockquote>tcl-commands.doc only has the extra commands provided by eggdrop. Here's the core tcl commands: <a href="http://tcl.tk/man/tcl8.4/TclCmd/contents.htm" class="postlink">http://tcl.tk/man/tcl8.4/TclCmd/contents.htm</a><br><br>Example:<div class="codebox"><p>Code: </p><pre><code>list "string one" "string two"</code></pre></div> would return a list with two elements. If you stored this list some where you could later retrieve the first element by using <div class="codebox"><p>Code: </p><pre><code>lindex &lt;the list&gt; 0</code></pre></div>...Damn, I suck at explaining. You better tell me some more about what you want to do <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 2:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-08-27T14:32:44-04:00</updated>

		<published>2003-08-27T14:32:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25769#p25769</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25769#p25769"/>
		<title type="html"><![CDATA[need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25769#p25769"><![CDATA[
Thanks, but I'm not sure how to use list either, its not in the tcl-commands.doc. My knowledge of tcl is very limited. I needan example.<p>Statistics: Posted by Guest — Wed Aug 27, 2003 2:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-08-27T12:57:05-04:00</updated>

		<published>2003-08-27T12:57:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=25761#p25761</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=25761#p25761"/>
		<title type="html"><![CDATA[Re: need help with tcl]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=25761#p25761"><![CDATA[
<blockquote class="uncited"><div>I have a file that has multiple data for a subject and i need to get all instances of the data.</div></blockquote>I'm not sure if I got you right, but here's my solution for what I think your problem is: Use a list to store the "instances" and 'lindex' to retrieve a single one.<br><br>Keep in mind that the XTRA field is pretty limited in length (500-length of field name), so depending on what your data is you might want to store it in a separate file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Aug 27, 2003 12:57 pm</p><hr />
]]></content>
	</entry>
	</feed>
