Navigation:  »No topics above this level«

LuaScriptConfigurator

Previous pageReturn to chapter overviewNext page

This class provides an interface to create configuration information that INM uses to present an user interface for the script.

Example

----------------------------------------------------------------------------------------------------------

-- INM Lua API example (C) 2008 Intellipool AB

-- Demonstrates the LuaScriptConfigurator interface

----------------------------------------------------------------------------------------------------------

function OnConfigure()

 

 -- The variable returned must be called "Config" so INM can find it.

 Config = LuaScriptConfigurator()

 

 -- Author.

 Config:SetAuthor("My name")

 

 -- Description.

 Config:SetDescription("Description of the script, including usage, parameters etc")

 

 -- Minimum build version of INM, set to zero for if no specific build version is required.

 Config:SetMinBuildVersion(0)

 

 -- Script version (major/minor)

 Config:SetScriptVersion(1,0)

 

 -- A parameter configuration, add them in the order the script is extracting them.

 Config:AddArgument("Argument 1","This is the description of the first argument",LuaScriptConfigurator.CHECK_NOT_EMPTY)

 

 -- Add another parameter, a select box with 3 values.

 Config:AddArgument("Argument 2","This is the description of the second argument",LuaScriptConfigurator.CHECK_NOT_EMPTY+LuaScriptConfigurator.ENUM_AVIL)

 

 

 -- Set the entry point, this is the function called by INM

 Config:SetEntryPoint("main")

 

 -- Done with configuration, return the object

 return Config

end