run

Queue a task when the condition is met. This task will run (and self-reset if finished) for as long as the condition is met.

Note this means that the task provided will run from start-to-finish when the condition is true, which means it won't execute exclusively while the condition is met, rather have the capability to be started when the condition is met. This means continuous iterations of a true condition will try to keep this task queued at all times, resetting the task internally when it is completed. Keep this in mind if working with looping/long tasks, as you might experience runaway tasks. See finishingIf for fine-grain "run exclusively if" control.

This method can only be called once per ConditionalTask. If you do not mention timing control, this task will be run immediately when the condition is met, ending when the task ends.

Return

Current builder for additional task parameters

Parameters

task

The task to run.


Implicitly make a new RunTask to run once the condition is met. This callback will run repeatedly while the condition is met.

This method can only be called once per ConditionalTask. If you do not mention timing control, this task will be run immediately when the condition is met, ending immediately as it is an RunTask.

Return

Current builder for additional task parameters

Parameters

runnable

The code to run