Windower / Issues

Windower Public Issue Tracker
31 stars 21 forks source link

Chatmon: does not strip all formatting prior to match #1094

Open Xabis opened 1 year ago

Xabis commented 1 year ago

It seems that Chatmon does not strip color codes prior to making a match.

When using Battlemod, it will rewrite chat lines to include a lot of color coding around targets and ability names,

Example: <trigger match="*Phlegm Expulsion*" sound="..." />

Raw text, after Battlemod (simplified mode, default template): [Thillloab]  Phlegm  Expulsion ¨ Thillloab

For this example, the trigger will not fire, because it is matching on the raw input which includes the control bytes.

A workaround would be to place wildcards between each word, which is not ideal, and can lead to false positives: <trigger match="*Phlegm*Expulsion*" sound="..." />

This needs to be resolved by stripping all special codes from the input prior to making a match.

Related: https://github.com/Windower/Lua/issues/2244

Xabis commented 1 year ago

I wrote a lua version of chatmon to address this issue. This new version (should be) backwards compatible with the plugin xml configuration for anyone interested. This has been decently tested and works with Battlemod.

Additionally, I have expanded the functionality to include basic spam filtering, and added commands to configure things without needing to change the xml itself.

Repo: https://github.com/Xabis/Chatmon

@Byrth, pending review of course, this may be something to consider for the official addon collection, at your discretion.

z16 commented 1 year ago

@Xabis This is solely at your discretion, and yours alone :) If you wanna submit the addon to the repo just submit a PR and we will review it. We generally approve of people submitting addons to our repository, so feel free to do it.

Xabis commented 1 year ago

@z16, thanks for letting me know.

I have opened a PR here: https://github.com/Windower/Lua/pull/2254