<header>Chatfilter<end>

With the advent of the 18.1 patch, a feature was introduced to allow users to completely filter out certain messages from being displayed in chat windows.

The main reason this feature was introduced was to allow users to eliminate credit seller spam from their chat windows. Using the /ignore <username> was insufficient because credit selling spammers would create new accounts constantly to thwart the use of /ignore.

Let's take a look at the basics if the <highlight>/filter<end> command.

<header2>Basics<end>

Here are the basic commands to enable, disable and clear your chat filters:

<highlight>/filter enable<end> - enables the filter [<a href='chatcmd:///filter enable'>do it</a>]
<highlight>/filter disable<end> - disables the filter without deleting any of the added filters [<a href='chatcmd:///filter disable'>do it</a>]
<highlight>/filter clear<end>    - clears all filters [<a href='chatcmd:///filter clear'>do it</a>]


<header2>Adding and removing filtered words<end>

Now, in order to do something useful with these filters, you need to add some words that trigger the filter. Here are the commands that add filters:

<highlight>/filter add 'word'<end>   - adds a word to the filter 
<highlight>/filter list<end>             - lists all the active filters [<a href='chatcmd:///filter list'>do it</a>]
<highlight>/filter del 'number'<end> - deletes the specified filter (where 'number' is the line number from 'list')


Note that filters are added to your game client preferences. That means if you add a filter on one character, that filter will be active for all characters on all accounts.

<header2>Example<end>

Simple example of filtering any line that includes the word 'bob':

<highlight>/filter add bob<end>
<highlight>/filter enable<end>


<header2>More advanced stuff<end>

The chat filter supports a subset of regular expressions. AO is old, and so is our regex parser, so not everything will work as you'd expect in a more modern implementation. Escape sequences inside character sets might not work as expected, for example. The most common constructs should work though.

<header2>Example<end>

Example that filters various variants of 'plox', 'plx', and 'plz':

<highlight>/filter add [pP][lL1][oO0][xX]<end>
<highlight>/filter add [pP][lL][xX]<end>
<highlight>/filter add [pP][lL][zZ]<end>
<highlight>/filter enable<end>

For the guide about credit spammers go <a href='chatcmd:///tell <myname> guides spamfilter'>here</a>.


<header2>Other uses<end>

That takes care of the main use, but the chat filters not only filter out messages from other players, it can even filter out messages from the system. If you are a "button masher" type of player, perhaps you're sick of all the messages from the system telling you about things you can't do.

Here are examples of other filters you could add to prevent those messages about how much longer you have to wait until you can use a particular special attack.

<highlight>/filter add Wait for your previous special action<end> [<a href='chatcmd:///filter add Wait for your previous special action'>do it</a>]
<highlight>/filter add Unable to perform action<end> [<a href='chatcmd:///filter add Unable to perform action'>do it</a>]
<highlight>/filter enable<end> [<a href='chatcmd:///filter enable'>do it</a>]


Source: <a href='chatcmd:///start https://www.ao-universe.com/index.php?id=14&mid=8&pid=616'>AO Universe</a>


<header2>More examples<end>

<highlight>^Your damage shield hit [a-zA-Z0-9 !-_,.()']+ for [0-9]+ points of damage.$<end> [<a href='chatcmd:///filter add ^Your damage shield hit [a-zA-Z0-9 !-_,.()&#39;]+ for [0-9]+ points of damage.$'>do it</a>]
<highlight>^You were healed for [12]?[0-9]?[0-9] points.$<end> [<a href='chatcmd:///filter add ^You were healed for [12]?[0-9]?[0-9] points.$'>do it</a>]
<highlight>^Executing Nano Program: [a-zA-Z0-9 '!()]+.$<end> [<a href='chatcmd:///filter add ^Executing Nano Program: [a-zA-Z0-9 &#39;!()]+.$'>do it</a>]
<highlight>^Nano program failed. Already executing nanoprogram.$<end> [<a href='chatcmd:///filter add ^Nano program failed. Already executing nanoprogram.$'>do it</a>]
<highlight>^Wait for current nano program execution to finish.$<end> [<a href='chatcmd:///filter add ^Wait for current nano program execution to finish.$'>do it</a>]
<highlight>^Wait for your previous special attack to complete.$<end> [<a href='chatcmd:///filter add ^Wait for your previous special attack to complete.$'>do it</a>]
<highlight>^You are already running this action!$<end> [<a href='chatcmd:///filter add ^You are already running this action!$'>do it</a>]
<highlight>^Unable to execute nano program. You can't execute this nano on the target.$<end> [<a href='chatcmd:///filter add ^Unable to execute nano program. You can&#39;t execute this nano on the target.$'>do it</a>]
<highlight>^Unable to perform action[a-zA-Z ,]+ locked, able in [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$<end> [<a href='chatcmd:///filter add ^Unable to perform action[a-zA-Z ,]+ locked, able in [0-9][0-9]:[0-9][0-9]:[0-9][0-9]$'>do it</a>]
<highlight>^[a-zA-Z ()]+ available.$<end> [<a href='chatcmd:///filter add ^[a-zA-Z ()]+ available.$'>do it</a>]
<highlight>^Target is already dead.$<end> [<a href='chatcmd:///filter add ^Target is already dead.$'>do it</a>]
<highlight>^Special attack is unavailable.$<end> [<a href='chatcmd:///filter add ^Special attack is unavailable.$'>do it</a>]
<highlight>^Your reflect shield hit [a-zA-Z0-9 !-_,.()']+ for [0-9]+ points of damage.$<end> [<a href='chatcmd:///filter add ^Your reflect shield hit [a-zA-Z0-9 !-_,.()&#39;]+ for [0-9]+ points of damage.$'>do it</a>]
<highlight>^You were damaged by a toxic substance for [1-9]?[0-9] points of damage.$<end> [<a href='chatcmd:///filter add ^You were damaged by a toxic substance for [1-9]?[0-9] points of damage.$'>do it</a>]

by longsdale