mIRC Home    About    Download    Register    News    Help

Print Thread
#180793 13/07/07 09:33 PM
Joined: Jan 2004
Posts: 509
L
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.

Joined: Dec 2002
Posts: 2,962
S
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.
Joined: Jun 2007
Posts: 15
W
Pikka bird
Offline
Pikka bird
W
Joined: Jun 2007
Posts: 15
lol

Joined: Jan 2004
Posts: 509
L
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.

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
What is the loop for and did you inc %i inside the loop?

Joined: Jan 2004
Posts: 509
L
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...

Joined: Jan 2004
Posts: 509
L
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>
}

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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.

Joined: Dec 2002
Posts: 503
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Dec 2002
Posts: 503
iswim?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031
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

Joined: Jan 2004
Posts: 509
L
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Wow Rocks thanks. Well I think this topic can be deleted too.


Link Copied to Clipboard