Difference between revisions of "On notice"

From Scriptwiki
Jump to: navigation, search
 
(changed iswm link)
Line 2: Line 2:
 
  on <level>:NOTICE:<matchtext>:<*><?><#[,#]>:<commands>
 
  on <level>:NOTICE:<matchtext>:<*><?><#[,#]>:<commands>
  
The matchtext can be a [[iswm|wildcard]] match or even a [[Regular_Expression|regular expression]].  
+
The matchtext can be a [[If-Then-Else#The_Operators|wildcard]] match or even a [[Regular_Expression|regular expression]].  
 
To use regular expressions as matchtext, you need the [[Access_Levels|$-Prefix]].
 
To use regular expressions as matchtext, you need the [[Access_Levels|$-Prefix]].
  

Revision as of 14:10, 30 November 2005

The on NOTICE event triggers when you receive a notice.

on <level>:NOTICE:<matchtext>:<*><?><#[,#]>:<commands>

The matchtext can be a wildcard match or even a regular expression. To use regular expressions as matchtext, you need the $-Prefix.

Read access levels to get more info about the <level> field.

You can also use variables as matchtext and location parameter

Note that you can't test out these events by typing text to yourself. To test them, use another connection, that you can establish via /server.

Example

on ^*:NOTICE:*:*: {
 if ($nick == Q) { 
  haltdef
  echo -ts Q: $1- 
 } 
}

This event will react on every notice and if the notice is from Q, it will echo it to Status Window only and stop the default output. Note that the "^" infront of the level effects that it is triggered before the default output is displayed.

See Also

Take a look at the On text event to react on "normal" texts, both in channel and query.

The On action event is triggered whenever you receive an action.

With /notice you can send notices.