Table of Contents

Method SetListenPattern

Namespace
Anvil.API
Assembly
NWN.Anvil.dll

SetListenPattern(string, int)

Sets a listen pattern for this object, assigning a pattern number that is accessible from the related object's OnConversation event.

public void SetListenPattern(string pattern, int patternNumber)

Parameters

pattern string

The pattern to match the message against. This is not regex, but a custom pattern format. See the remarks for more info.

patternNumber int

The pattern number to assign, on a successful match.

Remarks

Pattern Format:
** will match zero or more characters
*w one or more whitespace
*n one or more numeric
*p one or more punctuation
*a one or more alphabetic
| is or
( and ) can be used for block.
Setting a creature to listen for "" will match any string
Telling him to listen for "funk" will match any string that contains the word "funk".
"
(bash|open|unlock)(chest|door)" will match strings like "open the door please" or "he just bashed that chest!"