mIRC Home    About    Download    Register    News    Help

Print Thread
on onotice / omsg ? #80061 21/04/04 08:40 AM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi All,

I'm hoping for the usual speedy response I have been impressed with time and again on this board! wink

Q: I have just had a quick scan through the help file and I cannot find an identifier for op notices or op messages, does anyone know if such a thing exsists?

I am adding a small piece to my script and was wondering if I could use on *:onotice:
and on *:omsg:
Im making a OpChat window and I'm a little brain dead this morning, cant seem to gather my thoughts!

It's amazing how the simple stuff can stump you from time to time heh?

Regards,
Diz


Dizkonnekted from reality....!
Re: on onotice / omsg ? #80062 21/04/04 09:02 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Nah there isn't, you could use something like so..
Code:
on *:notice:*:#:{
  if @ isin $remove($target,#) { ; its an opnotice }  
}
Same with on *:text:*:#: for /omsg

edit: It should be noted that onotices are sometimes nothing more than norrmal notices sent to all the channel ops.

Last edited by Iori; 21/04/04 09:05 AM.
Re: on onotice / omsg ? #80063 21/04/04 09:34 AM
Joined: Dec 2002
Posts: 191
N
Nobodi Offline
Vogon poet
Offline
Vogon poet
N
Joined: Dec 2002
Posts: 191
Would have thought @#* iswm $target would have been a better way to check as a channel can have @ within it's name #some@chan would still match.
if @ isin $remove($target,#) { ; its an opnotice }

Re: on onotice / omsg ? #80064 21/04/04 09:37 AM
Joined: Nov 2003
Posts: 46
D
Dizkonnekted Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Nov 2003
Posts: 46
Hi Iori,

Thanks for the swift response, yeah thats what I figured, I think I just needed confirmation of the fact, its a pity though, would be really handy for scripting! wink

Regards,
Diz


Dizkonnekted from reality....!
Re: on onotice / omsg ? #80065 21/04/04 12:22 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
No it wouldn't match a normal channel notice for #some@chan, remember that in a channel related event "#" equates to "#channelname".
If the channel was #some@chan, $target (for an onotice) would be @[color:salmon]#some@chan[/color].
Now $remove(@[color:salmon]#some@chan[/color],#some@chan) leaves @.
If it was an op/voice notice you would have @+ left after the $remove.
A normal channel notice would leave {nothing} once the channel name is removed from its $target.

To summarize:
$remove(@#some@chan,#) leaves @
$remove(@+#some@chan,#) leaves @+
$remove(!@#some@chan,#) leaves !@

$remove(#some@chan,#) leaves {nothing}

Re: on onotice / omsg ? #80066 21/04/04 12:23 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Yeah it would be useful even though it still probably wouldn't match non <$prefix>#channel notices. smile

Re: on onotice / omsg ? #80067 21/04/04 01:08 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Note: unlike /onotice, the command /omsg doesn't do a /msg @#channel. Instead, it sends a private message to a comma-separated list of ops.

Re: on onotice / omsg ? #80068 21/04/04 01:23 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
It does on at least some networks, Dalnet is one that comes to mind that uses "PRIVMSG @#channel". wink

Re: on onotice / omsg ? #80069 21/04/04 03:37 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
True. I guess this is the time to get rid of this odd distinction and make /omsg target @#channel on any network. Although @# is not IRC-compliant, I don't believe there are servers that don't recognize it nowadays.

Re: on onotice / omsg ? #80070 21/04/04 04:47 PM
Joined: Aug 2003
Posts: 325
W
Wolfie Offline
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Here are my ideas/methods:

Want to just see if it's to the room or not?
if ( $target == $chan ) { ;to entire room }
Can't get easier than that smile But that won't tell you if it's to OPs only, Voices only, or both.

The IRC's that I use don't support +#roomname for notices, only @#roomname, so I can only guess how the $target would appear if it's sent to both @ and +

alias targets {
tokenize 32 $1- | ;Dummy proofing, don't ask wink
tokenize 32 $iif($1,$1,*) $gettok($target,1,35)
return $iif($1 == *,$2,$iif($1 == $2,$true))
}

I haven't tested this thing out, but it should work.
if ( $targets(@) ) { ; notice is to OPs only }
if ( $targets(+) ) { ; notice is to Voices only }
if ( @ isin $targets(*) ) { ; notice is to OPs (but may be to Voices too) }

I saw a reference to omsg not working the same as onotice.. I say it depends on the method you use.
alias o { .notice $+(@,#) $1- | echo -t # Ops $+(#,:) $1- }
/o hey ops, I'm here!
That'll do the same thing as onotice, BUT it won't matter if you're OP'd or not. We use the same concept because then if an op is voiced down, they can still send the rest of us ops notices without getting error messages. (/o is way easier to type than /onotice by the way, but if you use /o for something else, then you can make it /ops, etc)

EDIT: Forgot to mention that the same idea can be tried for sending op messages.. /msg $+(@,#) $1-

Last edited by Wolfie; 21/04/04 05:08 PM.
Re: on onotice / omsg ? #80071 21/04/04 06:08 PM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
for /omsg I had to capture the proper on text event and I used if ($target == @ $+ $chan) { commands } Works fine for me smile


Those who fail history are doomed to repeat it