After several weeks of getting ToT flags to work in my scenario and failing I came to the conclusion that there is a logic bug in the events parser.
When using a CHECKFLAG statement with the COUNT parameter the trigger returns a true condition when the count is equal to or greater than the COUNT. It is only supposed to return a true when the number of FLAGS in the MASK is equal to the COUNT.
For example, if you have two statements where one is a CHECKFLAG, COUNT=1 and other is a CHECKFLAG, COUNT=2. If only one FLAG is ON then only the COUNT=1 trigger returns a true. However, if both FLAGS are ON then both statements return a true, not just the COUNT=2 statement. Which is, of course, the bug
This hold true no matter how many flags you are testing. If ten FLAGS in the MASK are ON and you are checking for a COUNT of any number less then ten it will still return a true result.
When using a CHECKFLAG statement with the COUNT parameter the trigger returns a true condition when the count is equal to or greater than the COUNT. It is only supposed to return a true when the number of FLAGS in the MASK is equal to the COUNT.
For example, if you have two statements where one is a CHECKFLAG, COUNT=1 and other is a CHECKFLAG, COUNT=2. If only one FLAG is ON then only the COUNT=1 trigger returns a true. However, if both FLAGS are ON then both statements return a true, not just the COUNT=2 statement. Which is, of course, the bug
This hold true no matter how many flags you are testing. If ten FLAGS in the MASK are ON and you are checking for a COUNT of any number less then ten it will still return a true result.
Comment