added module template, added support for module parameters and default values through the config table
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
|
||||
|
||||
Module = {}
|
||||
|
||||
Module.setup = {
|
||||
name = "Module Name",
|
||||
desc = "Description of the module"
|
||||
}
|
||||
|
||||
-- defines the input parameters to the module initiate function
|
||||
-- when calling a module from within another module
|
||||
-- variables not defined in config will be ignored
|
||||
-- default values set in config can be overridden
|
||||
Module.config = {
|
||||
votes_required = 5
|
||||
voting_type = "majority"
|
||||
}
|
||||
|
||||
-- Modules have access to the following instance variables
|
||||
-- self.org (the org the module was called in)
|
||||
-- self.initiator (the user that callced the module)
|
||||
-- self.id (the process id of the module instance)
|
||||
|
||||
function Module:initiate(config, result)
|
||||
-- call interaction functions here!
|
||||
|
||||
-- call result function
|
||||
if result then result() end
|
||||
end
|
||||
Reference in New Issue
Block a user