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

	<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-07-19T13:00:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[metroid]]></name></author>
		<updated>2004-07-19T13:00:50-04:00</updated>

		<published>2004-07-19T13:00:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38823#p38823</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38823#p38823"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38823#p38823"><![CDATA[
Here is an even better code, It loads all scripts and if there is an error, it will do it will skip the script and tell u in a putlog <br><br>"ERROR: the following error occured while evaluating ${script}: $error"<br><br><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Here it is<br><div class="codebox"><p>Code: </p><pre><code>foreach script [glob scripts/*] {  if {(![file isdirectory $script]) &amp;&amp; ([regexp {^(.+)\.tcl$} $script])} {    catch {source $script} error    if {$error != ""} {      putlog "ERROR: the following error occured while evaluating ${script}: $error"    }  }}</code></pre></div>ps. put this at the end of the eggdrop.conf<br>All credits go to perplexa for this script <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=5078">metroid</a> — Mon Jul 19, 2004 1:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-18T23:26:27-04:00</updated>

		<published>2004-07-18T23:26:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38790#p38790</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38790#p38790"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38790#p38790"><![CDATA[
All files will have different names. You can't have 2 files with the same names, case-letters and extensions. They would cease to exist.<br><br>As for the names, all your tcl files have *.tcl extensions, so what ever names they have, or which ever case letters, this foreach loop will execute and load them, no matter what names/cases letters they have. So all scripts in your /scripts dir with the exention .tcl will be loaded.<br><br>As for sorting them alphabetically with respect to increasing or decreasing first letter of file names, you can use lsort.<br><br>To my knowledge what I have learned a few days ago.<br>Lsort can be use in such a way.<br><br>If I am right, this should be it.<br>For increasing alphabetical sequence or decreasing alphabetical sequence.<br><div class="codebox"><p>Code: </p><pre><code>#Will sort and load the files from alphabetically increasing first letters of file names#(A to Z)[lsort -dictionary -increasing [glob $scriptdir\*.tcl]]#Will sort and load the files from alphabetically decreasing first letters of file names#(Z to A)[lsort -dictionary -decreasing [glob $scriptdir\*.tcl]]</code></pre></div>For more switches on lsort. See the tcl manual with reference to the lsort function.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jul 18, 2004 11:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-07-18T17:04:06-04:00</updated>

		<published>2004-07-18T17:04:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38774#p38774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38774#p38774"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38774#p38774"><![CDATA[
It will load any tcl script in the dir specified.<br><br>if you want to load the scripts in a particular order, you can for example do <br><div class="codebox"><p>Code: </p><pre><code>set scriptdir scr/foreach script [lsort -dictionary [glob $scriptdir\*.tcl]] { source $script}</code></pre></div>and it will load them in alphabetic order.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sun Jul 18, 2004 5:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[K]]></name></author>
		<updated>2004-07-18T16:39:03-04:00</updated>

		<published>2004-07-18T16:39:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38773#p38773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38773#p38773"/>
		<title type="html"><![CDATA[no or yes]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38773#p38773"><![CDATA[
yes but if the scripts have diferent names it don't work and if i whant to start the scripts in a order that funtion even not <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=4489">K</a> — Sun Jul 18, 2004 4:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2004-07-18T13:59:31-04:00</updated>

		<published>2004-07-18T13:59:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38766#p38766</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38766#p38766"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38766#p38766"><![CDATA[
Nice useful code, gb. Might come in handy for me as well. I have many files, but I put all into one, like 400kb, but when I modify my scripts (almost like daily or so) then I have to upload all the 400kb, so I've split them again into smaller pieces, heh. I'll try it out as well.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Sun Jul 18, 2004 1:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2004-07-18T13:22:59-04:00</updated>

		<published>2004-07-18T13:22:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38764#p38764</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38764#p38764"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38764#p38764"><![CDATA[
Just add this to the end of your config file, and it'll load any *.tcl script inside the 'src/' dir<br><div class="codebox"><p>Code: </p><pre><code>set scriptdir scr/foreach script [glob $scriptdir\*.tcl] {  source $script}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Sun Jul 18, 2004 1:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[K]]></name></author>
		<updated>2004-07-18T12:42:08-04:00</updated>

		<published>2004-07-18T12:42:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38762#p38762</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38762#p38762"/>
		<title type="html"><![CDATA[load scripts]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38762#p38762"><![CDATA[
if i have in dir scr 10 scripts file and i whant to load all these files with one command in eggdrop.conf<br>not like:<div class="codebox"><p>Code: </p><pre><code>source scr/script1.tclsource scr/script2.tcl...</code></pre></div>and so one i wonder if is psobile to make a script and you add the lines in the scripts and add only that script to eggdrop.conf<div class="codebox"><p>Code: </p><pre><code>source scr/alscripts.tcl</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4489">K</a> — Sun Jul 18, 2004 12:42 pm</p><hr />
]]></content>
	</entry>
	</feed>
