Can anyone explain how to use the 'parameter' option in the NAS Auto-Operator profiles script function? I'm trying to configure an AO profile to pass the robot name to a script and I assume that's what the 'parameter' input on the profile function is for, but I can't find any documentation on how to use it.
you need two lines in your LUA script to pull in the argument. Do the below and robotname will be your variable to use. then you do whatever with it.
local data = pds.create()
In the nas AO profile the arguments/parameters are passed as a comma separated list. these will be available to the script contained in the constant SCRIPT_ARGUMENT
Excerpt below from the NAS Tech Brief version 3.60
SCRIPT_ARGUMENT = the argument string passed from the executing AO profile.
In the lua script you will extract the individual arguments into an array like this
args = split(SCRIPT_ARGUMENT,"/,") --split the string at the comma into individual elements
If I only pass in one argument, like robotname, then I could just use something like this
robotname = SCRIPT_ARGUMENT
or just use the SCRIPT_ARGUMENT constant to reference the robotname.
Wow much easier than the way i have use it Thanks !
Thanks, I believe that should provide what I need.
Also if you want the Robot Name for the Current Alarm that the AO is processing you can use the below. Using Alarm.get can get any information for the alarm.
a = alarm.get()
The NAS PDF has a full listing of the alarm.get info.