# Getting Started

You can code in Control Blocks with a custom text language called ControlScript.  It is heavily based on LUA, so knowing LUA basics might help you.

{% hint style="info" %}
ControlScript is Case Sensitive!
{% endhint %}

Once you have the block placed, right-click on it to bring up the UI. We will guide you around everything.

<div data-with-frame="true"><figure><img src="/files/jEvVQSbvJrEoBfYFCShC" alt=""><figcaption></figcaption></figure></div>

### <i class="fa-tag">:tag:</i> Naming Your Block

<div data-with-frame="true"><figure><img src="/files/Z8qDdknWrjUJzlXAtEQy" alt=""><figcaption></figcaption></figure></div>

You can name your control blocks to recognize them when working with multiple ones!

### <i class="fa-code">:code:</i> Code Editor

The Code Editor can be opened by clicking the `[>_] Edit Code` button.&#x20;

<div data-with-frame="true"><figure><img src="/files/VAlEtPxcMuVJYn7qZftH" alt=""><figcaption></figcaption></figure></div>

Once clicked, you should see a code editor appear, like shown below. This is your main workspace. Once done coding, you can press the disk button to save. You can see in the code editor, the control block name, save & cancel buttons, and the coding area where you can type your code.

<div data-with-frame="true"><figure><img src="/files/OXXkk5Ylp6q3XJHmhVvb" alt=""><figcaption></figcaption></figure></div>

### <i class="fa-list">:list:</i> Execution Modes

Execution modes are the way your control block will behave. Selecting either Repeat or Redstone will show a tick field. For more information, please view the [Execution Modes](/control-blocks-mod-docs/controlscript/execution-modes.md) page.

<div data-with-frame="true"><figure><img src="/files/fkyKOp6iLA8pTMnmmEV7" alt=""><figcaption></figcaption></figure></div>

### <i class="fa-floppy-disks">:floppy-disks:</i> Save Your Script

Top options include "Save," "Close," and "Docs."

<div data-with-frame="true"><figure><img src="/files/GofiVY7cYH1ADWkY8Sq9" alt=""><figcaption></figcaption></figure></div>

They are pretty obvious, but here is what each one does.

#### Save

The save button ("<i class="fa-floppy-disk">:floppy-disk:</i>" floppy disk button) saves the entirety of your code. This is relative to the control block, meaning you are not limited to only one.

#### Close

The close button ("X" button) will close the UI in the same way as Save, except your code won't be saved and will stay unchanged as the previous version.

#### Docs/Info

Clicking the "Docs" button ("<i class="fa-circle-info">:circle-info:</i>" info button) will open a tab in your default browser, opening this Documentation Site.


---

# Agent Instructions: 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://control-blocks-mod.gitbook.io/control-blocks-mod-docs/controlscript/getting-started.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.
