mIRC Home    About    Download    Register    News    Help

Print Thread
Reply in the same way #213922 11/07/09 11:12 PM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Hi there,
Is there a simple way of replying to someone with the same method they contacted you. For example, if they contacted you via PM, have the script trigger in PM. And if they contacted you in the channel, again have the script trigger in the channel.

I know you could have two scripts for each way eg

Code:
on 1:TEXT:!test:?:{
  msg $nick etc
}
on 1:TEXT:!test:#:{
  msg $chan etc
}


But I wanted to see if there was another way perhaps, so that this script would reply in the way they used...

Code:
on 1:TEXT:!test:*:{
  msg $nick/$chan etc
}


Thanks


Ninko

Re: Reply in the same way [Re: Ninko] #213928 12/07/09 12:17 AM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Code:
on *:text:*:*:{
if (!$chan) msg $nick etc.
else msg # etc.
}


It's been a long time since I've had to mess with normal IRC queries, but I think this would work.

Re: Reply in the same way [Re: DJ_Sol] #213931 12/07/09 02:09 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Alternatively
Code:
on *:text:*:*:{
.msg $target <message>
}


Re: Reply in the same way [Re: RusselB] #213983 13/07/09 01:55 AM
Joined: Jun 2004
Posts: 139
N
Ninko Offline OP
Vogon poet
OP Offline
Vogon poet
N
Joined: Jun 2004
Posts: 139
Ok, thanks for both your help.

Take care


Ninko

Re: Reply in the same way [Re: RusselB] #214024 14/07/09 05:23 AM
Joined: Jan 2003
Posts: 1,063
D
Doqnach Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2003
Posts: 1,063
isn't $target == $me in the case of a PM?


If it ain't broken, don't fix it!
Re: Reply in the same way [Re: Doqnach] #214025 14/07/09 05:43 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Not unless you are pming yourself.
$target is the sender's nick, although you could use $nick for pm's and $chan for channels, as was suggested previously.


Re: Reply in the same way [Re: RusselB] #214322 28/07/09 08:58 PM
Joined: Aug 2007
Posts: 12
E
eXonyte Offline
Pikka bird
Offline
Pikka bird
E
Joined: Aug 2007
Posts: 12
Actually, $target is the target of the event. In an on TEXT for a channel message, it is $chan. In an on TEXT for a private message, it will be $me because you are the target of the event.

If you want a single identifier that gives you either, use:
Code:
$iif($chan,$chan,$nick)