Writing or Loading a Lua Script
You can enter or load up to 4 scripts to the HPDU.
Note -
If you can no longer enter or load a new script after reaching the upper
limit, you can either delete any script or modify or replace script
codes.
-
Select Device Settings → Lua Scripts → + Create New
Script.
-
Type a name for this script. Its length ranges between 1 to 63
characters.
The name must contain only alphanumeric characters, underscore (_), and
minus (-), with no spaces.
-
Determine whether and when to automatically execute the loaded
script.
|
|
Start automatically at system boot
|
When the HPDU reboots, the script is automatically
executed.
|
Restart after termination
|
Script is automatically executed each time after 10
seconds since the script execution finishes.
|
|
-
(Optional) Determine the arguments that will be executed by
default.
-
Click + Add argument.
-
Type the key and value.
-
Repeat Steps 4a and 4b to enter more arguments as needed.
-
To remove an argument, click - (Minus button) next to it.
Note -
Default arguments are overridden by the new arguments
specified with the Start with Arguments command or with any
Lua-script-related event rule.
-
In the Source Code section, do one of the following. It is recommended to
leave the Enable Syntax Highlighting check box selected unless you do not
need different text colors to identify diverse code syntaxes.
-
To write a Lua script, type the codes in the Source Code
section.
-
To load an existing Lua script file, click Load Local File.
-
To use one of the Lua script examples, click Load Example.
 | Caution -
The new script overwrites all codes in the Source Code
section. Therefore, do not load a new script if the current
script meets your needs.
|
-
Click Create.
-
To execute the newly-added script immediately, click Start or the three
vertical dots → Start with Arguments.
-
To add more scripts, return to the scripts list by clicking Lua Scripts at
the top of the page or in the Menu, and repeat Steps 1-7.