mIRC Home    About    Download    Register    News    Help

Print Thread
R
RusselB
RusselB
R
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
}
 

S
schaefer31
schaefer31
S
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.
R
RusselB
RusselB
R
thanks...I had a feeling it was something obvious...your code works great...appreciated.


Link Copied to Clipboard