Project

General

Profile

Actions

Matchtext

A <matchtext> is a text pattern that AdiIRC will use to compare with something during a scripting event.

Wild characters

The matchtext can contain wild characters:

* - matches any text
? - matches any single letter
& - matches any single word

See also $matchkey, $stripped.

Example

; The matchtext will only match if the ONLY word is "!test" 
on *:TEXT:!test:*:echo -ag Match

; The matchtext will match if the text starts with "!test" 
on *:TEXT:!test*:*:echo -ag Match

; The matchtext will match if the text ends with the word "!test" 
on *:TEXT:*!test:*:echo -ag Match

; The matchtext will match any text that has "!test" in it (anywhere)
on *:TEXT:*!test*:*:echo -ag Match

; The matchtext will match any text that start with the word test !test and his only followed by a second word
on *:TEXT:!test &:*:echo -ag Match

Regex text pattern

The matchtext parameter can also be a Regular Expression Pattern by using the '$' event prefix.

Example

on $*:text:/^!test$/i:#:{
  msg $chan Test Worked!
}

Matchtext evaluation

Matchtext can be evaluated using $(code) or contain a single %variable.

Example

; Subscribe to the TEXT event, try evaluate my nick, and if it matches, print a text.
on *:TEXT:$(* $+ $me $+ *)):*:echo -ag My nick was highlighted on $chan

; Set a variable
set %variable !test

; Subscribe to the TEXT event, if the messages matches the variable, print a text.
on *:TEXT:%variable:*:echo -ag Text !test was matched

Updated by Per Amundsen about 5 years ago · 11 revisions

Also available in: PDF HTML TXT