mIRC Home    About    Download    Register    News    Help

Print Thread
#98077 20/09/04 07:18 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
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

#98078 20/09/04 07:39 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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


Gone.
#98079 20/09/04 09:05 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
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



#98080 20/09/04 09:43 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 20/09/04 09:52 PM.

Gone.
#98081 20/09/04 10:20 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
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.

#98082 20/09/04 10:21 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 20/09/04 10:23 PM.

Gone.
#98083 20/09/04 10:22 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
in the active window smile

#98084 20/09/04 10:33 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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

Last edited by FiberOPtics; 20/09/04 10:43 PM.

Gone.
#98085 20/09/04 11:08 PM
Joined: Oct 2003
Posts: 68
Y
yamaz Offline OP
Babel fish
OP Offline
Babel fish
Y
Joined: Oct 2003
Posts: 68
outstanding! thank you very much

#98086 20/09/04 11:13 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
You're welcome,

Greets


Gone.

Link Copied to Clipboard