modules.lua

modules.lua is a file that’s loaded early on, and has 2 responsibilities:

  • Load the lua files that define the modules that are going to be loaded
  • Define a lua table containing the modules to load named modules

Here is an example taken from Shard in June 2016:

shard_include( "spothandler" )
shard_include( "controlpointhandler" )
shard_include( "unithandler" )
shard_include( "attackhandler" )
shard_include( "sleep" )

modules = { UnitHandler, AttackHandler, ControlPointHandler, MetalSpotHandler, Sleep }

New modules can be added by adding them to the modules table, making sure that they are first loaded into lua.