--- title: "Adding a List Parameter to a Profile Using Lua - icom OS Routers" slug: "adding-a-list-parameter-to-a-profile-using-lua-en" updated: 2025-01-08T12:52:21Z published: 2025-01-08T12:52:21Z canonical: "docs.insys-icom.com/adding-a-list-parameter-to-a-profile-using-lua-en" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.insys-icom.com/llms.txt > Use this file to discover all available pages before exploring further. # Adding a List Parameter to a Profile Using Lua - icom OS Routers ASCII configuration files can be designed flexibly and with dependencies by using the Lua scripting language within them. ## Situation A parameter is to be added to an existing profile using an ASCII configuration file containing a Lua script. ## Solution The problem when adding a list parameter to an existing configuration list is that it is necessary to know the number of already existing list entries if another parameter references to this parameter. If the number is unknown or the ASCII configuration is to be applied to different routers with a differing number of list entries, this can be solved using a Lua script to determine the number of existing list entries. We use the example of the Configuration Guide [Dual Connection Check with Ping and Triggering an Action](/kb/docs/en/dual-connection-check-with-ping-and-triggering-an-action-en) to show how to do this. This example uses an ASCII configuration file to add a timer and an event that uses this timer. To use this timer, the event must know the number of it. Refer to the [Lua 5.3 Reference Manual](https://www.lua.org/manual/5.3/) for more information about Lua. ### Preparation of the ASCII configuration file We’ve prepared the following ASCII configuration file for adding the timer and event of above example. Copy and paste it to your text editor or download it using the link below. The ASCII configuration file will add a timer to an already existing list of timers using the function [last]. Then, an action will be added that uses this timer as a triggering event. ASCII configuration file ```lua events.timer.timer.add events.timer.timer[last].active=1 events.timer.timer[last].description=Timer for dual ping check with Lua events.timer.timer[last].type=interval events.timer.timer[last].interval_hh=00 events.timer.timer[last].interval_mm=10 events.event_config.event.add events.event_config.event[last].active=1 events.event_config.event[last].description=Dual ping check with Lua events.event_config.event[last].event_type=ev_timer -----LUA----- cli("events.event_config.event[last].event_timer_name=timer"..cli("events.timer.timer.size").."") -----LUA----- events.event_config.event[last].event_action_type=act_ascii events.event_config.event[last].event_action_ascii=CG_m3_lua_connection_check_script.txt administration.profiles.activate ``` [ASCII configuration file download (right-click and save as)](https://docs.insys-icom.de/assets/configs/cg_m3_lua_ascii_adding_parameters.txt) A short Lua script is used to determine the size of the timer list and use it to compose the timer name of the added timer. The double dots `..` connect the first string `events.event_config.event[last].event_timer_name=timer` with the result returned from `events.timer.timer.size` and a last, empty string to form the whole command: Lua script from ASCII configuration file ```lua -----LUA----- cli("events.event_config.event[last].event_timer_name=timer"..cli("events.timer.timer.size").."") -----LUA----- ``` ### Router configuration It is prerequisite that you have access to the web interface of the router. 1. Open the user interface of the router: [https://insys.icom](https://insys.icom) 2. Click in the *Administration* → *Profile* menu in the *ASCII configuration* section on , select the Lua script just downloaded and click on SUBMIT. 3. In order to apply an ASCII configuration file, click in the row of the configuration file (not the Lua script), then on *Apply ASCII configuration* and on APPLY ASCII CONFIGURATION. This will add the timer and the event to your profile. ### Result testing 1. Change to the *Events* → *Timer* menu to see the timer that has been added at the end of the list. 2. Change to the *Events* → *Events* menu to see the event that has been added at the end of the list and open this event for editing () to see that above timer is used to trigger the event. Standard IP address: https://192.168.1.1; login depending on configuration; default for earlier firmware versions: *User name*: **insys**, *Password*: **icom** Applying an ASCII configuration file means that the opened profile will be amended or modified by the configurations contained. The opened profile will not be activated by this unless it contains the command `administration.profiles.activate`.