mIRC Homepage
Posted By: yamaz /echo option - 20/09/04 07:18 PM
how can I do for this:;

ii'd want that when someone does a certain action (ex. a /me ) mirc displays a message with /echo, but displays it in the "originary" window. Example: if Joe does a /me in #channel , i want an echo that tells me "Hey, Joe is doing a /me !! " in the same channel where Joe does it. If he does it in query, I want that message in query.

(I know that ir's useless, but it's only an example)

There's -a for active window, -s for status window etc.

How can I do to display the message in the "origin" window?

Thanks
Posted By: FiberOPtics Re: /echo option - 20/09/04 07:39 PM
Here's an example:

on *:ACTION:*:*: echo $iif($target ischan,$v1,$nick) Action: * $nick $1-

$target will return the target of an event.

If the user does an action on a channel that you are on, the $target will be that channel, so we then do /echo $target

If the user does an action in a query window, then the $target will be your own nick. Then you know that you should do /echo $nick

This is summarised in $iif($target ischan,$v1,$nick)

Greets
Posted By: yamaz Re: /echo option - 20/09/04 09:05 PM
ok here's the specific example: I overrided the "accept sound request" options by scripting

I want that if a user does a ctcp sound request to me, the message is displayed in the origin window

take for example the case where sounds request are OFF, and the script has to display this message:

« [11:01] Joe is doing a SOUND but sound requests are OFF. Type /son to switch sound requests ON »

if I put my string this way (watch the bold text):

ctcp *:SOUND:*:{
if %requestsuoni == 1 {
if $chan != $null {
.echo -a $timestamp $nick $+ 11@ $+ $chan $+ : «11 $deltok($2,-1,46) »
.splay $2
halt }
else {
.echo -a $timestamp $nick $+ : «11 $deltok($2,-1,46) »
.splay $2
halt }
}
else echo $iif($target ischan,$v1,$nick) $timestamp $nick is e is doing a SOUND but sound requests are OFF. Type /son to switch sound requests ON
}

it always says the message on the status window if mirc has the focus. If mirc hasn't the focus, it says the message on the most recent active window. Like this it doesn't work frown


Posted By: FiberOPtics Re: /echo option - 20/09/04 09:43 PM
Quote:
I want that if a user does a ctcp sound request to me, the message is displayed in the origin window

There's no such thing as an "origin window" in the case of a /ctcp, unless if it's a ctcp to a channel.

So there are 2 cases. If someone does:

1) /ctcp #channel blabla --> the origin window is the #channel

2) /ctcp yournick blabla -> there is no origin window

The ctcp message goes wherever you told mirc to put it (alt+o -> IRC -> Show in Active), that being the status window, or the active window.

That's because you can do a ctcp to someone from wherever, being your status window, a channel, in pm, a custom window with editbox, etc. It doesn't come from "a window" but directly from the user, wherever he might be at the time.

Another example to illustrate: if you receive a ctcp from a person, there is no way for you to know where it came from (unless if it's a channel ctcp), so you can't know where to put it either.

Unless of course you are referring to something else with "origin" window...

Greets
Posted By: yamaz Re: /echo option - 20/09/04 10:20 PM
my gibberish "origin window" is meant like this:

Joe does a ctcp to me --> i see the message on joe's query window

Joe does a ctcp to #channel --> i see the message on #channel

just like if all this wasn't scripted but handled normally by mirc, but with that script up above.
Posted By: FiberOPtics Re: /echo option - 20/09/04 10:21 PM
One last thing:

where do you want to see the ctcp if Joe does a ctcp to you but there's no query window?

Btw if mirc would be handling it, it would either go to the active window that you are on, or to the status window.

Greets
Posted By: yamaz Re: /echo option - 20/09/04 10:22 PM
in the active window smile
Posted By: FiberOPtics Re: /echo option - 20/09/04 10:33 PM
Code:
 
ctcp *:SOUND:*:{
  if %requestsuoni == 1 {
    var %data = «11 $deltok($$2,-1,46) »
    if # { echo # $timestamp $nick $+ 11@ $+ # $+ : %data }
    else { echo $iif($query($nick),$v1,-a) $timestamp $nick $+ : %data }
    splay $2  
  }
  else { echo $iif(#,#,$iif($query($nick),$v1,-a)) $timestamp $nick is doing a SOUND but sound requests are OFF. Type /son to switch sound requests ON }
}

Bye.

Edit: made some cosmetic changes
Posted By: yamaz Re: /echo option - 20/09/04 11:08 PM
outstanding! thank you very much
Posted By: FiberOPtics Re: /echo option - 20/09/04 11:13 PM
You're welcome,

Greets
© mIRC Discussion Forums