template.lua 768 B

1234567891011121314151617181920212223242526272829
  1. Module = {}
  2. Module.setup = {
  3. name = "Module Name",
  4. desc = "Description of the module"
  5. }
  6. -- defines the input parameters to the module initiate function
  7. -- when calling a module from within another module
  8. -- variables not defined in config will be ignored
  9. -- default values set in config can be overridden
  10. Module.config = {
  11. votes_required = 5
  12. voting_type = "majority"
  13. }
  14. -- Modules have access to the following instance variables
  15. -- self.org (the org the module was called in)
  16. -- self.initiator (the user that callced the module)
  17. -- self.id (the process id of the module instance)
  18. function Module:initiate(config, result)
  19. -- call interaction functions here!
  20. -- call result function
  21. if result then result() end
  22. end