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.LoadLibrary - Load a new LUA library

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.


lib,init=lp.LoadLibrary(“libpath”, “init_function_name”); ;


The lp.LoadLibrary LUA function allow you to load in a script a set of new functions defined in an LUA external library. The LIBRARY should be in the LUA 5.0.2 format. For more informations about the library creation, read the LUA documentation on the


Meanwhile this function can be use in a virtual SNMP object we do not recommend to use it. This function can be used in Active View when calling script from menu.

The usage of the lp.FreeLibrary to close the opened library can create instability. In that case it is better to close the calling script and program that close the library.


libpath - The path and the name of the library to load.
init_function_name - The name of the initialisation function of the library

Return Values

Lib - A pointer on the library. Can be use to free it
Init - A pointer on the library initialization function


This example display a dialog box on the screen

lp_value = 0;
lp_buffer ="error";


if (lib) then
if lp.FreeLibrary(lib) then
lp_buffer ="ok";

Warning! The strategy includes a LUA language to load external libraries with the class package and the reserved keyword "require".

If you download the examples on the internet you will certainly find these commands at the beginning of the script. Consult the documentation for LUA for more information.

Here is an example of loading with the library lualdap you can find on the website:

require "lualdap" 

ld = assert (lualdap.open_simple ("ldap.server",






if (lib) then


ld = assert (lualdap.open_simple ("ldap.server",