Regular API function

simHandleModule / sim.handleModule

Description Handles a plugin. This function is only available from the Lua API. Plugins, next to their registered custom Lua functions, might need to perform operations on a regular basis and not when called from a threaded script (e.g. for synchronization purposes). They can do it when sim.handleModule is called (sim.openModule should however have been called previously). Refer to the messages relayed to plugins for more details. sim.handleModule can only be called from the main script and is not available in the C-API. Look at the default main script to get an idea about how to use sim.openModule, sim.handleModule and sim.closeModule.
C synopsis -
C parameters
C return value
Lua synopsis
(1) number result=sim.handleModule(number sim.handle_all,boolean calledInSensingPart)
(2) number result=sim.handleModule(string moduleName,boolean calledInSensingPart)
Lua parameters
sim.handle_all: indicates that all plugins should be handled (called)
moduleName: the name of the plugin that should be handled (called)
calledInSensingPart: set to false when called in the "actuation part". Set to true when called in the "sensing part"
Lua return values
result: -1 in case of an error, otherwise result is the number of plugins that executed the command.

All regular API functions on one page