Routines
Write a sequence once, call it from several triggers.
A routine is a named stack of blocks that other blocks call. It is the unit of reuse inside a flow: write "dump everything into the chest" once, then call it from the timer, from inventory-full, and from before-stop.
Writing one
Drop a routine hat, give it a name, and put the steps under it. The name uses lower-case letters, numbers and underscores.
A routine never fires on its own. Nothing in the game triggers it; it waits to be called.
Calling one
Use run routine with the same name. The routine's blocks run, and then the caller continues with whatever comes next.
Both triggers now share one definition. Fix the chest coordinates once and every caller follows.
Limits
- The routine has to run on the same client as the block calling it: in the same flow, or in another flow that is attached to that client and switched on. Try it only sees the canvas, so there it has to be in the same flow. If no routine with that name is found, the step is skipped with a warning in the console.
- A routine that calls itself is a stack, not a loop. Recursion is capped at runtime.
- The firing's total action budget still applies: calling a routine does not buy more steps, it just organises them.
When not to bother
For two or three blocks used in one place, a routine adds a hop for no gain. Reach for it when the same sequence appears under more than one trigger, or when a stack has grown long enough that naming its parts makes the flow readable.