Next Topic

Previous Topic

Book Contents

Sample Script: OnConfigure

function OnConfigure()

	--The variable returned must be called "Config" so KNM 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 KNM, set to zero for if no specificbuild 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 thefirst argument",LuaScriptConfigurator.CHECK_NOT_EMPTY)

	--Add another parameter, a select box with 3 values.
	Config:AddArgument("Argument 2","This is the description of thesecond argument",LuaScriptConfigurator.CHECK_NOT_EMPTY+LuaScriptConfigurator.ENUM_AVIL)

	--Set the entry point, this is the function called by KNM
	Config:SetEntryPoint("main")

	--Done with configuration, return the object
	return Config
end