Regular API function

sim.registerScriptFuncHook

Description
Lua only. Registers a script function hook for callback functions, that will be executed before or after the specified function. Calling this function a second time with the same arguments will unregister a previous hook.
C/C++
synopsis
simInt simRegisterScriptFuncHook(simInt scriptHandle,const simChar* funcToHook,const simChar* userFunc,simBool execBefore,simInt options)
C/C++
parameters
scriptHandle: the handle of the script
funcToHook: the function to hook
userFunc: the user function
execBefore: if true, the user function will be called before the function to hook. Otherwise it will be called after.
options: set to 0
C/C++
return value
1 if the hook registration was successful, 0 if a previous hook was removed, and -1 in case of an error
Lua
synopsis
int result=sim.registerScriptFuncHook(string funcToHook,string/function userFunc,bool execBefore)
Lua
parameters
Similar to the C-function counterpart. userFunc can be a string or a function.
Lua
return values
Similar to the C-function counterpart
Python
synopsis