LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lp.GetEventActionList

number = lp.GetEventActionList(event_number,’array’);

number = lp.GetEventActionList(event_number,’array’,index);

Description

The lp.GetEventActionList LUA function returns in a table the list of all referenced actions associated to an event of LoriotPro

Parameters

event_number             An event number of the list of events

‘array’              An emtpy array that will contain the returned parameters

index             Equal to 1 if the table start at 1, require to support the LUA ipairs(array) function.

Return Values

Number         The number of entries in the table 'array’

Warning ! . LoriotPro LUA function returns indexed table starting at index 0. Usually LUA function returns table starting at index 1. This cas cause errors when using some management function of LUA.

array[0]…array[number-1]             An array of the IP adresses of the devices found. (or array[1]…array[number] if index)

nil                            nil if an error occurs

Example

event action list script LUA

Retrieve the list of action for all the events

 


lp.Print("start\n");
number = lp.GetEventActionList(100,"ta");

if number then

lp.Print(string.format("\nFound %i Loriot Event registered\n",number));

 

for j=0,(number-1) do

lp.Print(string.format("Event ActionList %s\n",ta[j]));

end

 

lp.Print("table.getn\n");

for i=0,table.getn(ta) do

lp.Print(string.format("Event ActionList %s\n",ta[i]));

end

 

lp.Print("ipairs\n");

lp.GetEventActionList(100,"ta",1);

for key,value in ipairs(ta) do lp.Print("[",key,"] [",value,"]\n") end

 

end

lp.Print("end\n");

 

 

event action list script LUA

 

 


www.loriotpro.com