mIRC Home    About    Download    Register    News    Help

Print Thread
#167553 26/12/06 12:01 PM
Joined: Aug 2005
Posts: 128
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
When you send an action(/me) through DCC CHAT, an ON CHAT event is triggered to the person who recieves the action. In order to send an action through DCC CHAT, you actually have to send "\x01ACTION message\x01". But in the ON CHAT event, $1- contains the string after the \x01 was removed.
I understand why this was done, because you can't use CTCP in DCC CHAT so there's no need for \x01.
I want to check when I recieved an action on a dcc chat window, but i can't make the difference between when the user says "action movies are the one i like" (which is a message) and "\x01action movies are the one i like\x01" (which is an action). ON ACTION is not triggered for DCC CHAT windows, so using ON CHAT is the only solution, but I can't know when the ctcp is actually used. I believe \x01 should NOT be removed from the $1-, because people might also want to make custom ctcps for DCC CHAT or special actions or whatever.

Joined: Jul 2003
Posts: 655
Fjord artisan
Offline
Fjord artisan
Joined: Jul 2003
Posts: 655
Code:
on ^1:CHAT:*: {
  if ($1 === ACTION) { echo -s An action occured }
  else { echo -s An action did not occur }
}

Using the ^ event prefix allows you to compare the unaltered message.


"Allen is having a small problem and needs help adjusting his attitude" - Flutterby
Joined: Aug 2005
Posts: 128
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Aug 2005
Posts: 128
Ah, I didn't think at that.
Thank you, and sorry for my stupid post.


Link Copied to Clipboard