Skip to content

Examples

Short, self-contained snippets that show common MA3 plugin patterns. Each one is a complete Main() you can paste into src/plugin.ts to try out.

Conventions used in the examples

  • Type guards from grandma3-toolkit (is.Sequence, is.Cue, is.Preset, …) narrow the unknown return type of GetObject() to a concrete class so the rest of the function is properly typed.
  • MA3 query syntax in strings (e.g. 'Sequence "MySeq" Cue 2', 'Preset 5.3') — the same syntax you'd type at the command line. Quote names with spaces.
  • Cmd(string) for one-off operations that don't have a typed method, falling back to the canonical command line.

Add your own examples by dropping a new Markdown file in docs/examples/.

Released under the MIT License.