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
You could try to use a while-loop:
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.
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.
..to make an identifier (modifying the code of 5678):
alias iscomchanop {
var %n = 1
while ($comchan($1,%n)) {
if ($1 isop $v1) { return $true | break }
inc %n
}
}
...for example:
on ^*:open:?:*: {
if (!$iscomchanop($nick)) {
echo -ac info * Query of $nick blocked (not op in any comchan)
halt
}
}
I'm sure you know and it's certainly because you copy/paste the code of 5678 but the /break should be removed now
Yepp, hard to jump out of the same plane twice at the same time
Thanks guys. I got what i needed