Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

If requesting help, make sure to mention what game you are attempting to use ACT with.
For the best FFXIV support, join Ravahn's Discord Server. Also check out OverlayPlugin's FFXIV FAQ and Setup Guide.

Regex in ACT w/ FFXIV Plugin

I'm completely new to writing custom triggers for ACT and was wondering if anyone who has more knowledge could give me a quick hand. I opened the log file generated by ACT in vscode and used the "find using regex" feature to generate regex for triggers, but have run into 3 problems:

1) First the simplest, because the problem could just be that I'm dumb. In the triggers I copied that made me look into making my own, the following regex
14:3FEB:Leviathan starts using Temporary Current

is finding a match even though the word "using" can't be found in the entire document. Am I just looking at the wrong file? Are the log files in Advanced Combat Tracker\FFXIVLogs not the ones we're searching in with the regex?


2) "|" is not matched by escaping | (as in "\|"), ":" is what matches "|". However when I want to match 2 "|" in a row, "::" does not work. If ":" does indeed match "|", how do we match 2 in a row? Here's an example:

Text being searched:   3FE0|Rip Current|400048FD|Leviathan||

This is not being matched by ACT with the following regex:   3FE0:Rip .*Leviathan::
But in VSCode, it is matched by:   3FE0\|Rip .*Leviathan\|\|

All I did was replace "\|" with ":", because I've seen every working custom trigger I've copied do that.


3) How exactly does "." behave in ACT?
Text being searched:   179A|Horrid Roar|E0000000|||b
Is not being matched by this regex:    179A:Horrid Roar(.){12}[a-z0-9]
even though in VSCode it matches as long as I replace ":" with "\|"
Tagged:

Comments

  • edited August 2019

    1) First the simplest, because the problem could just be that I'm dumb. In the triggers I copied that made me look into making my own, the following regex
    14:3FEB:Leviathan starts using Temporary Current

    is finding a match even though the word "using" can't be found in the entire document. Am I just looking at the wrong file? Are the log files in Advanced Combat Tracker\FFXIVLogs not the ones we're searching in with the regex?

    Sounds like the correct place to me.  But maybe the plugin does some text transformation when reading network logs before it gets to ACT.
    2) "|" is not matched by escaping | (as in "\|"), ":" is what matches "|". However when I want to match 2 "|" in a row, "::" does not work. If ":" does indeed match "|", how do we match 2 in a row? Here's an example:

    Text being searched:   3FE0|Rip Current|400048FD|Leviathan||

    This is not being matched by ACT with the following regex:   3FE0:Rip .*Leviathan::
    But in VSCode, it is matched by:   3FE0\|Rip .*Leviathan\|\|

    All I did was replace "\|" with ":", because I've seen every working custom trigger I've copied do that.
    I don't know where you got the idea that : will match | or the reverse.  : is just a colon.  | is an or operator for regex.  \| is correctly escaped and will match a literal |.

    I would recommend right-clicking an encounter in ACT and using the View Logs window.  You can search as regex there and be confident that the regex flavor is the same.
    3) How exactly does "." behave in ACT?
    Text being searched:   179A|Horrid Roar|E0000000|||b
    Is not being matched by this regex:    179A:Horrid Roar(.){12}[a-z0-9]
    even though in VSCode it matches as long as I replace ":" with "\|"
    A period is one of any character.
    It won't match because a colon is not a pipe character.

    I feel like the plugin is transforming the raw logs and this is making the confusion?
  • I analyzed what the FFXIV plugin does a bit and it seems there is a "raw" format of the log line and a "transformed" format of the log line that more resembles the FFXIV client chat log.

    The FFXIV plugin modifies the network log file as it passes through the different stages in ACT.  The Custom Trigger engine gets the log line during the second stage.  So the original lines do not resemble the lines that get to ACT.  Only plugins that subscribe to the BeforeLogLine event would see what the network log files are.  OnLogLine event handlers and the Custom Trigger engine would see how the log lines are in the View Logs window.

  • edited August 2019

    Yeah if that's the correct file then the plugin definitely does some transformation, because in every single trigger I've copied (ones that actually work correctly) ":" is matching "|", and when I try to match "|" using "\|" it never works. I know this isn't traditional regex standards, that's why I've been so confused. If I could just match like I do in VSCode none of this would be an issue. But yeah, like I said, the triggers I've copied have words in the regex that don't even exist in the entire log file, so something is definitely going on, and I don't know how to figure it out. I've tried to look for guides specifically for FFXIV triggers but nothing really shows up aside from simple stuff using trivial regex.


    In the last example I put, the actual regex I came up with to match

    179A|Horrid Roar|E0000000|||b

    was

    179A\|Horrid Roar(.){12}[a-z0-9]

    which works in VSCode. I know there's a lot of redundant detail and it could be simplified but I wanted to keep it readable to know at a glance what it's doing in case I need to debug.

    Just to give an idea of what type of fuckery is going on, this:    179A:Horrid Roar(.){12}[a-z0-9]

    Matches this:        179A|Horrid Roar|E0000000|Abc

    But not this:  179A|Horrid Roar|E0000000|||b


    I'll take a look at the actual log file by right clicking the encounter as you suggested when I get a chance and I'll update.






  • I really think you should abandon the idea of using VSCode on the raw network logs.  The transformation makes them not the same.

    Either use the regex search in ACT's View Logs window, or copy the logs out of that window to put in VSCode.

  • Holy crap thank you SO MUCH for your help, didn't think it'd be that simple. I didn't even know you could view the log directly from the encounter by right clicking on it, all I've ever done with ACT is follow instructions and copy/paste triggers. I just checked it out and yeah the format is entirely different, and ":" are all over the place, whereas in the log files I was looking at there wasn't a single ":". It was just me being dumb. Again thank you so much you just saved me a massive amount of time.

Sign In or Register to comment.