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

	<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>2006-11-16T21:10:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-11-16T21:10:07-04:00</updated>

		<published>2006-11-16T21:10:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68135#p68135</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68135#p68135"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68135#p68135"><![CDATA[
<blockquote class="uncited"><div>Didn't say he can't use [after], simply in his case using [utimer] is better since he won't have to worry about changing environments.</div></blockquote>actually it's the other way around - [after] is preferable in this case as it allows you to "kill timer" simply by using [after cancel] and there is no need to enumerate timers first and only then do the match &amp; kill<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Nov 16, 2006 9:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-16T10:30:17-04:00</updated>

		<published>2006-11-16T10:30:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68118#p68118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68118#p68118"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68118#p68118"><![CDATA[
Didn't say he can't use [after], simply in his case using [utimer] is better since he won't have to worry about changing environments.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Nov 16, 2006 10:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2006-11-16T05:34:20-04:00</updated>

		<published>2006-11-16T05:34:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68109#p68109</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68109#p68109"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68109#p68109"><![CDATA[
<blockquote class="uncited"><div>Because the variable <strong class="text-strong">message</strong> is in the proc while the after executes outside the proc; the variable cannot be found. Instead, use the [utimer] eggdrop command.</div></blockquote>there is nothing wrong with using [after] in eggdrop scripts; [utimer] was devised before [after] appeared in Tcl (circa 8.0)<br><br>of course, [vwait] usage in eggdrop is a no-no as it blocks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Nov 16, 2006 5:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-15T17:17:03-04:00</updated>

		<published>2006-11-15T17:17:03-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68095#p68095</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68095#p68095"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68095#p68095"><![CDATA[
Read <a href="http://forum.egghelp.org/viewtopic.php?t=9941" class="postlink">Searching and killing timers</a>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Nov 15, 2006 5:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-15T16:23:55-04:00</updated>

		<published>2006-11-15T16:23:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68091#p68091</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68091#p68091"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68091#p68091"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {![string match "*name_of_timer*" [timers]]} {timer 5 name_of_timer}</code></pre></div>the 5 is the number of minutes as an example..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Wed Nov 15, 2006 4:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Coixi]]></name></author>
		<updated>2006-11-15T15:01:51-04:00</updated>

		<published>2006-11-15T15:01:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=68083#p68083</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=68083#p68083"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=68083#p68083"><![CDATA[
Heya,<br><br>How do i make sure that those timers won't become duplicate when i .rehash. I've seen a very simple script for that but after two hours of hardcore googling i haven't found it. <br><br>It was a if {} with some info_exists stuff but i just cannot find it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8377">Coixi</a> — Wed Nov 15, 2006 3:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-12T20:24:56-04:00</updated>

		<published>2006-11-12T20:24:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67991#p67991</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67991#p67991"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67991#p67991"><![CDATA[
<blockquote class="uncited"><div>Works like a charm, thanks.<br><br>Is utimer/timer best way to keep this whole proc running?<br><br>Or would you suggest something else. I want this to run in a loop, when everything is foreached -&gt; it starts again. But i don't know any good way to do so.</div></blockquote>Call the proc again after the last msg, like this:<div class="codebox"><p>Code: </p><pre><code>set messages {"msg1" "msg2" "msg3"}set channels {#chan1 #chan2 #chan3}proc sendmsg {} { global messages channels set i 0 foreach message $messages {  foreach chan $channels {   utimer [set t [expr {10*[incr i]}]] [list puthelp "PRIVMSG $chan :$message"]  } } utimer $t sendmsg}sendmsg</code></pre></div>Notice how the delay-time is stored in $t, the proc will restart when the last message is sent.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Nov 12, 2006 8:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-11-12T13:17:49-04:00</updated>

		<published>2006-11-12T13:17:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67957#p67957</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67957#p67957"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67957#p67957"><![CDATA[
This format is incorrect for eggdrop (although it may work for tclsh):<br>puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])"<br><br>in eggdrop, you'd need to use:<br><br>puthelp "PRIVMSG $channel :$message etc"<br><br>Note the format of privmsg, the space and the colon are required in the format for irc, refer you to the rfc: <br><br><a href="http://www.irchelp.org/irchelp/rfc/chapter4.html" class="postlink">http://www.irchelp.org/irchelp/rfc/chapter4.html</a><br>Read section: 4.4.1 Private messages<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Sun Nov 12, 2006 1:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Coixi]]></name></author>
		<updated>2006-11-12T13:11:41-04:00</updated>

		<published>2006-11-12T13:11:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67954#p67954</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67954#p67954"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67954#p67954"><![CDATA[
Works like a charm, thanks.<br><br>Is utimer/timer best way to keep this whole proc running?<br><br>Or would you suggest something else. I want this to run in a loop, when everything is foreached -&gt; it starts again. But i don't know any good way to do so.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8377">Coixi</a> — Sun Nov 12, 2006 1:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-12T12:37:38-04:00</updated>

		<published>2006-11-12T12:37:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67950#p67950</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67950#p67950"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67950#p67950"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set messages {"msg1" "msg2" "msg3"}set channels {#chan1 #chan2 #chan3}proc sendmsg {} { global messages channels set i 0 foreach message $messages {  foreach chan $channels {   utimer [expr {10*[incr i]}] [list puthelp "PRIVMSG $chan :$message"]  } }}sendmsg</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Nov 12, 2006 12:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Coixi]]></name></author>
		<updated>2006-11-12T12:28:37-04:00</updated>

		<published>2006-11-12T12:28:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67948#p67948</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67948#p67948"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67948#p67948"><![CDATA[
Well, i did that but now the script sends the last message of $messages array to last channel in $channels array. <br><br>Could you place the utimer in there in a way that it works like with after? Like this: <br><div class="codebox"><p>Code: </p><pre><code>PRIVMSG msg1 #chan1 (11:55:44) PRIVMSG msg1 #chan2 (11:55:54) PRIVMSG msg1 #chan3 (11:56:04) PRIVMSG msg2 #chan1 (11:56:14) PRIVMSG msg2 #chan2 (11:56:24) PRIVMSG msg2 #chan3 (11:56:34) PRIVMSG msg3 #chan1 (11:56:44) PRIVMSG msg3 #chan2 (11:56:54) PRIVMSG msg3 #chan3 (11:57:04)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8377">Coixi</a> — Sun Nov 12, 2006 12:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-11-12T11:50:22-04:00</updated>

		<published>2006-11-12T11:50:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67941#p67941</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67941#p67941"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67941#p67941"><![CDATA[
Because the variable <strong class="text-strong">message</strong> is in the proc while the after executes outside the proc; the variable cannot be found. Instead, use the [utimer] eggdrop command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Sun Nov 12, 2006 11:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Coixi]]></name></author>
		<updated>2006-11-12T06:51:23-04:00</updated>

		<published>2006-11-12T06:51:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=67931#p67931</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=67931#p67931"/>
		<title type="html"><![CDATA[Script works in shell but not as a proc]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=67931#p67931"><![CDATA[
Hello, i've a simple double-foreach script which works nicely when it's runned in shell but when i put it inside proc { }, it won't work anymore.<br><br>Here's the script:<br><div class="codebox"><p>Code: </p><pre><code>set channels "#chan1 #chan2 #chan3"set messages "msg1 msg2 msg3"foreach message $messages {        foreach channel $channels {                after 10000 {                puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])"                set ::pleasewait 1                }        vwait ::pleasewait        }}</code></pre></div>When i start my eggdrop ( v1.6.18 ) it will output this after modules have been loaded:<br><div class="codebox"><p>Code: </p><pre><code>PRIVMSG msg1 #chan1 (11:55:44)PRIVMSG msg1 #chan2 (11:55:54)PRIVMSG msg1 #chan3 (11:56:04)PRIVMSG msg2 #chan1 (11:56:14)PRIVMSG msg2 #chan2 (11:56:24)PRIVMSG msg2 #chan3 (11:56:34)PRIVMSG msg3 #chan1 (11:56:44)PRIVMSG msg3 #chan2 (11:56:54)PRIVMSG msg3 #chan3 (11:57:04)</code></pre></div>After this userfile will be loaded and bot starts normally. The script work as i want it to work but when i want eggdrop to send those messages to channels (make it proc {}), it won't work anymore.<br><br>I'm trying it with this code:<br><div class="codebox"><p>Code: </p><pre><code>set channels "#chan1 #chan2 #chan3"set messages "msg1 msg2 msg3"proc sendmsg {} {global channels messagesforeach message $messages {        foreach channel $channels {                after 10000 {                puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])"                set ::pleasewait 1                }        vwait ::pleasewait        }}}::sendmsg</code></pre></div>But when i start my eggdrop, i'm getting these errors after module loading:<br><div class="codebox"><p>Code: </p><pre><code>can't read "message": no such variable    while executing"puts "PRIVMSG $message $channel ([clock format [clock seconds] -format %H:%M:%S])""    ("after" script)[12:41] Tcl error in file 'coixi.conf':[12:41] can't wait for variable "::pleasewait":  would wait forever    while executing"vwait ::pleasewait"    (procedure "::sendmsg" line 13)    invoked from within"::sendmsg"    (file "scripts/sendmsg.tcl" line 24)    invoked from within"source scripts/sendmsg.tcl"    (file "coixi.conf" line 1343)[12:41] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)</code></pre></div>I've Googled, i've been going thru these forums and tried those variables with and without global, with/without $ and with :: but i cannot get it work. Also that <em class="text-italics">can't wait for variable "::pleasewait":  would wait forever</em> part is bothering me.<br><br>If someone could solve or help with this problem, i'd be happyhappyhappy <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=8377">Coixi</a> — Sun Nov 12, 2006 6:51 am</p><hr />
]]></content>
	</entry>
	</feed>
