Skip to content
Adam Oresten edited this page Sep 20, 2021 · 63 revisions

If you are new to the Sequencer, please read this guide:

Tutorials

Firebolt missing and then hitting

Helper classes:

Sequencer Core Methods

Core Methods

New Sequence

You can start a new Sequence by simply calling:

new Sequence()

Any other methods you call on this will continue to work on the same sequence, like so:

new Sequence()
     .thenDo(function(){
          console.log("I'm in here.")
     })
     .thenDo(function(){
          console.log("But now, I'm in here!")
     })

For module developers, by putting your module name in the Sequence like this:

new Sequence("myModuleName")

Means that any errors will show up like this:

Sequencer module error example

This will help you and your module's users to get to the bottom of the issue.

Play

.play()

Returns Promise

Causes the Sequence to play through all of its sections. Returns a Promise which resolves when all sections have played, and returns the Sequence.

Sequence

.sequence(inSequence)

Adds the sections from a given Sequence to this Sequence. This is useful if you have sequences you wish to combine at runtime.

Then do

.thenDo(function(){
    //do Stuff
})

Creates a section that will run a function. Remember that if you want your function to be asynchronous, and you want it to properly wait, you'll want to make the function into an async function:

.thenDo(async function(){
    //do Stuff
})

Macro

.macro("MacroName") or .macro(macroReference)

Creates a section that will run a macro based on a name or a direct reference to a macro. If the macro is not found, Sequencer will complain. Loudly.

It's expected that you pass a boolean as a second parameter if you wish the Sequencer to wait for the macro to finish.

.macro("New Macro", true)

Wait

.wait(1000) or .wait(500, 1000)

Causes the sequence to wait after the last section for as many milliseconds as you pass to this method. If given a second number, a random wait time between the two given numbers will be generated.

.animation() or .animation(inToken) or .animation(inTile)

Creates an animation section. Until you call any of the core methods, you'll be working on the Animation section.

.effect() or .effect(inFile)

Creates an effect section. Until you call any of the core methods, you'll be working on the Effect section.

.sound() or .sound(inFile)

Creates a sound section. Until you call any of the core methods, you'll be working on the Sound section.

Clone this wiki locally