mIRC Homepage
Posted By: RusselB Code not producing correct output - 17/04/06 02:49 AM
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
}
 
Posted By: schaefer31 Re: Code not producing correct output - 17/04/06 03:18 AM
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
  }
}
Posted By: RusselB Re: Code not producing correct output - 17/04/06 03:34 AM
thanks...I had a feeling it was something obvious...your code works great...appreciated.
© mIRC Discussion Forums