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

	<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>2002-11-27T09:33:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Nexus6]]></name></author>
		<updated>2002-11-27T09:33:21-04:00</updated>

		<published>2002-11-27T09:33:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13679#p13679</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13679#p13679"/>
		<title type="html"><![CDATA[timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13679#p13679"><![CDATA[
yes, method 2 suits me the best <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Huge thanks ppslim<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1850">Nexus6</a> — Wed Nov 27, 2002 9:33 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-11-26T19:14:11-04:00</updated>

		<published>2002-11-26T19:14:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13663#p13663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13663#p13663"/>
		<title type="html"><![CDATA[timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13663#p13663"><![CDATA[
The error massge is quite meaningful in this situation.<br><div class="codebox"><p>Code: </p><pre><code>proc unban {} { global chan putserv "MODE $chan -b ban1*!*@*" }</code></pre></div>Note the use of $chan.<br><br>This variable does not exists in the proc.<br><br>It must be created, or imported via 1 of three ways.<br><br>1, to explictly set the variable using th set command within the proc, but before the use of $chan.<br><div class="codebox"><p>Code: </p><pre><code>proc unban {} { set chan #blahputserv "MODE $chan -b ban1*!*@*" }</code></pre></div>2, to have it imported as part of passed arguments, in the proc definition<br><div class="codebox"><p>Code: </p><pre><code>proc unban {chan} { putserv "MODE $chan -b ban1*!*@*" }</code></pre></div>3, to get the variable from a globaly defined on (as allready used in your script<br><div class="codebox"><p>Code: </p><pre><code>proc unban {} { global chan putserv "MODE $chan -b ban1*!*@*" }</code></pre></div>Your code is wrong however. Allthough ti is tryign to get a global variable. The fact that this variable doesn't exist globaly, means that it will error as such.<br><br>You best bet would be to use method 2.<br><br>In the time command, you can send the channel name accross, along with calling the command.<br><br>Looking at your snippet, you could use somthing like<br><div class="codebox"><p>Code: </p><pre><code>if {![info exists bans]} {set bans [timer 1 [list unban $chan]]} (...) </code></pre></div>alogn with the explae code I used in method 2.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Nov 26, 2002 7:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nexus6]]></name></author>
		<updated>2002-11-26T18:55:23-04:00</updated>

		<published>2002-11-26T18:55:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=13660#p13660</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=13660#p13660"/>
		<title type="html"><![CDATA[timer]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=13660#p13660"><![CDATA[
I have this in proc and it works<div class="codebox"><p>Code: </p><pre><code>(...) putserv "MODE $chan +b ban1*!*@*if {![info exists bans]} {set bans [timer 1 unban]} (...) </code></pre></div><div class="codebox"><p>Code: </p><pre><code>proc unban {} {global chan putserv "MODE $chan -b ban1*!*@*"}</code></pre></div><blockquote class="uncited"><div> (b0t) [23:48] TCL error in script for 'timer30':<br> (b0t) [23:48] can't read "chan": no such variable </div></blockquote>Why doesn't it work? Chan is in global. It's 00:09 I won't figure it out this night, so I'd be grateful if someone helped me a bit <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=1850">Nexus6</a> — Tue Nov 26, 2002 6:55 pm</p><hr />
]]></content>
	</entry>
	</feed>
