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

	<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-04-22T03:54:03-04:00</updated>

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

		<entry>
		<author><name><![CDATA[LethPhaos]]></name></author>
		<updated>2007-04-22T03:53:37-04:00</updated>

		<published>2007-04-22T03:53:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72189#p72189</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72189#p72189"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72189#p72189"><![CDATA[
Thanks a lot!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8924">LethPhaos</a> — Sun Apr 22, 2007 3:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-21T19:37:39-04:00</updated>

		<published>2007-04-21T19:37:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72182#p72182</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72182#p72182"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72182#p72182"><![CDATA[
You want to use the global variable inside the procedure but you're using it as a local variable (belonging to the proc's level), using :: indicates that the variable is in the global namespace. You can add 'global channels' line in your proc and normally use $channels(output) instead.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 21, 2007 7:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LethPhaos]]></name></author>
		<updated>2007-04-21T15:11:41-04:00</updated>

		<published>2007-04-21T15:11:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72178#p72178</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72178#p72178"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72178#p72178"><![CDATA[
oops, indeed forgot to replace one var name, fixed<br><br>edit: okay, it's workig now, due to your hint of adding the ::<br><br>but what does that do exactly? :p<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8924">LethPhaos</a> — Sat Apr 21, 2007 3:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-21T14:38:30-04:00</updated>

		<published>2007-04-21T14:38:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72176#p72176</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72176#p72176"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72176#p72176"><![CDATA[
<blockquote class="uncited"><div>Tcl error [pub:command]: can't read "prechan(output)": no such variable</div></blockquote>In the code you've posted, there's no <strong class="text-strong">prechan</strong> array at all. I guess you've changed the names of the variables; your 'channels' array is not global in the validchan proc, so use $::channels(output) instead.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 21, 2007 2:38 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LethPhaos]]></name></author>
		<updated>2007-04-21T14:22:50-04:00</updated>

		<published>2007-04-21T14:22:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72174#p72174</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72174#p72174"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72174#p72174"><![CDATA[
i'll change the name of the proc to checkchan<br>i'm not removing the proc because the bot doesn't have to react on the command on every channel it is in, only on channels specified in the var<br><br>what do you think is causing the problem?<br><br>thanks for your help!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8924">LethPhaos</a> — Sat Apr 21, 2007 2:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2007-04-21T14:12:37-04:00</updated>

		<published>2007-04-21T14:12:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72173#p72173</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72173#p72173"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72173#p72173"><![CDATA[
delete<div class="codebox"><p>Code: </p><pre><code>proc validchan { chan } {  foreach c $channels(output) {    if { $chan == $c } { return 1 }    else { return 0 }  }}</code></pre></div>I don't see the use of this check (validchan) anyway, the bot is already on it when it saw the request.<br><br>Edit: After reading your post again, I noticed that the error you posted has nothing to do with the code you posted.<br><br>However, I suggest you change the name of your proc [validchan] since that is an Eggdrop Tcl command and may cause problems with other scripts.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sat Apr 21, 2007 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LethPhaos]]></name></author>
		<updated>2007-04-22T03:54:03-04:00</updated>

		<published>2007-04-21T13:50:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=72172#p72172</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=72172#p72172"/>
		<title type="html"><![CDATA[[solved] error regarding a variable]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=72172#p72172"><![CDATA[
Hi all,<br><br>I get the following error message:<div class="codebox"><p>Code: </p><pre><code>Tcl error [pub:command]: can't read "channels(output)": no such variable</code></pre></div>when I type !command while i'm in channel #output, how can I solve this problem?<br><br>Thanks in advance!<br><div class="codebox"><p>Code: </p><pre><code>set channels(output) "#output #output2"set channels(output) [ split $channels(output) ]bind pub -|- "!command" pub:commandproc pub:command { nick uhost hand chan args } {  if { [ validchan $chan ] } {    putquick "privmsg $chan :you called?"  }}proc validchan { chan } {  foreach c $channels(output) {    if { $chan == $c } { return 1 }    else { return 0 }  }}</code></pre></div><div class="codebox"><p>Code: </p><pre><code></code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8924">LethPhaos</a> — Sat Apr 21, 2007 1:50 pm</p><hr />
]]></content>
	</entry>
	</feed>
