# Extensions

An **extension** is a set of new instructions added to the vanilla game. The [CLEO library](https://cleo.li) and its plugins is the most known way of adding those.

To make Sanny Builder aware of the custom instructions and explicitly signal their intentional usage, a script must have `{$USE}` [directive](/language/directives.md#usduse). The `{$USE}` directive enables one or multiple sets of instructions (see below the [list of extensions](#extensions-list)).

```
{$USE CLEO, ini, CLEO+}
```

Each opcode included in Sanny Builder's [INI files](/edit-modes/opcodes-list-scm.ini.md) has been categorized to belong to some extension. Currently it is done via the file `extensions.txt`.

{% hint style="info" %}
New edit modes shipped with Sanny Builder 4 use command definitions managed through Sanny Builder Library (SBL). They don't use [INI files](/edit-modes/opcodes-list-scm.ini.md) and `extensions.txt`. Information about each extension can be found in the JSON file located in the mode directory, or on the [Sanny Builder Library](https://library.sannybuilder.com/#/) website.
{% endhint %}

## Implicit Extensions

Standard game opcodes have been included in the `default` extension that is implicitly available in any script. `{$USE default}` is possible but redundant.

Using `{$CLEO}` [directive](/language/directives.md#usdcleo) also implies `{$USE CLEO}` so standard CLEO opcodes are available to the compiler already.

## Extensions List

Sanny Builder ships some common and recognized extensions for different edit modes.

{% hint style="info" %}
This list does not apply to the new SBL edit modes. Find a list of extensions for each game in [Sanny Builder Library](https://library.sannybuilder.com/#/).
{% endhint %}

| **Extension Name**                                                        | **Source**                                                                         | **Edit Modes Where Available**                                                                       |
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| <p><strong>CLEO</strong></p><p><code>{$USE CLEO}</code></p>               | <p>CLEO for GTA III<br>CLEO for Vice City</p><p>CLEO 4.4</p><p>CLEO Android</p>    | <p>GTA III</p><p>Vice City</p><p>GTA SA v1.0, v2.0, (v1.0 - SCR)</p><p>SA Mobile</p><p>VC Mobile</p> |
| <p><strong>ini</strong></p><p><code>{$USE ini}</code></p>                 | <p>IniFiles.cleo plugin<br>(ships with CLEO)</p>                                   | <p>GTA III<br>Vice City</p><p>GTA SA v1.0, v2.0, (v1.0 - SCR)</p>                                    |
| <p><strong>file</strong></p><p><code>{$USE file}</code></p>               | <p>FileSystemOperations plugin<br>(ships with CLEO)</p>                            | <p>GTA III<br>Vice City</p><p>GTA SA v1.0, v2.0, (v1.0 - SCR)</p>                                    |
| <p><strong>bitwise</strong></p><p><code>{$USE bitwise}</code></p>         | <p>IntOperations plugin<br>(ships with CLEO4)</p>                                  | <p>GTA III<br>Vice City</p><p>GTA SA v1.0, v2.0, (v1.0 - SCR)</p>                                    |
| <p><strong>clipboard</strong></p><p><code>{$USE clipboard}</code></p>     | ClipboardControl plugin                                                            | <p>GTA III<br>Vice City</p><p>GTA SA v1.0, v2.0, (v1.0 - SCR)</p>                                    |
| <p><strong>memory</strong></p><p><code>{$USE memory}</code></p>           | MemoryModule plugin                                                                | <p>GTA III<br>Vice City</p>                                                                          |
| <p><strong>CLEO+</strong></p><p><code>{$USE CLEO+}</code></p>             | CLEO+ plugin                                                                       | GTA SA v1.0, v2.0, (v1.0 - SCR)                                                                      |
| <p><strong>newOpcodes</strong></p><p><code>{$USE newOpcodes}</code></p>   | newOpcodes plugin                                                                  | GTA SA v1.0, v2.0                                                                                    |
| <p><strong>Restoration</strong></p><p><code>{$USE Restoration}</code></p> | [Opcode Restoration Project](https://gtamods.com/wiki/Opcodes_Restoration_Project) | Vice City                                                                                            |

Using opcodes provided by the third-party libraries not listed above is still possible, the compiler will not require the `{$USE}` directive for them.


---

# 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://docs.sannybuilder.com/edit-modes/extensions.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.
