Jump to content

Commands From The Channel And Whisper :#: Or :?: Or


ST4

Recommended Posts

Hiya everyone,

Im putting together a list of commands that the roomies can use, but ive hit a snag, if i want to trigger off the room ive put,

on *:text:trigger:#: etc etc

 

and ive found for whisper is

on *:text:trigger:?: etc etc

 

is there a code for listening to both the chan and whisper, or am i going to have to put in 2 lines for each command, one for chan and one for whisper, lol i hope not?

 

Any reply is greatly appreciated,

ST4

Link to comment
Share on other sites

Guest X-Fusion

Well, if you wanna go on what the helpfile says ..

on TEXT

The on TEXT event triggers when you receive private and/or channel messages.


Format:    on <level>:TEXT:<matchtext>:<*><?><#[,#]>:<commands>
Example:    on 1:TEXT:*help*:#mirc,#irchelp:/msg $nick what's the problem?

The on ACTION and on NOTICE events use exactly the same format as on TEXT, and trigger on an action and on a notice event respectively.

The match text can be a wildcard string, where:

  *    matches any text
  &    matches any word
  text    matches if text contains only this word
  text*    matches if text starts with this word
  *text    matches if text ends with this word
  *text*    matches if text contains this word anywhere

The match text can also be a regular expression. See the $ prefix section in Access Levels.

The location where this event occurs can be specified using:

  ?    for any private message
  #    for any channel message
  #mirc    for any messages on channel #mirc
  *    for any private or channel messages

Examples

on 1:TEXT:hello*:#:/msg $chan Welcome to $chan $nick!

This listens on any channel for any line beginning with the word hello and welcomes the user who said it to the channel.

on 1:TEXT:*cookie*:#food:/describe $chan gives $nick a cookie :)

This listens on channel #food for any message containing the word cookie and gives the user who said it a cookie.

on 1:ACTION:moo:#:/msg $chan Aha, I see we have a cow among us.

This listens on any channel for an action that contains the word moo and responds accordingly.

on 1:NOTICE:*:?:/msg $nick I'm AFK, back in a moment!

This listens for any private notice and responds with the message that you're away from the keyboard.

For more flexibility, you can also use Variables in place of both the matchtext and the channel parameters.

on 1:TEXT:%matchtext:%channel:/msg $nick You just said $1- on channel %channel

The value of %matchtext will be matched against whatever text the user sends, and the value of %channel will be matched against the channel to which the message was sent.

Note: You can't test out these events by typing text to yourself. They can only be initiated by someone else saying something in a channel or in a private message.

But, your right, * indicates a wildcard.

Link to comment
Share on other sites

Guest X-Fusion

I know, just trying to explain how the helpfile breaks it down. It can be confusing, and it definately doesnt explain the full features/functions of mIRC.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...