This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Is it ok use vwait varname ? no... it doesn't run.

Old posts that have not been replied to for several years.
Locked
r
raid3n

Is it ok use vwait varname ? no... it doesn't run.

Post by raid3n »

Hi all! I have a question for you:
I have code like this:
the varname registrato is the respective "registered" in english.

Code: Select all

bind raw - 307 proc:whois
bind join - * proc:join

proc proc:whois { f k t } {
global registrato
set registrato on
}


proc proc:join {n uh h c} {
global registrato
set registrato off
putserv "WHOIS $n"
     if {$registrato == off} {
      puthelp "NOTICE $n :text"
     }
} 
When a user join the channel the egg whois him. But my problem is that proc:join finish earlier than proc:whois. The varname $registrato don't wait that proc:whois update itself.
I try to use "vwait $registrato" but it doesn't run. After "WHOIS $n" the proc proc:join must wait that proc:whois finished his work.
Help me! ...and excuse me my horrible english.
Bye.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

use arrays, example instead of registrato use registrato([string tolower $nick]) and set for each a different element (i.e. on/off)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Tcl and eggdrop do not operate in the way you want.

vwait casues eggdrop to block, IE, the whois reply is never read from the buffer, let alone calling the whois proc.

What you need to do is let the proc finish, and listen for the end of whois RAW numeric.

When you get this, you can output stored data.
Locked