Getting Started With Lua Custom (Mix) Scripts

      Comments Off on Getting Started With Lua Custom (Mix) Scripts

OpenTX Lua Mix/Custom Scripts

What Is A Custom (Mix) Script

  1. Takes inputs such as sticks, switches and channels
  2. Selected and configured from the custom scripts screen
  3. Produces outputs that can be used as inputs to mixes
  4. Used as inputs in the mixes screen
  5. Up to 7 mix scripts can be active per model
  6. Can be used more than once by the same model
  7. Can be used by different models
  8. Selected and configured using the transmitter
  9. Can not be selected and configured using companion
  10. Can not display on the screen
  11. Mix scripts are also known as custom scripts because they are
    • Placed in the MIXES folder
    • Configured in the OpenTX CUSTOM SCRIPTS screen

OpenTX Firmware

Mix Script File Location

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

Setup Using The Transmitter

  1. Select and configure the lua mix script from the CUSTOM SCRIPTS screen
  2. On the MIXER screen add and configure mixes using an input from the output of the lua mix script

Sample Script Setup

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

  5. Press ENT
  6. Press ENT (again)
  7. Select GtStd
  8. Press ENT
  9. Press (-) twice to select Input – – –
  10. Press ENT, the – – – will flash on and off
  11. Press (-) or (+) to select the desired input
  12. Press ENT
  13. Press (-) to select Percent 5
  14. Press ENT, the 5 will flash on and off
  15. Press (-) or (+) to select the desired value
  16. Press ENT
  17. Move the input (in this case the throttle stick) and note the output value changing
  18. Note the name of the output, GtSt in this case
  19. Press EXIT twice

  20. Press PAGE repeatedly until MIXER screen is displayed
  21. Press (-) repeatedly until until the desired channel is selected
  22. Press ENT
  23. Press (-) to select Source
  24. Long Press ENT
  25. Press (-) to select Lua Scripts
  26. Press ENT
  27. Press EXIT repeatedly to get back to the MIXER screen
  28. Move the lua mix script input (the throttle stick in this case) and note the change in the channel value

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