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

	<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>2007-03-17T22:37:40-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-17T22:37:40-04:00</updated>

		<published>2007-03-17T22:37:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71332#p71332</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71332#p71332"/>
		<title type="html"><![CDATA[Two scripts - last one put in config works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71332#p71332"><![CDATA[
<blockquote class="uncited"><div> I can use procnames from other script without including?</div></blockquote>Yes.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sat Mar 17, 2007 10:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2007-03-17T17:14:12-04:00</updated>

		<published>2007-03-17T17:14:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71322#p71322</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71322#p71322"/>
		<title type="html"><![CDATA[Two scripts - last one put in config works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71322#p71322"><![CDATA[
Yes, eggdrop will load any and all scripts into the same namespace and interpreter as it uses tcl's native "source" command. This behaviour is intended, as using namespaces requires special considderations when scripting, and creating multiple interpreter environments would require quite some work and use more resources, while really not providing any major advantages.<br><br>Of course, as rosc suggested, you can setup and use namespaces freely on your own, just as you would in any other tcl-enabled application.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Mar 17, 2007 5:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kobra]]></name></author>
		<updated>2007-03-17T17:24:01-04:00</updated>

		<published>2007-03-17T17:02:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71320#p71320</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71320#p71320"/>
		<title type="html"><![CDATA[Two scripts - last one put in config works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71320#p71320"><![CDATA[
so... the effect in eggdrop is the same, as if I would put all my scripts in one file? This is normal or is it a bug? So... I can use procnames from other script without including?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8810">Kobra</a> — Sat Mar 17, 2007 5:02 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2007-03-17T12:46:31-04:00</updated>

		<published>2007-03-17T12:46:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71311#p71311</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71311#p71311"/>
		<title type="html"><![CDATA[Two scripts - last one put in config works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71311#p71311"><![CDATA[
They both have the same proc names, so the last one to load clobbers the 1st one's procs... Rename them to unique names, or use the namespace command (which is slightly more complicated.)  Global vars should also use unique names.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sat Mar 17, 2007 12:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Kobra]]></name></author>
		<updated>2007-03-17T11:06:29-04:00</updated>

		<published>2007-03-17T11:06:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=71309#p71309</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=71309#p71309"/>
		<title type="html"><![CDATA[Two scripts - last one put in config works]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=71309#p71309"><![CDATA[
I have just started using eggdrop and TCL. I have written two scripts, but only one of them works - the one that is put lower in config. But both scripts work just fine on it's own (without the second one).<br><div class="codebox"><p>Code: </p><pre><code>source /home/kobra/eggdrop/scripts/cs.tclsource /home/kobra/eggdrop/scripts/start.tcl</code></pre></div>I guess I didn't put something in the code... but what?<br><br>Here is start.tcl<div class="codebox"><p>Code: </p><pre><code>package require httpproc getPage { url } {    set token [::http::geturl $url]    set data [::http::data $token]    ::http::cleanup $token    return $data}bind time -|- {* * * * *} aktproc akt { minute hour day month year } {    set page [ getPage http://some.com/site ]    set a 1    foreach line [split $page "\n"] {if { $a == 1 } {    set bufor "PRIVMSG #channel :\00312\002\[LeD\]\002\0033 $line \0031-"    set a 2    } else {    set bufor "$bufor \00314$line"    set a 1    puthelp "$bufor"    }}    }</code></pre></div>cs.tcl<div class="codebox"><p>Code: </p><pre><code>package require httpproc getPage { url } {    set token [::http::geturl $url]    set data [::http::data $token]    ::http::cleanup $token    return $data}bind time -|- {* * * * *} aktproc akt { minute hour day month year } {set players 0set maxplayers 0    if { [expr "$minute % 5"]==0 } {          set page [ getPage http://some.com/site ]set a 1        set b 1foreach line [split $page "\n"] {switch $a {1{}2{ set nazwa $line }3{ set adres $line }4{ set players $line }5{ set maxplayers $line }6{ set map $line }7{ set freezetime $line }8{ set buytime $line }9{ set mp_roundtime $line }10{ set proxies $line }11{ set maxrate $line }default {switch $b {1 { lappend nick $line }2 { lappend czas $line }3 {lappend kills $lineset b 0}}set b [expr "$b + 1"]}}set a [expr "$a + 1"]    }set bufor "PRIVMSG #channel :\00312\002\[LeDsplej\]\002\0033 $players/$maxplayers \0031"puthelp "$bufor"    }}</code></pre></div>Should i use "return 0" at the end of proc's? What am I doing wrong?<br><br><strong class="text-strong">[These scripts work fine on it's own!]</strong><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8810">Kobra</a> — Sat Mar 17, 2007 11:06 am</p><hr />
]]></content>
	</entry>
	</feed>
