mIRC Home    About    Download    Register    News    Help

Print Thread
on input doesn't work for /msg #237704 26/05/12 01:10 AM
Joined: May 2012
Posts: 5
K
kkrotto Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: May 2012
Posts: 5
I have a script that sends text from one channel to another with /msg $chan

So I did a script today to manage that text entered there, but I discover the script can't handle any text with ON INPUT
When I type and press enter it reads perfectly, but when I send the text with /msg # command, nothing happens.

I wonder if there's any event trigger command to read messages send by myself besides ON INPUT

thanks in advance

Last edited by kkrotto; 26/05/12 01:53 AM.
Re: on input doesn't work for /msg [Re: kkrotto] #237705 26/05/12 06:11 AM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
on INPUT triggers for text you enter in a window editbox, regardless of whether or not that text results in a message being sent somewhere. on INPUT includes windows that aren't even valid targets for messages (such as the Status window).

To detect outgoing messages you have a few options:
1) Make a "msg" alias that does whatever it is you need. This can be proactive (you can change the message before it's sent), but will only catch messages sent with /msg, so you'll still need an on INPUT event if you want to catch directly-typed messages too.
2) Use /debug's -i switch to parse incoming/outgoing IRC protocol messages. This is purely reactive (you can't change/stop messages using this method).
3) Use Saturn's io.dll. This can be proactive, and, like /debug, will allow you to catch all outgoing messages on the protocol level. The disadvantage is that it needs updating with each new mIRC release.

Re: on input doesn't work for /msg [Re: Collective] #237713 26/05/12 08:54 PM
Joined: May 2012
Posts: 5
K
kkrotto Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: May 2012
Posts: 5
Thank you for your reply.
Could you give me a example of the 1) option ?
I didn't understand very well, how could I check if the /msg was sent with an alias.

1st script
Code:
... /msg #chan asd fghjkl qwerty


2nd script: on input part, that doesn't work
Code:
on input.. if(asd isin $1-) { ... _input %var} 

How would it be?

Re: on input doesn't work for /msg [Re: kkrotto] #237715 26/05/12 11:19 PM
Joined: Dec 2002
Posts: 3,138
C
Collective Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Code:
alias msg {
  if ( $1 == #somechan ) && ( asd isin $2- ) { dostuff }
  !msg $1-
}

Re: on input doesn't work for /msg [Re: Collective] #237716 27/05/12 03:10 AM
Joined: May 2012
Posts: 5
K
kkrotto Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
K
Joined: May 2012
Posts: 5
thank you