Discussion:
ON:QUERY: script
(too old to reply)
f00ge
2004-08-27 14:52:10 UTC
Permalink
Hello,

I'm not too hot with scripting, but I thought it would be possible to do
something like:
on *:QUERY:#:/notice 2ndmIRC (mask?)

That didn't work.
I have 2 PCs on the same IRC network, but I only monitor one of the PCs all
the time.
I want to recieve notice or something in my first PC, when the second PC's
mirc is getting a query message.

Can this be done somehow?

Thanks in advance.
Joel
2004-08-27 16:39:09 UTC
Permalink
Post by f00ge
I'm not too hot with scripting, but I thought it would be possible to do
on *:QUERY:#:/notice 2ndmIRC (mask?)
That didn't work.
I have 2 PCs on the same IRC network, but I only monitor one of the PCs all
the time.
I want to recieve notice or something in my first PC, when the second PC's
mirc is getting a query message.
on *:TEXT:*:?:notice <nick on other machine> Message on second machine
from $nick $+ : $1-

That presumes you only want private messages to be relayed. If you
also want channel messages, change the ? in the line to a *

Also, you may want to have the same basic line two more times,
changing TEXT to ACTION, and then NOTICE, so that all three kinds of
messages will be relayed.
--
Joel Crump
f00ge
2004-08-27 23:11:34 UTC
Permalink
Sweet!
Works perfectly. Thanks.

But now I got greedy..... is there a way I can have it do the same, when the
2nd machine is highlighted/slapped in a channel?
Basically, alerting me every time someone is talking about me. :)
I bet it can be done with on $me, but I'd also like it on specific
nicks/text.

Thanks again.
Joel
2004-08-28 00:22:38 UTC
Permalink
Post by f00ge
But now I got greedy..... is there a way I can have it do the same, when the
2nd machine is highlighted/slapped in a channel?
Basically, alerting me every time someone is talking about me. :)
I bet it can be done with on $me, but I'd also like it on specific
nicks/text.
To look for your own nick being used in a channel:

on *:TEXT:*:#:if ($me isin $1-) notice <nick on other machine> On
$chan $+ $chr(44) $nick said: $1-

on *:ACTION:*:#:if ($me isin $1-) notice <nick on other machine> On
$chan $+ $chr(44) $nick did: $1-

To look for specific text, just use:

on *:TEXT:<text to search for>:#:notice <nick on other machine> On
$chan $+ $chr(44) $nick said: $1-

on *:ACTION:<text to search for>:#:notice <nick on other machine> On
$chan $+ $chr(44) $nick did: $1-

$chr(44) generates a comma.
--
Joel Crump
f00ge
2004-08-28 09:19:15 UTC
Permalink
Nice one, thanks.

One last question (yes, I know, I'm pushing it here):
Is the a way it will identify my 2nd machine on mask or multible nicks.
Would be cool, if I could change nicks and still be able to recieve the
notice from the other machine.

I tried making a second script for a second nick likte:

on *:TEXT:*:?:notice Newb Message on second machine from $nick $+ : $1-
on *:TEXT:*:?:notice Newb|away Message on second machine from $nick $+ : $1-

But that didn't work. I guess mIRC cannot cope with the same script twice -
even though the nick part is altered.
Joel
2004-08-28 18:04:29 UTC
Permalink
Post by f00ge
Is the a way it will identify my 2nd machine on mask or multible nicks.
Would be cool, if I could change nicks and still be able to recieve the
notice from the other machine.
I assume both nicks are always in at least one channel together. I'd
make use of that (you could also use the notify system on networks
that show the address of people on notify, but then you couldn't
account for new nicks you might use from time to time).

In your Users section, have one or two lines like (the second would be
for if the hostname doesn't resolve from an IP):

myothernick:*!*<***@hostmask of other machine>

And have the scripts:

on *:JOIN:<that channel>: {
if ($nick == $me) {
var %totalnicks = $nick($chan,0)
var %count = 1
while (%count <= %totalnicks) {
var %currentnick = $nick($chan,%count)
if (%currentnick != $me) {
if [(]($address(%currentnick,5) iswm *!*<***@hostmask of
other machine>) [|| ($address(%currentnick,5) iswm *!*<***@IP> of
other machine))] {
; the text inside the [] brackets is only if you're checking
more than one mask (including the extra first parenthesis)
set %myothernick %currentnick
break
}
}
inc %count 1
}
}
}

on myothernick:JOIN:<that channel>:set %myothernick $nick
Post by f00ge
on *:TEXT:*:?:notice Newb Message on second machine from $nick $+ : $1-
on *:TEXT:*:?:notice Newb|away Message on second machine from $nick $+ : $1-
But that didn't work. I guess mIRC cannot cope with the same script twice -
even though the nick part is altered.
After having those above scripts, you can just use "notice
%myothernick [...]" in a single on TEXT script. You actually could
just name all the different possible nicks, if you wanted to (but it's
less flexible, of course), by using if statements in a single script.
--
Joel Crump
f00ge
2004-08-30 08:32:22 UTC
Permalink
I'll have a go at that one.

Thanks again, Joel.

Loading...