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


int result = sim.registerScriptFuncHook(string funcToHook, string/function userFunc, bool execBefore)


  • funcToHook: function to hook
  • userFunc: user function. Can be a string or a function
  • execBefore: if true, the user function is called before the function to hook. Otherwise it is called after

Return values

  • resultresult: 1 if the hook registration was successful, or 0 if a previous hook was removed