Code:
A module is a function that when created, is added to the TIMER_TICK event. It is then executed every 200ms, as is the behavior of the TIMER_TICK.
To create a Module, simply call the constructor for it: Module.New(name, func). The parameter name is a string which can then be used to modify the status of the module (i.e. Module.Stop(name), etc.). The function is the function that will be called when the TIMER_TICK event occurs.
In essence, a module is as simple as this:
###############################
-- First create a function for your module.
function checkCreature()
local c = Creature.New('Demon')
if c:isAlive() and c:isOnScreen() then
print('Run!')
end
end
-- Then create a module for that function.
Module.New('creature check', checkCreature)
################################
If you would like to control your module at any time, you can start or stop it with Module.Start(name) and Module.Stop(name).