mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2005
Posts: 5
R
rOglrah Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
R
Joined: Mar 2005
Posts: 5
Code:
on *:invite:#:{
  .join $chan
  if ($nick($chan,0) > 5) {
    .notice $nick Hi $nick $+ !
  }
  else {
    .notice $nick Error! less than 5 ppl in channel.
    .part $chan
  }
} 

It seems like $nick($chan,0) returns $null =/
Why? How can I fix it?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Only thing I can think of is that your script is trying to get the number of people in the channel, before your /join completes.

The following code, should solve the problem.

Code:
on *:invite:#:{ .join # }
on *:join:#:{
if $nick(#,0) > 5 { .notice $nick Hi $nick $+ ! }
else .notice $nick Error, less than 5 people in the room | .part #
}
 

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
The nicklist is filled in the end of /names raw (raw 366), so you'll have to use that.


New username: hixxy
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Try something like...

Code:
On *:Invite:#: {
  .enable #nicks
  set %inv.nick $nick
  set %inv.chan $chan
  JOIN %inv.chan
}

#nicks off
Raw 353:*: {
  if ($numtok($4-,32) > 5) { .notice %inv.nick Hi %inv.nick $+ ! }
  else { part %inv.chan | .notice %inv.nick Error! less than 5 ppl in channel. }
}

Raw 366:*: {
  unset %inv.*
  .disable #nicks
}
#nicks end


Link Copied to Clipboard