mIRC Home    About    Download    Register    News    Help

Print Thread
On op event not working. #180793 13/07/07 09:33 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Code:
on *:op:#: {
  if ((($opnick == $me) && ($nick != $me) && ($nick != ChanServ))) { 
    /echo -s You have been 12opped by $nick in $chan at $asctime(h:nn:ss) $+ .
  }
}


Works just fine, but when I have..

Code:
on *:op:#: {
  if ($opnick == me) {
    /echo $chan hi
  }
}


(Used ChanServ to op me).

That doesn't trigger, not even the echo..

The 2nd code, I added before the 1st code (if statement only in the same on op event). But the echo won't trigger even though it is first.

Re: On op event not working. [Re: LostShadow] #180795 13/07/07 09:50 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Quote:
on *:op:#: {
if ($opnick == $me) {
/echo $chan hi
}
}


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: On op event not working. [Re: starbucks_mafia] #180796 13/07/07 09:50 PM
Joined: Jun 2007
Posts: 15
W
weakness Offline
Pikka bird
Offline
Pikka bird
W
Joined: Jun 2007
Posts: 15
lol

Re: On op event not working. [Re: weakness] #180799 13/07/07 10:28 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Okay thank you!

Code:
on *:op:#: {
  if (($opnick == $me) && ($nick != $me)) {
    /echo $chan hi
    var %i = 1
    while (%i < 20) {


So when ChanServ ops me, my mIRC freezes. I Ctrl Break, and the line halted was the while line... Did it several times. I don't know why mIRC freezes.

Re: On op event not working. [Re: LostShadow] #180800 13/07/07 10:30 PM
Joined: Dec 2002
Posts: 2,010
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,010
What is the loop for and did you inc %i inside the loop?

Re: On op event not working. [Re: LostShadow] #180801 13/07/07 10:31 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Okay.. I debugged.

I added an echo $chan %i after the var %i = 1 and the while.

1
1
1
1
1

No wonder it stops, mIRC floods infinitely..

I did have the inc... Sometime after...

Re: On op event not working. [Re: RoCk] #180802 13/07/07 10:32 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Originally Posted By: RoCk
What is the loop for and did you inc %i inside the loop?


So far I got..

Code:
on *:op:#: {
  if (($opnick == $me) && ($nick != $me)) {
    /echo $chan hi
    var %i = 1
    echo $chan %i
    while (%i < 20) {
      echo $chan %i
      if ($address($me,%i) isban $chan) {
        /mode $chan -bbbb $v1 $v1
        inc %i
      }
    }
  }
  <Other stuff>
}

Re: On op event not working. [Re: LostShadow] #180805 13/07/07 10:48 PM
Joined: Dec 2002
Posts: 2,010
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,010
You're trying to remove any channel bans that match your address when you're opped by someone other than yourself?

Code:
on *:OP:#: {
  if (($opnick == $me) && ($nick != $me)) {
    var %i = 1,%bans
    while ($ibl(#,%i)) {
      if ($v1 iswm $address($me,5)) {
        var %bans = %bans $v1
        if ($numtok(%bans,32) == $modespl) {
          .timer 1 %i mode # $+(-,$str(b,$v1)) %bans
          var %bans
        }
      }
      inc %i
    }
    if (%bans) .timer 1 %i mode # $+(-,$str(b,$numtok(%bans,32))) %bans
  }
  ; <Other stuff>
}


~ Edit ~

Fixed mistake & shortened the code a tiny bit. This should really be move to Scripts & Popups.

Re: On op event not working. [Re: RoCk] #180808 13/07/07 11:03 PM
Joined: Dec 2002
Posts: 503
B
Bekar Offline
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
iswim?

Re: On op event not working. [Re: Bekar] #180809 13/07/07 11:05 PM
Joined: Dec 2002
Posts: 2,010
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,010
Oops. Fixed .. thanks. smile

It must've been 'i swim' because I've been thinking about going out back and floating in the pool with a cold beer. wink

Re: On op event not working. [Re: RoCk] #180811 13/07/07 11:12 PM
Joined: Jan 2004
Posts: 509
L
LostShadow Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Wow Rocks thanks. Well I think this topic can be deleted too.