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

	<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-07-23T16:33:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[guppy]]></name></author>
		<updated>2002-07-23T16:33:04-04:00</updated>

		<published>2002-07-23T16:33:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9122#p9122</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9122#p9122"/>
		<title type="html"><![CDATA[Problems with vwait or: waiting for variables to be set]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9122#p9122"><![CDATA[
I dunno what numeric 615 is however (so I'll guess it looks like this: :server 615 &lt;nickname&gt; :Is registered) ... you could something like this:<br><div class="codebox"><p>Code: </p><pre><code>bind raw - 615 raw:615bind msg -|- vhost setvhosttrace variable isregged w trace:isreggedproc setvhost {nick uhost hand arg} {  global isregged isregged_timers  putquick "WHOIS $nick" -next  set lnick [string tolower $nick]  set isregged_timers($lnick) [utimer 5 "set isregged($lnick) 0"]}proc raw:615 {from numeric arg} {  global isregged isregged_timers  scan $arg "%s" nick  set lnick [string tolower $nick]  if {[info exists isregged_timers($lnick)]} {    killutimer $isregged_timers($lnick)    unset isregged_timers($lnick)    set isregged($lnick) 1  }}proc trace:isregged {variable nick cmd} {  global isregged isregged_timers  if {$isregged($nick) == 1} {    putlog "$nick is registered"  } else {    unset isregged_timer($nick)    putlog "$nick is not registered"  }  unset isregged($nick)}</code></pre></div>handles more than one person doing /msg &lt;bot&gt; vhost .. handles timeout incase the server takes a long ass time to respond to the WHOIS .. doesn't handle the same person doing /msg &lt;bot&gt; vhost more than once within the amount of time it takes to reach the timeout (this can be fixed easily w/ a bit better design).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10">guppy</a> — Tue Jul 23, 2002 4:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-07-23T10:29:11-04:00</updated>

		<published>2002-07-23T10:29:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9106#p9106</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9106#p9106"/>
		<title type="html"><![CDATA[Problems with vwait or: waiting for variables to be set]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9106#p9106"><![CDATA[
Thanks. Hmm, somehow the timer solution sounds as if it can process only 1 request at once, but I will try it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Tue Jul 23, 2002 10:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-07-23T09:35:28-04:00</updated>

		<published>2002-07-23T09:35:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9102#p9102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9102#p9102"/>
		<title type="html"><![CDATA[Problems with vwait or: waiting for variables to be set]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9102#p9102"><![CDATA[
You can't make it wait.<br><br>In this situation, you are telling the script to wait for a variable, that will never get set. vwait is used to process background functions until the var is set, but in Tcl, there are no standard backgroud Tcl functions.<br><br>As for the while loop. You are making the same code execute over and over again. Unless the command that actualy set's the var is triggered in the while look, it will never change. IE, it will remain on that part of the script, and never process the incoming command to set the isreg var.<br><br>One way around it is to use utimers. Call a script every 1 second, and see if the var has been set. If not, re-start the utimer. If set, bypass the timer restart, and run the rest of the script.<br><br>In the timer version, eggdrop is able to process other incoming IRC traffic between timer runs. In the others, because the script never gives control back to eggdrop, the IRC traffic that causes the setting change, is never run.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue Jul 23, 2002 9:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-07-23T09:21:32-04:00</updated>

		<published>2002-07-23T09:21:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9101#p9101</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9101#p9101"/>
		<title type="html"><![CDATA[Problems with vwait or: waiting for variables to be set]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9101#p9101"><![CDATA[
Hi,<br><br>I wanted to write a tcl script which looks if a user is registered at the services of the irc-network. That was no great problem but now another proc should use it. Both use the global variable isregged. Then there are the two procs:<br><br>bind msg -|- vhost setvhost<br>bind raw * 615 modereturn<br><br>the setvhost proc uses:<br>set isregged ""<br>putserv "WHOIS $nick"<br>vwait isregged<br><br>if the user has usermode +r set $isregged will be 1 else 0, but I always get: Tcl error [setvhost]: can't wait for variable "isregged": would wait forever<br><br>So I tried to use a while loop (yes, i know that's a bad idea)<br>set antiloop 0<br>while {$antiloop &lt; 9999999} {<br>        if {$isregged != ""} {break}<br>        incr antiloop<br>}<br><br>but if I use that loop the modereturn proc is never started. So how can I tell the setvhost proc to wait until $isregged is changed?<p>Statistics: Posted by Guest — Tue Jul 23, 2002 9:21 am</p><hr />
]]></content>
	</entry>
	</feed>
