event-trigger icon indicating copy to clipboard operation
event-trigger copied to clipboard

Passing Regex Capturing Groups to TTS

Open natyusha opened this issue 3 years ago • 2 comments

Hi, I was recreating some triggers in Triggevent and noticed that several which attempted to pass regex capturing groups to the TTS were not working as expected. I know that this could likely be worked around with groovy (or maybe some different syntax?) but thought I would request this as a feature. My reasoning for this is that Triggevent allows for legacy ACT triggers to be imported into Easy Triggers but doesn't appear to support this functionality that legacy triggers do by default.

As an example of what I mean, a legacy ACT trigger with the following setup will say "Pull in 15" when a 15 seconds countdown (/cd 15) is started ingame:

Regex: Battle commencing in (?<time>\d+) seconds! TTS: Pull in ${time}

Apologies in advance if this is already possible and thanks for the great plugin.

natyusha avatar Sep 13 '22 18:09 natyusha

Putting my implementation notes here for when I get around to this, feel free to ignore:

The easiest way to implement this would probably be for Condition.test to take another argument (or make a second interface) that also includes some context about the event, including some place where it can save its own variables and such to.

xpdota avatar Sep 14 '22 05:09 xpdota

Okay, I rewrote the easy triggers, lots of new features, it's available to test on the easy-trigger-enhancements-2 branch (make a backup of all your triggers first, since you won't be able to go back after the upgrade). You can switch branches on the updates tab (be sure to switch back to stable after it's released). I'll release it when it looks like there's no new bugs.

xpdota avatar Sep 15 '22 01:09 xpdota

This has been released to stable

xpdota avatar Oct 02 '22 17:10 xpdota