paissaheavyindustries / Triggernometry

Triggernometry is a plugin for Advanced Combat Tracker, intended to extend its built-in trigger system with a variety of different actions and configuration options.
MIT License
253 stars 48 forks source link

Execution delay ignored for actions inside a loop #69

Closed ghost closed 3 days ago

ghost commented 2 years ago

How to reproduce:

  1. Add 3 actions inside a loop and make them execute in async mode
  2. Set execution delay to 1000ms for second and third action
  3. Set loop iteration delay to 3000ms

What happens:

The three actions are executed one after the other in quick succession with 3s delay in between loops.

Expected result:

The first action is run immediately, the second action is run 1000ms after execution of first one, the third action is run 1000ms after execution of the second one and the loop starts again 1000ms after end of third action.

Trigger sample showcasing the issue:

<?xml version="1.0"?>
<TriggernometryExport Version="1">
  <ExportedFolder Id="3f4528f6-88e5-46cb-a041-a3b3a4ef5f9b" Name="loop" Enabled="true">
    <Folders />
    <Triggers>
      <Trigger Enabled="true" Sequential="True" Name="Start" Id="1c4d5355-7612-4f9d-ad68-027c0e039dc7" RegularExpression="">
        <Actions>
          <Action OrderNumber="1" OBSEndPoint="" VariableOp="SetString" VariableName="looptest" VariableExpression="true" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="Variable">
            <Condition Enabled="false" Grouping="Or" />
          </Action>
          <Action OrderNumber="2" LoopDelayExpression="3000" OBSEndPoint="" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="Loop">
            <LoopCondition Enabled="true" Grouping="Or">
              <ConditionSingle Enabled="true" ExpressionL="${evar:looptest}" ExpressionTypeL="Numeric" ExpressionR="1" ExpressionTypeR="Numeric" ConditionType="NumericEqual" />
            </LoopCondition>
            <LoopActions>
              <Action OrderNumber="1" OBSEndPoint="" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="SystemBeep" Asynchronous="False">
                <Condition Enabled="false" Grouping="Or" />
              </Action>
              <Action OrderNumber="2" OBSEndPoint="" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="SystemBeep" ExecutionDelayExpression="1000" Asynchronous="False">
                <Condition Enabled="false" Grouping="Or" />
              </Action>
              <Action OrderNumber="3" OBSEndPoint="" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="SystemBeep" ExecutionDelayExpression="1000" Asynchronous="False">
                <Condition Enabled="false" Grouping="Or" />
              </Action>
            </LoopActions>
            <Condition Enabled="false" Grouping="Or" />
          </Action>
        </Actions>
        <Condition Enabled="false" Grouping="Or" />
        <Conditions />
      </Trigger>
      <Trigger Enabled="true" Name="Stop" Id="a8558c4a-d826-4fd6-891f-d1d7f93490e5" RegularExpression="">
        <Actions>
          <Action OrderNumber="1" OBSEndPoint="" VariableName="looptest" TextAuraFontSize="8.25" TextAuraFontName="Microsoft Sans Serif" ActionType="Variable">
            <Condition Enabled="false" Grouping="Or" />
          </Action>
        </Actions>
        <Condition Enabled="false" Grouping="Or" />
        <Conditions />
      </Trigger>
    </Triggers>
  </ExportedFolder>
</TriggernometryExport>
KingPendragoon commented 2 years ago

Loops also ignore checkmark for on or off and always fire

paissaheavyindustries commented 3 days ago

should be fixed