mIRC Home    About    Download    Register    News    Help

Print Thread
opnotice #175100
17/04/07 04:21 PM
17/04/07 04:21 PM
Joined: Apr 2007
Posts: 13
S
StormTrooper Offline OP
Pikka bird
StormTrooper  Offline OP
Pikka bird
S

Joined: Apr 2007
Posts: 13
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

Re: opnotice [Re: StormTrooper] #175104
17/04/07 06:03 PM
17/04/07 06:03 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
hixxy  Offline
Hoopy frood
H

Joined: Sep 2005
Posts: 2,876
Code:
on ^*:notice:*:#:{
  if (@* iswm $target) { echo -a 4Ops Notice : $1- }
}

Re: opnotice [Re: StormTrooper] #175107
17/04/07 06:28 PM
17/04/07 06:28 PM
Joined: Nov 2006
Posts: 1,559
Germany
H
Horstl Offline
Hoopy frood
Horstl  Offline
Hoopy frood
H

Joined: Nov 2006
Posts: 1,559
Germany
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

Re: opnotice [Re: Horstl] #175108
17/04/07 06:57 PM
17/04/07 06:57 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
hixxy  Offline
Hoopy frood
H

Joined: Sep 2005
Posts: 2,876
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
  }
}

Re: opnotice [Re: hixxy] #175109
17/04/07 07:11 PM
17/04/07 07:11 PM
Joined: Apr 2007
Posts: 13
S
StormTrooper Offline OP
Pikka bird
StormTrooper  Offline OP
Pikka bird
S

Joined: Apr 2007
Posts: 13
thnx for the quick answer

you rock

Re: opnotice [Re: StormTrooper] #175110
17/04/07 07:14 PM
17/04/07 07:14 PM
Joined: Nov 2006
Posts: 1,559
Germany
H
Horstl Offline
Hoopy frood
Horstl  Offline
Hoopy frood
H

Joined: Nov 2006
Posts: 1,559
Germany
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.


Re: opnotice [Re: hixxy] #175165
18/04/07 02:27 PM
18/04/07 02:27 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
genius_at_work  Offline
Hoopy frood
G

Joined: Oct 2005
Posts: 1,741
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

Re: opnotice [Re: genius_at_work] #175181
18/04/07 05:14 PM
18/04/07 05:14 PM
Joined: Sep 2005
Posts: 2,876
H
hixxy Offline
Hoopy frood
hixxy  Offline
Hoopy frood
H

Joined: Sep 2005
Posts: 2,876
You're right, I just always assumed it would use the @#channel method.

Re: opnotice [Re: genius_at_work] #175202
18/04/07 10:10 PM
18/04/07 10:10 PM
Joined: Feb 2006
Posts: 546
J
jaytea Offline
Fjord artisan
jaytea  Offline
Fjord artisan
J

Joined: Feb 2006
Posts: 546
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)


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde