mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 61
G
gaui Offline OP
Babel fish
OP Offline
Babel fish
G
Joined: Apr 2003
Posts: 61
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.

__________________________
Curiosity killed the cat.
Joined: Feb 2011
Posts: 450
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 450
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
  }
}

Joined: Apr 2003
Posts: 61
G
gaui Offline OP
Babel fish
OP Offline
Babel fish
G
Joined: Apr 2003
Posts: 61
Thank you, but do I need to use ON INPUT and ON TEXT, so it triggers for everyone (including me)?


__________________________
Curiosity killed the cat.
Joined: Feb 2011
Posts: 450
K
Pan-dimensional mouse
Offline
Pan-dimensional mouse
K
Joined: Feb 2011
Posts: 450
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,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Joined: Apr 2003
Posts: 61
G
gaui Offline OP
Babel fish
OP Offline
Babel fish
G
Joined: Apr 2003
Posts: 61
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


__________________________
Curiosity killed the cat.

Link Copied to Clipboard