mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2005
Posts: 344
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
I cant get this to work on join.

echo -a 12Channel Counter: 9There are13 $nick(#,0) 9Ppl present in 13 $chan 9=13 $opnick(#,0) 9Ops,13 $vnick(#,0) 9Voiced and13 $nopnick(#,0) 9regs.

I tryed it with this :

on ^*:JOIN:#:{
haltdef
if ($nick == $me) {
if ($chan != $chan:) {

Please help

Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
See if this works:

Code:
on me:*:join:#channel: {
  //echo -a Channel Counter: There are $nick(#,0) Ppl present in $chan = $nick(#,0,o) Ops, $nick(#,0,v) Voiced and $nick(#,0,r) regs.
}


If that works for you, you would combine it into an existing ON JOIN event by doing this:

Code:
on *:join:#channel: {
  if ($nick == $me) { //echo -a Channel Counter: There are $nick(#,0) Ppl present in $chan = $nick(#,0,o) Ops, $nick(#,0,v) Voiced and $nick(#,0,r) regs. }
  more code
  more code
  more code
  more code
}



Hope this helps


Those who fail history are doomed to repeat it
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
did you try using a timer? The nicklist isnt filled right away when you join, so a timer will work:
Code:
on *:join:#: if ($nick == $me) { .timerchancount 1 1 ChanCount $chan }

alias ChanCount { echo -a 12Channel Counter: 9There are13 $nick($1,0) 9Ppl present in 13 $1 9=13 $opnick($1,0) 9Ops,13 $vnick($1,0) 9Voiced and13 $nopnick($1,0) 9regs. }


Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
The reason it won't work is because at the point when you join a channel, mIRC doesn't know who else is on the channel yet, you should use the end of names list (raw 366).
  • :server.address 366 You #channel :End of /NAMES list.
    $1 = You
    $2 = #channel
Code:
raw 366:*:{
  echo [color:blue]$2[/color] 12Channel Counter: 9There are13 $nick([color:blue]$2[/color],0) 9Ppl present in 13 [color:blue]$2[/color] 9=13 $nick([color:blue]$2[/color],0,o) 9Ops,13 $nick([color:blue]$2[/color],0,v,o) 9Voiced and13 $nick([color:blue]$2[/color],0,r) 9regs.
}


Link Copied to Clipboard