Skip to main content

Action Reference

This page lists common Roadrunner Actions along with a description and demonstration of them. Please see the official Roadrunner docs page on actions for more information on implementing the actions in your program.

Built-in Actions

SequentialAction

Parameters
SequentialAction(Action actions)
SequentialAction(List<Action> initialActions)

Executes actions one after another (sequentially).

Action awesomeAction = new SequentialAction(
coolActionHere,
otherCoolAction
);

ParallelAction

Parameters
ParallelAction(Action actions)
ParallelAction(List<Action> initialActions)

Executes multiple actions at the same time. Action terminates when all actions finish.

Action awesomeAction = new ParallelAction(
actionOne,
actionExecutedAtSameTime
);

RaceAction

Parameters
RaceActionAction(Action actions)
RaceActionAction(List<Action> initialActions)

Executes multiple actions at the same time. Action terminates as soon as one action finishes.

Action awesomeAction = new RaceAction(
reallySlowAction,
reallyQuickAction // The RaceAction will finish whenever the first action returns.
);

SleepAction

Parameters
SleepAction(Action actions)
SleepAction(List<Action> initialActions)
CODE HERE

InstantAction

Parameters
InstantAction(InstantFunction f)

Action that instantly runs. This is useful for servo movements because we don't know when the servo gets to its target position (this could be used in a SequentialAction with a delay).

// Action immediately returns
Action awesomeAction = new InstantAction(
coolAction,
reallyCoolAction
);

NullAction

Does nothing. This action can be used when a function needs to return an action that doesn't do anything (maybe if the next action depended on whether a certain game object was detected).

Action boringAction = new NullAction()

Custom Actions

See https://rr.brott.dev/docs/v1-0/actions/#custom-actions.

TODO: MAKE THIS SECTION