Skip to content
Shaye Garg edited this page Oct 3, 2021 · 1 revision

update lets you run any code you wish at any interval.

update uses an inbuilt enum:

// An interaction mode
enum Interaction {
    Legacy, // The legacy mode of interaction
    Lock, // The lock mode of interaction
    Both // Both modes of interaction
}

You can create updates like:

update {
    mode: <expr>,
    frequency: <expr>, // Optional
    do: <expr>
}
// Which would be:
update {
    mode: Interaction.Both,
    frequency: 0.1,
    do: @{
        @"L:ThisIsAlwaysZero" = 0;
    }
}

update {
    mode: Interaction.Both,
    do: @{
        @"L:ThisStartsOffWithAValueOfOne" = 1;
    }
}

mode: In which interaction mode this update should be run. frequency: The number of times per second to run the update. If this is not present, the update is only run once - at spawn. do: The code to execute.

Clone this wiki locally