mIRC Homepage
Posted By: SLiprockS need help on TEXT - 20/01/09 08:34 PM
well i need a identifier or something that can identify from pvt msg that (s)he is op on chan any common chan. i used this one
if ($comchan(%ab.nick,1).op == $true) but it don't work when I'm op. can anyone suggest something like when someone pvt me it will identify that he's op on common chan I'm in without whois.

Thanks
Posted By: 5618 Re: need help on TEXT - 20/01/09 08:51 PM
You could try to use a while-loop:

Code:
var %count = 1
var %total = $comchan($nick,0)
while (%count <= %total) {
  if ($nick isop $comchan($nick,%count)) { your.code.here | break }
  inc %count
}

Maybe there are more elegant solutions.
Posted By: Wims Re: need help on TEXT - 20/01/09 09:16 PM
Others solution are /goto (not very appreciated, slower than a while) and with this particular case $regsubex (faster than a while), but this two others solution are not more elegant.
Posted By: Horstl Re: need help on TEXT - 20/01/09 11:20 PM
..to make an identifier (modifying the code of 5678):
Code:
alias iscomchanop {
  var %n = 1
  while ($comchan($1,%n)) {
    if ($1 isop $v1) { return $true | break }
    inc %n
  }
}

...for example:
Code:
on ^*:open:?:*: {
  if (!$iscomchanop($nick)) {
    echo -ac info * Query of $nick blocked (not op in any comchan)
    halt
  }
}
Posted By: Wims Re: need help on TEXT - 20/01/09 11:47 PM
I'm sure you know and it's certainly because you copy/paste the code of 5678 but the /break should be removed now smile
Posted By: Horstl Re: need help on TEXT - 21/01/09 03:55 AM
Yepp, hard to jump out of the same plane twice at the same time laugh
Posted By: SLiprockS Re: need help on TEXT - 05/02/09 06:09 PM
Thanks guys. I got what i needed smile
© mIRC Discussion Forums