mIRC Home    About    Download    Register    News    Help

Print Thread
need help on TEXT #208436 20/01/09 08:34 PM
Joined: Oct 2005
Posts: 34
S
SLiprockS Offline OP
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

Re: need help on TEXT [Re: SLiprockS] #208438 20/01/09 08:51 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
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.

Re: need help on TEXT [Re: 5618] #208444 20/01/09 09:16 PM
Joined: Jul 2006
Posts: 3,880
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,880
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.

Re: need help on TEXT [Re: SLiprockS] #208453 20/01/09 11:20 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
..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
  }
}

Re: need help on TEXT [Re: Horstl] #208454 20/01/09 11:47 PM
Joined: Jul 2006
Posts: 3,880
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,880
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

Re: need help on TEXT [Re: Wims] #208461 21/01/09 03:55 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Yepp, hard to jump out of the same plane twice at the same time laugh

Re: need help on TEXT [Re: Horstl] #209169 05/02/09 06:09 PM
Joined: Oct 2005
Posts: 34
S
SLiprockS Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Oct 2005
Posts: 34
Thanks guys. I got what i needed smile