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

	<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-11-08T19:09:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[droolin]]></name></author>
		<updated>2003-11-08T19:09:13-04:00</updated>

		<published>2003-11-08T19:09:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29732#p29732</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29732#p29732"/>
		<title type="html"><![CDATA[hmmmm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29732#p29732"><![CDATA[
Ok, due to I want to keep all code as simple and understandable as possible.  I will set up 2 more variables that will contain the added values.   I want as little manual configuration of the variables  as possible.  In other words, I would only have to update the cycle_channels variable if any new channels would need to be added/deleted.  <br>I was going to ask another question on this, but I think I know the answer.  I will set up two new variables that will be list's that will contain my counts and time stamps.  At initial time of eggdrop loading, I will run an initialization routine to insure that numeric values are in each occurance that there is a matching entry in cycle_channels.  This way, they will not have to be manually modified. If there are 5 entries in cycle_channels, my initialization routine will update 5 occurances in the new variables... Less maintance, and achieves the same results.<br>Thank you for your help, because I was spending hours searching the net on how to do this.  I wanted to do it as clean as possible, but just wasnt sure how.<br><br>droolin<br><br>[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3562">droolin</a> — Sat Nov 08, 2003 7:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-11-08T15:24:36-04:00</updated>

		<published>2003-11-08T15:24:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29729#p29729</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29729#p29729"/>
		<title type="html"><![CDATA[array help please]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29729#p29729"><![CDATA[
Hi,<br><br>Unfortunately tcl doesn't support multi-dimensional arrays. You can technically have an array element like somearray(1,1), but that is actually a 1 dimensional array with a key of "1,1" (ie. the comma is part of the key name).<br><br>What you might want to do is store a list for each element of the array:<br><br>set somearray(#chan1) [list "hi there" 1234 -5]<br><br>Now you have 3 values stored in that array element, in a list. To access them, you'd go:<br><br>set var1 [lindex $somearray(#chan1) 0] (result "hi there")<br>set var2 [lindex $somearray(#chan1) 1] (result 1234)<br>etc<br><br>The crappy part is when you want to update one of the vars:<br><br>set somearray(#chan1) [lreplace $somearray(#chan1) 1 1 2345]<br>(now the list is {"hi there", 2345, -5})<br><br>see <a href="http://www.tcl.tk/man/tcl8.3/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.3/TclCmd/contents.htm</a> for more info<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Nov 08, 2003 3:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[droolin]]></name></author>
		<updated>2003-11-08T12:08:38-04:00</updated>

		<published>2003-11-08T12:08:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29724#p29724</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29724#p29724"/>
		<title type="html"><![CDATA[array help please]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29724#p29724"><![CDATA[
Ive written a script that performs various security functions on a network i am part of.  I've just made a modification where I access various pre-defined channels with the eggie for various things.  I have this list set up in a variable as such.<div class="codebox"><p>Code: </p><pre><code>set     cycle_channels   {        "#channel1"        "#channel2"        "#channel3"}</code></pre></div>The code that I use with this list works fine, but what I want to do is add 2 other vraibales that will be associated with each channel.  Something like:<div class="codebox"><p>Code: </p><pre><code>array set     cycle_channels   {        "#channel1"   0 0        "#channel2"    0 0        "#channel3"   0 0}</code></pre></div>The second value would be a counter, and the third would contain a time stamp.    I <blockquote class="uncited"><div>think</div></blockquote> that I have defined an array properly. <br>Would I incriment the counter of the first channel like this????<div class="codebox"><p>Code: </p><pre><code>inc cycle_channels(1,1)</code></pre></div>Or would you use arrayget, to set a variable.  incrament the value, then array set?  And shoot, Im not even sure what the syntex on this would be.  <br>God, I hate asking stupid questions.<br>;o(((<br><br>droolin<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3562">droolin</a> — Sat Nov 08, 2003 12:08 pm</p><hr />
]]></content>
	</entry>
	</feed>
