mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I think the following code should be producing a list of channels that a selected nick is in, but that I'm not. Sort of the opposite of the $comchan identifier. However, my testing shows that it's still coming up with all of the channels, not just the one's that are different (or none if all are the same)
Code:
 raw 319:*:{
  did -v Channel_Control 1019,1020
  var %a = 1, %b = $numtok($3-,32)
  while %a <= %b {
    var %temp.chan = $gettok($3-,%a,32)
    if $me !ison %temp.chan {
      did -a Channel_Control 1020 %temp.chan
    }
    inc %a
  }
  ;didtok Channel_Control 1020 32 $3-
  did -rva Channel_Control 1021 $did(Channel_Control,1020).lines
  halt
}
 

Joined: Aug 2005
Posts: 525
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Aug 2005
Posts: 525
I think the problem is you aren't removing the prefixes, if there are any.

Edit: here's a simpler way of getting the chan list, free of prefixes. mIRC 6.17 is needed.

Code:
raw 319:*:{
  var %chans = $regsubex($3-,/(?<=^|)[ $+ $+(\Q,$prefix,\E) $+ ]+/g,), %i = 1, %l = $numtok(%chans,32), %curr.chan
  while (%i <= %l) {
    %curr.chan = $gettok(%chans,%i,32)
    if ($me !ison %curr.chan) {
     ; something
    }
    inc %i
  }
}

Last edited by schaefer31; 17/04/06 03:38 AM.
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
thanks...I had a feeling it was something obvious...your code works great...appreciated.


Link Copied to Clipboard