Getting Started With Lua Function Scripts

      Comments Off on Getting Started With Lua Function Scripts

OpenTX Lua Function Scripts

What Is A Function Script

  1. Selected and configured on the special functions screen by selecting the Lua Script function
  2. They are executed based on switch position
  3. Typically used for customized announcements
  4. The number of scripts is limited only by the number of configurable special function lines
  5. Do not display on the LCD screen

Function Script File Location

  1. Transmitter
    SD Card > /SCRIPTS/FUNCTIONS/<name>.lua
  2. <name> 6 characters or less plus .lua

Setup Using The Transmitter

  1. Select and configure the Lua function script from the SPECIAL FUNCTIONS screen
  2. On the SPECIAL FUNCTIONS screen add a special function line using Play Script as the function

Sample Script Setup

  1. Download GtStd.lua (right click and Save As, Download Linked File)
  2. Place the file
    SD Card > /SCRIPTS/FUNCTIONS/
  3. Select the model to be edited
  4. Press PAGE repeatedly until the SPECIAL FUNCTIONS screen is displayed

  5. Press ENT
    Move a switch on the transmitter to the desired active position
  6. Press ENT
    Scroll to the next field
  7. Press ENT
    Scroll to select the Play Script function
  8.  Press ENT
    Scroll to the next field
  9. Press ENT
    Scroll to select the script to execute
  10. Press ENT
  11. Press EXIT
  12. To execute the script move the switch to the active position
    Note the switch filed becomes emphasized/bold when active

This was just an introduction to using a function script. It does not do anything useful. However now that you understand what function scripts are and how to use them you can now use any function script you come across.