> For the complete documentation index, see [llms.txt](https://luadoc.edgetx.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luadoc.edgetx.org/edgetx_2.4/part_v_-_converting_opentx_21_scripts.md).

# Part V - Converting OpenTX 2.1 Scripts

This section also covers some of the requirements for scripts that are necessary for them to function properly under both OpenTX 2.2.

## New features

* LUA Widgets (Horus only)
* LUA Themes (Horus only)

## Changes

* Lua Themes and Widgets run in a separate Lua environment. They are isolated from the other Lua environment which runs other scripts. This means they can not share variables, etc... (Horus only)
* Function scripts can have a `background()` function defined (similar to the Telemetry scripts). It will be called periodically when the switch that activates it is FALSE.
* Horus doesn't support Telemetry scripts.
* Telemetry and Mix scripts maximum file name length (without extension) was reduced from 8 to 6 characters.
* Telemetry and Mix scripts maximum number of inputs reduced from 8 to 6

### LCD Functions

* Function `lcd.lock()` was removed.
* New function `lcd.refresh()`.
* Default number alignment changed from RIGHT to LEFT.
* `lcd.getLastPos()` is not available on Horus
* Functions only available on Horus:
  * `lcd.drawBitmap()`
  * `lcd.setColor()`
  * `lcd.RGB()`
* Functions only available on Taranis:
  * `lcd.drawPixmap`
  * `lcd.drawScreenTitle`
  * `lcd.drawCombobox`

### General Functions

* `RIGHT` added
* Rotary encoder events added:
  * `EVT_ROT_BREAK`
  * `EVT_ROT_LONG`
  * `EVT_ROT_LEFT`
  * `EVT_ROT_RIGHT`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://luadoc.edgetx.org/edgetx_2.4/part_v_-_converting_opentx_21_scripts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
