mIRC Homepage
Posted By: StormTrooper opnotice - 17/04/07 04:21 PM
on ^1:notice:*:#:{
if $nick isop $chan { .echo -a 4Ops Notice : $1- }
}

i made this i dont know its right o no

i use this /onotice text

thnx

for the hel'p
Posted By: hixxy Re: opnotice - 17/04/07 06:03 PM
Code:
on ^*:notice:*:#:{
  if (@* iswm $target) { echo -a 4Ops Notice : $1- }
}
Posted By: Horstl Re: opnotice - 17/04/07 06:28 PM
Should be working:
Code:
on ^@*:notice:*:#:{ echo -a OpNotice $+($chr(91),$chan,$chr(44) $nick,$chr(93),$chr(58)) $1- | haltdef }

$+(a,b,c) is for binding square brackets, identifiers etc in the line returned, it will look like: OpNotice [#Chan, NickWhoSent]: Content of notice

1) You dont have to check for $nick being op, as only ops can send or receive op-notices
2) Using the @-prefix, the event will only be executed if you are op (if Im not, I can not receive Op-notices, anyway... ).
3) Using the ^-prefix is for halting mIRC's default text output, therefore I added "haltdef"
4) Unlike "normal" notices, Op-notices provide a $chan, I think knowing what chan was onoticed might be useful smile
Posted By: hixxy Re: opnotice - 17/04/07 06:57 PM
That will detect normal notices sent to the channel, not just op notices, and your $+() is a bit more long-winded than it needs to be: $+([,$chan,$chr(44) $nick,]smile

To detect op notices, you have to check that the target of the message begins with @ (to send an op notice, you send a /notice to @#channel instead of just #channel, this is what /onotice does), which is what I provided before.

Also, you said yourself that you can only receive op notices if you're an op, so there's no need for the @ prefix.

Here's a working version of your script:

Code:
on ^*:notice:*:#:{
  if (@* iswm $target) {
    echo -a OpNotice $+([,$chan,$chr(44) $nick,]:) $1- 
    haltdef
  }
}
Posted By: StormTrooper Re: opnotice - 17/04/07 07:11 PM
thnx for the quick answer

you rock
Posted By: Horstl Re: opnotice - 17/04/07 07:14 PM
Mea Culpa. Was a bit overhasty and also did not think about $target, which is the best way to detect onotices, no doubt.
Also, I wanted the @-prefix to separate regular notices / onotices by halting and re-formatting only onotices. Regular notices sent by another op did not trigger, but my code would become a mess regarding other on notice - events... thx for your emendation, I did not refresh the page to see your first, and sufficient reply.

Posted By: genius_at_work Re: opnotice - 18/04/07 02:27 PM
I don't think that /onotice sends op notices as @#channel. It seems to send individual regular notices to people who mIRC sees as ops on that channel.

/!onotice #channel testing onotice
-> wildtime.beyondirc.net NOTICE ChanServ,user01,user02 :testing onotice


/!notice @#channel testing @notice
-> wildtime.beyondirc.net NOTICE @#channel :testing onotice


-genius_at_work
Posted By: hixxy Re: opnotice - 18/04/07 05:14 PM
You're right, I just always assumed it would use the @#channel method.
Posted By: jaytea Re: opnotice - 18/04/07 10:10 PM
Originally Posted By: genius_at_work
I don't think that /onotice sends op notices as @#channel. It seems to send individual regular notices to people who mIRC sees as ops on that channel.

/!onotice #channel testing onotice
-> wildtime.beyondirc.net NOTICE ChanServ,user01,user02 :testing onotice


/!notice @#channel testing @notice
-> wildtime.beyondirc.net NOTICE @#channel :testing onotice


-genius_at_work


it does if the server indicates it's supported (if i recall right it sends WALLCHOPS or STATUSMSG= with @ in raw05)
© mIRC Discussion Forums