mIRC Home    About    Download    Register    News    Help

Print Thread
G
gaui
gaui
G
Hello, I'm trying to trigger some actions whenever someone posts something. It should trigger everyone - including me.

Code:
on *:TEXT:*:#:{
  echo -a $nick posted text: $1-
}


This doesn't trigger when I post text. Can you help me?

Last edited by gaui; 29/11/12 01:58 AM.
Joined: Feb 2011
Posts: 472
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 472
You need a on input.

Code:
on *:input:#:{ 
  ; Don't trigger when sending commands. "/msg ... " and don't trigger on CTRL+ENTER
  if ($left($1,1) != /) && (!$ctrlenter) {
    msg $active $1- 
    echo -a I posted text: $1-
    halt
  }
}

G
gaui
gaui
G
Thank you, but do I need to use ON INPUT and ON TEXT, so it triggers for everyone (including me)?

Joined: Feb 2011
Posts: 472
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 472
on text will trigger by other people in the channel.
on input will trigger when you enter text in the channel.

/help on text
/help on input

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Yes, you need both. Depending on what you're doing and how much needs to be done, you could run an alias from both events so that the code is only in one place instead of two places, but if it's only a little that is done, it's easier just writing the same thing in both events. Just remember that the events are not handled exactly the same.

G
gaui
gaui
G
Originally Posted By: Riamus2
Yes, you need both. Depending on what you're doing and how much needs to be done, you could run an alias from both events so that the code is only in one place instead of two places, but if it's only a little that is done, it's easier just writing the same thing in both events. Just remember that the events are not handled exactly the same.

Thank you very much. I decided to make an alias which I call from both ON TEXT and ON INPUT. smile


Link Copied to Clipboard