mIRC Home    About    Download    Register    News    Help

Print Thread
Notices #2417 18/12/02 08:42 AM
Joined: Dec 2002
Posts: 62
lonesome Offline OP
Babel fish
OP Offline
Babel fish
Joined: Dec 2002
Posts: 62
Code:
ON *:NOTICE:*:*: {
  halt
}


Apparently the above does not halt notices, it still shows up in every channel that the nick is in if he is not in the active channel...

Any ideas what's wrong?

Re: Notices #2418 18/12/02 08:55 AM
Joined: Dec 2002
Posts: 1,321
H
Hammer Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
You have to be very careful with that particular script. It would halt all notices, like this:
Code:

on ^*:NOTICE:*:*: haltdef

That is not really what you mean to do, I don't think. For instance, the above would also block any notices from services on networks which have them, in addition to halting the notice from showing up in the first common channel with them.

One way around that is to send the notice to the first common channel, if there is one, or to the active window if there isn't one.
Code:

on ^*:NOTICE:*:?:{
  if ($comchan($nick,1)) echo $color(notice) -ti2 $+(-,$nick,-) $1-
  else echo $color(notice) -ati2 $+(-,$nick,-) $1-
  haltdef
}

The main drawback here is that notices with leading spaces (frequently seen in services notices) will lose their formatting spaces. Therefore, you might really mean this:
Code:

on ^*:NOTICE:*:?:{
  if ($comchan($nick,1)) {
    echo $color(notice) -ti2 $+(-,$nick,-) $1-
    haltdef
  }
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Re: Notices #2419 18/12/02 11:24 AM
Joined: Dec 2002
Posts: 111
F
Frog Offline
Vogon poet
Offline
Vogon poet
F
Joined: Dec 2002
Posts: 111
This works for me:

on ^*:notice:*:?:{
haltdef
beep
var %i 1,%n $comchan($nick,0)
while (%i <= $comchan($nick,0)) {
if ($nick !ison $comchan($nick,%i)) {
dec %n
}
if ($nick ison $comchan($nick,%i)) {
echo -mi2 $comchan($nick,%i) $+(14:15:,16,$nick,15:,14:,$chr(32),16,$1-)
}
inc %i
}
if (%n == 0) {
echo -mi2s $+(14:15:,14,$nick,15:,14:,$chr(32),15,$1-)
}
}


Experience The Void.. Are You Ready?