mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2003
Posts: 8
T
Tubos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Dec 2003
Posts: 8
Hallo;

I´m using $nick(%channel,0) to find out how many users there are.
But theres one problem: I join the channel just before i call $nick. mIRC needs a short time to get the user list from the channel and $nick returns nothing.
How can I get around this?
/names %channel doesnt work.

Is there a function that waites a certain amount of milliseconds before continuing with the script?

Or another solution for this problem?

Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Do it on raw 366 (end of /names list) instead.

raw 366:*:dostuff

$2 will be the channel name.

Joined: Apr 2004
Posts: 45
V
Ameglian cow
Offline
Ameglian cow
V
Joined: Apr 2004
Posts: 45
yep, you're right. What happens is this:

When you initially join a channel, mirc thinks you're the only one in there. Then, it automatically runs /names, and uses the response to fill the nicklist. To see how many people are in a chan when you join it, or optionally how many ops, voiced nicks, etc., you need to respond after /names is done. For that, you use:

raw 366: [Your Nickname] [#channel] End of /NAMES list.

so,

raw 366:*: { echo $2 There are $nick($2,0) people in here. }

You can use $nick($2,0) to return the total # of users, or other variations to find out other info. check /help $nick (Nick and Address Identifiers section) for more info on that.

-Venoman

Joined: Dec 2003
Posts: 8
T
Tubos Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
T
Joined: Dec 2003
Posts: 8
thx, works perfectly!


Link Copied to Clipboard