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

	<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-10-09T03:07:26-04:00</updated>

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

		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-10-09T03:07:26-04:00</updated>

		<published>2003-10-09T03:07:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28194#p28194</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28194#p28194"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28194#p28194"><![CDATA[
<blockquote class="uncited"><div>Where's that thread btw?</div></blockquote><a href="http://forum.egghelp.org/viewtopic.php?t=4569&amp;highlight=writearray" class="postlink">http://forum.egghelp.org/viewtopic.php? ... writearray</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Thu Oct 09, 2003 3:07 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jag]]></name></author>
		<updated>2003-10-09T01:40:31-04:00</updated>

		<published>2003-10-09T01:40:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28190#p28190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28190#p28190"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28190#p28190"><![CDATA[
10x a lot!!!!  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3871">Jag</a> — Thu Oct 09, 2003 1:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-08T19:33:23-04:00</updated>

		<published>2003-10-08T19:33:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28178#p28178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28178#p28178"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28178#p28178"><![CDATA[
<blockquote class="uncited"><div>credits for this code go to ppslim, slenox and all the others in the "backup array" thread <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"></div></blockquote>An alternative way would be to write it to the file as tcl code creating the array and just 'source the.file' (making the loading a bit faster I imagine) Where's that thread btw?<br><br>Edit: here's some generic code for variable storage:<div class="codebox"><p>Code: </p><pre><code># usage: var2str &lt;qualified name&gt; ?output name? ?pretty array boolean?# the pretty array option is to choose between 'array set' or multiple 'set's for arrays with one or more elementsproc var2str {var {name {}} {prettyArray 0}} {if {$name=={}} {set name $var}if {[set var [uplevel 1 [list namespace which -variable $var]]]==""} {error "No such variable "$name""}upvar 1 $var vif {[info exists v]} {if {[array exists v]} {if {$prettyArray&amp;&amp;[array size v]} {foreach {ele val} [array get v] {lappend out [list set ${name}($ele) $val]}join [lsort -dict $out] \n} {list array set $name [array get v]}} {list set $name $v}} {list variable $name}}# usage: storeVar &lt;variable name&gt; &lt;file name&gt; ?file access mode?proc storeVar {var file {mode w}} {set f [open $file $mode]puts $f [var2str $var $var 1]close $f}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Wed Oct 08, 2003 7:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[GodOfSuicide]]></name></author>
		<updated>2003-10-08T16:39:38-04:00</updated>

		<published>2003-10-08T16:39:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28172#p28172</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28172#p28172"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28172#p28172"><![CDATA[
to backup an array:<div class="codebox"><p>Code: </p><pre><code>proc write_array {name file} {   set fp [open $file w]   puts $fp [uplevel 1 [list array get $name]]   close $fp } </code></pre></div>to restore the backup:<div class="codebox"><p>Code: </p><pre><code>proc read_array {name file} {   set fp [open $file r]   uplevel 1 [list array set $name [read -nonewline $fp]]   close $fp } </code></pre></div>credits for this code go to ppslim, slenox and all the others in the "backup array" thread <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1433">GodOfSuicide</a> — Wed Oct 08, 2003 4:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-08T14:22:07-04:00</updated>

		<published>2003-10-08T14:22:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28171#p28171</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28171#p28171"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28171#p28171"><![CDATA[
<blockquote class="uncited"><div>Using arrays will save them in memory ONLY if you restart the eggdrop, not kill it.</div></blockquote>A restart makes a fresh tcl interpreter (so everything is lost). I think you meant 'rehash' <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 Oct 08, 2003 2:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-10-08T14:04:35-04:00</updated>

		<published>2003-10-08T14:04:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28169#p28169</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28169#p28169"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28169#p28169"><![CDATA[
Using arrays will save them in memory ONLY if you restart the eggdrop, not kill it. To save an varialbe you must save it to disk as user said.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Wed Oct 08, 2003 2:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jag]]></name></author>
		<updated>2003-10-08T13:50:12-04:00</updated>

		<published>2003-10-08T13:50:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28167#p28167</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28167#p28167"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28167#p28167"><![CDATA[
<img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad">  <br>10x any way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3871">Jag</a> — Wed Oct 08, 2003 1:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-10-08T13:30:38-04:00</updated>

		<published>2003-10-08T13:30:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28166#p28166</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28166#p28166"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28166#p28166"><![CDATA[
Because saving them would make little sense in most cases. If you want a value stored you'll have to do it yourself <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 Oct 08, 2003 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jag]]></name></author>
		<updated>2003-10-08T01:43:09-04:00</updated>

		<published>2003-10-08T01:43:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=28149#p28149</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=28149#p28149"/>
		<title type="html"><![CDATA[Variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=28149#p28149"><![CDATA[
why when i closing the eggdrop, and reopen it the eggdrop clears all the variables?  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3871">Jag</a> — Wed Oct 08, 2003 1:43 am</p><hr />
]]></content>
	</entry>
	</feed>
