> For the complete documentation index, see [llms.txt](https://help.depence.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.depence.com/depence-tips-and-tricks/working-with-command-scripts.md).

# Working with Command Scripts

## Command Script – User Guide

The **Command Script** is Depence's text-based control language. With it you can select fixtures, set values, run effects, start/stop scenes and sequences, work with variables and chain scripts together – all in a simple, line-oriented syntax.

A script can be executed from three places:

| Entry point                                   | Purpose                                      | Effect                                                              |
| --------------------------------------------- | -------------------------------------------- | ------------------------------------------------------------------- |
| **Command Window**                            | Type single commands interactively           | Writes directly into the **Programmer** (live operation).           |
| **Script Editor**                             | Create / test scripts                        | Writes directly into the **Programmer**.                            |
| **Sequence – Script Block (`TBlock_Script`)** | Execute a script automatically inside a show | Writes into the **Sequence chase** (does not touch the Programmer). |
| **AI / MCP**                                  | Run a script via an AI tool call             | Writes directly into the **Programmer**.                            |

> The language is **case-insensitive**. `SELECT` and `select` are identical.

***

### 1. General Syntax

* **One command per line.** Empty lines are ignored.
* **Multiple selections / IDs** are separated by comma: `SELECT FIXTURE 1,3,5`.
* **Ranges** use `THRU`: `SELECT FIXTURE 1 THRU 10`.
* **Names containing spaces** must be enclosed in double quotes: `STARTSCENE "Intro Look"`.
* **Values** are introduced with `@`: `SET VALUE @50%`. `=` and `TO` are accepted as synonyms.
* **Decimal separator** is culture-independent – both `0.5` and `0,5` work.
* **Variables** are referenced with `$name` (after being defined via `VAR` / `PVAR`) and are substituted automatically by the parser.

#### Typical order inside a block

```
SELECT FIXTURE 1 THRU 8        ' WHAT do we control?
SET FADETIME @2                ' HOW long does the change take?
SET VALUE @75%                 ' Which target value?
```

***

### 2. Value Formats

Value formats are used wherever you see `@<value>`.

| Format       | Example                    | Meaning                                       |
| ------------ | -------------------------- | --------------------------------------------- |
| Percent      | `@50%`                     | 50 % of the feature's value range.            |
| Full         | `@FULL`                    | Highlight value (max., see `FULLOPEN`).       |
| BPM          | `@120BPM`                  | Speed as beats per minute (for effect speed). |
| Degrees      | `@90°`                     | Pan/Tilt angle or FX phase.                   |
| Hertz        | `@5Hz`                     | Strobe frequency.                             |
| Feature name | `@RED`, `@OPEN`, `@PRISM1` | Predefined feature / wheel slot.              |
| Variable     | `@$myvalue`                | Value resolved from `VAR` / `PVAR`.           |

***

### 3. Selection – `SELECT`

#### Select fixtures

```
SELECT FIXTURE 1
SELECT FIXTURE 1,3,5
SELECT FIXTURE 1 THRU 10
SELECT FIXTURE 1 THRU 10 ODD          ' odd IDs only
SELECT FIXTURE 1 THRU 10 EVEN         ' even IDs only
SELECT FIXTURE 1 THRU 20 STEP 3       ' every 3rd ID
SELECT FIXTURE 1,3 THRU 5,9           ' combined
```

#### Select selection groups

```
SELECT GROUP "Pump 1"
SELECT GROUP "WP1\Lines\Even"        ' folder path
```

Aggregate fixtures (e.g. fountain modules) are automatically expanded into their child fixtures.

#### Select individual features (channels)

```
SELECT DIMMER FROM FIXTURE 1 THRU 4
SELECT PAN,TILT FROM FIXTURE 5
SELECT RED,GREEN,BLUE FROM 1 THRU 8  ' "FROM" without FIXTURE: uses the current selection
```

#### Clear the selection

```
CLEAR
```

***

### 4. Setting Values – `SET`

Sets a value on the most recently selected channels.

#### Intensity / channel value

```
SET VALUE @50%
SET VALUE @FULL
SET @FULL                ' shortcut for "all highlight values"
```

#### Specific feature

```
SET DIMMER @75%
SET PAN    @90°
SET TILT   @-15°
SET RED    @100%
SET GOBO   @GOBO3        ' by feature name
SET PRISM  @OPEN
```

#### Indexed sub-groups / masters

```
SET MASTER Dimmer @50%   ' master of an aggregate / group master
SET INDEX  @2            ' nth element inside an aggregate
```

#### Fade & Delay

Fade and delay times apply to the **next** `SET` and are reset to zero afterwards.

```
SET FADETIME  @3         ' 3 seconds fade
SET DELAYTIME @1         ' 1 second pre-delay
SET DIMMER    @100%      ' now fades to full over 3 s
```

***

### 5. Programmer Lifecycle

| Command       | Effect                                                                                                                            |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `FULLOPEN`    | Drives the selected fixtures to their highlight values (dimmer/shutter/…). Identical to the "Full Open" button in the Programmer. |
| `RELEASE`     | Removes the selected channels from the Programmer (drops their values).                                                           |
| `RELEASE ALL` | Empties the entire Programmer (releases all values on all fixtures).                                                              |
| `CLEAR`       | Resets the selection (channel values stay untouched).                                                                             |

***

### 6. Effects (FX) – `SET EFFECT` + Parameters

Effects are applied as an FX layer on top of the selected channels.

```
SELECT FIXTURE 1 THRU 8
SET EFFECT Sinus              ' FX type (Sinus, Cosinus, Pulse, Ramp, ...)
SET SPEED     @60BPM
SET CENTER    @50%
SET AMPLITUDE @50%
SET PHASE     @45°
SET OFFSET    @0%
SET REPEATS   @0              ' 0 = endless, otherwise number of cycles
SET MIN       @0%
SET MAX       @100%
SET CUTLEFT   @0%
SET CUTRIGHT  @0%
SET WIDTH     @50%
```

#### Distribution across the selection

```
SET WINGS  @2                 ' mirror across n wings
SET BLOCKS @4                 ' block size inside the wings
SET PANORAMA @/               ' spread: |  /  \  >  <
```

| Panorama value | Meaning          |
| -------------- | ---------------- |
| `\|`           | no spread        |
| `/`            | left → right     |
| `\`            | right → left     |
| `>`            | outside → centre |
| `<`            | centre → outside |

Effects are removed again via `RELEASE` (on the selected channels).

***

### 7. Scenes – start & stop

Scenes (stored looks) are addressed by **name**.

```
STARTSCENE "Intro Look"
STARTSCENE "Intro Look" FADE 3
STARTSCENE "Intro Look" FADE 3 DELAY 1

STOPSCENE  "Intro Look"
STOPSCENE  "Intro Look" FADE 2
```

* `FADE <seconds>` – fade in/out time.
* `DELAY <seconds>` – wait time before the fade starts.

***

### 8. Sequences (Shows) – start & stop

#### Start a show in the Sequencer chase

```
STARTSEQUENCE "Main Show"
```

* Rewinds the show to position 0 and starts it in the normal **Sequencer chase** (multiple shows can run in parallel).

#### Start a show in the Programmer chase

```
PLAY "Main Show"
```

* Starts the show inside the **Programmer chase** (useful for previewing).

#### Stop shows

```
STOP "Main Show"          ' stop a specific show
STOP                      ' stop ALL running shows
```

***

### 9. Batched Execution – `BEGINSCENE` / `ENDSCENE`

Mostly used in AI context (several tool calls in one session) to batch many commands and apply them only once the block is closed.

```
BEGINSCENE
SELECT FIXTURE 1 THRU 8
SET VALUE @100%
SET RED   @100%
ENDSCENE
```

In the classic script path both commands are harmless markers (no-op) and can stay in place without side effects.

***

### 10. Variables – `VAR` / `PVAR`

#### Local script variable (`VAR`)

Lives only inside the current script.

```
VAR myDim = 75
SELECT FIXTURE 1 THRU 4
SET VALUE @$myDim%
```

#### Public variable (`PVAR`)

Writes into the global Panel & Logic variable pool and can be read by panels / logic items.

```
PVAR HouseLight = 25
```

Syntax for both commands:

```
VAR  <name> = <value>
PVAR <name> = <value>
```

***

### 11. Chaining Scripts – `CALL`

Calls another script stored in the project, by name.

```
CALL "Reset Programmer"
CALL "House Lights On"
```

Handy to keep recurring building blocks (e.g. "all pumps off") in one place.

***

### 12. Scheduler – `TIMEPLANER`

Controls the scheduler of the current show player device.

```
TIMEPLANER START      ' synonyms: RUN, PLAY
TIMEPLANER STOP       ' synonym:  END
```

***

### 13. Full Command Reference

| Command                                                                          | Short description                                             |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `SELECT FIXTURE …`                                                               | Select fixtures by ID (lists, `THRU`, `ODD`, `EVEN`, `STEP`). |
| `SELECT GROUP "…"`                                                               | Select a selection group (folder path supported).             |
| `SELECT <feature> FROM …`                                                        | Select individual features of the (pre-)selected fixtures.    |
| `CLEAR`                                                                          | Reset selection.                                              |
| `SET VALUE @…`                                                                   | Set channel value / intensity.                                |
| `SET @FULL` / `FULLOPEN`                                                         | Drive to highlight values.                                    |
| `SET <feature> @…`                                                               | Set a feature directly (Dimmer, Pan, RGB, Gobo, …).           |
| `SET MASTER … @…`                                                                | Set an aggregate master.                                      |
| `SET INDEX @n`                                                                   | Pick the nth element of an aggregate.                         |
| `SET FADETIME @s`, `SET DELAYTIME @s`                                            | Timing for the next `SET`.                                    |
| `SET EFFECT <FX>`                                                                | Assign an FX type (Sinus, Pulse, Ramp …).                     |
| `SET SPEED/CENTER/AMPLITUDE/PHASE/OFFSET/MIN/MAX/REPEATS/WIDTH/CUTLEFT/CUTRIGHT` | FX parameters.                                                |
| `SET WINGS/BLOCKS/PANORAMA`                                                      | FX distribution across the selection.                         |
| `RELEASE` / `RELEASE ALL`                                                        | Release Programmer values.                                    |
| `STARTSCENE "…" [FADE s] [DELAY s]`                                              | Start a scene.                                                |
| `STOPSCENE "…" [FADE s] [DELAY s]`                                               | Stop a scene.                                                 |
| `STARTSEQUENCE "…"`                                                              | Start a sequence in the Sequencer chase.                      |
| `PLAY "…"`                                                                       | Start a sequence in the Programmer chase.                     |
| `STOP ["…"]`                                                                     | Stop a specific sequence, or all of them.                     |
| `BEGINSCENE` / `ENDSCENE`                                                        | Batched execution markers.                                    |
| `VAR <name> = <value>`                                                           | Local variable.                                               |
| `PVAR <name> = <value>`                                                          | Public variable.                                              |
| `CALL "…"`                                                                       | Run another script.                                           |
| `TIMEPLANER START/STOP`                                                          | Enable/disable the scheduler.                                 |

***

### 14. Examples

#### Example A – Classic "Lights On" look

```
SELECT FIXTURE 1 THRU 16
SET FADETIME @2
SET VALUE    @100%
SET RED      @100%
SET GREEN    @60%
SET BLUE     @0%
```

#### Example B – Fountain with a sine effect

```
SELECT GROUP "Pumps Front"
SET EFFECT    Sinus
SET SPEED     @90BPM
SET MIN       @20%
SET MAX       @100%
SET PHASE     @30°
SET PANORAMA  @/
```

#### Example C – Start a show automatically

```
STARTSCENE    "House Down" FADE 3
STARTSEQUENCE "Main Show"
```

#### Example D – Reusable building blocks

Script `Reset`:

```
RELEASE ALL
CLEAR
```

Another script:

```
CALL "Reset"
STARTSCENE "Intro"
```

#### Example E – Variables for repeated values

```
VAR Bright = 80
SELECT FIXTURE 1 THRU 4
SET VALUE @$Bright%

SELECT FIXTURE 5 THRU 8
SET VALUE @$Bright%
```

***

### 15. Best Practices & Pitfalls

* **Mind the order:** `SELECT` first, then `SET`. Without a selection `SET` does nothing.
* **Fade/Delay are "one-shot":** `SET FADETIME` / `SET DELAYTIME` only apply to the **next** value command and are reset to 0 afterwards – set them again before each block if needed.
* **Quote names:** scene / sequence / script / group names containing spaces or special characters **must** be wrapped in `"…"`.
* **Decimal separator:** both `0.5` and `0,5` are accepted – scripts stay portable across locales.
* **`RELEASE` vs. `CLEAR`:** `CLEAR` only drops the selection; `RELEASE` actually removes values from the Programmer.
* **`PLAY` vs. `STARTSEQUENCE`:** `PLAY` starts a show in the **Programmer chase** (preview), `STARTSEQUENCE` starts it in the regular **Sequencer chase**.
* **Script running inside a sequence:** when a script is executed by a sequence's Script Block (`TBlock_Script`) it writes into the **Sequence chase**, not the Programmer – so `RELEASE ALL` does not affect the Programmer in that case.
* **Unknown commands** are silently ignored; typos (e.g. `SELLECT`) will therefore not raise an error – but they will also have no effect.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.depence.com/depence-tips-and-tricks/working-with-command-scripts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
