MyChat Scripts Engine: SetScriptTimeOut, set the maximum time for script execution
Function to set a maximum time for the script execution. If the script execution time is exceeded, the server stops it immediately.
Usage of this function can be useful if your script does not fit the default limit in 5 seconds.
After the finish of the script work, the default time limit restores automatically to the initial value (5 000 milliseconds).
Syntax
procedure SetScriptTimeOut(iMaxTime: integer);
Parameters and return values
Parameter |
Type |
Value |
iMaxTime |
integer |
new limit of the script execution time in milliseconds. |
Example
begin
// this function should be called at the very beginning of the script code
SetScriptTimeOut(10000); // set the maximum time of the script execution — 10 seconds
end.