mIRC Home    About    Download    Register    News    Help

Print Thread
#208436 20/01/09 08:34 PM
Joined: Oct 2005
Posts: 34
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2005
Posts: 34
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

5
5618
5618
5
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.

#208444 20/01/09 09:16 PM
Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
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.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
..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
  }
}

Joined: Jul 2006
Posts: 4,020
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,020
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #208461 21/01/09 03:55 AM
Joined: Nov 2006
Posts: 1,552
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,552
Yepp, hard to jump out of the same plane twice at the same time laugh

Joined: Oct 2005
Posts: 34
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2005
Posts: 34
Thanks guys. I got what i needed smile


Link Copied to Clipboard