Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

StopScript

Sends a request to stop a specific running script by its index.

ScriptIndex — zero-based index of the script in the scripts pool.

The stop is performed asynchronously via the character event queue.

Use GetScriptsCount (Python: GetScriptCount) and GetScriptsList to find the index of the target script.

Отправляет запрос на остановку конкретного скрипта по его индексу.

ScriptIndex — индекс скрипта (с нуля) в пуле скриптов.

Остановка выполняется асинхронно через очередь событий персонажа.

Используйте GetScriptsCount (Python: GetScriptCount) и GetScriptsList для определения индекса целевого скрипта.

Pascal

procedure StopScript(ScriptIndex: Word);

Python

def StopScript(ScriptIndex: int) -> None: ...

Pascal Example

var
  I: Integer;
begin
  // Stop the last script in the pool
  I := GetScriptsCount - 1;
  if I > 0 then
  begin
    AddToSystemJournal('Stopping script #' + IntToStr(I));
    StopScript(I);
  end;
end.

Python Example

count = GetScriptCount()
if count > 1:
    AddToSystemJournal(f'Stopping script #{count - 1}')
    StopScript(count - 1)

See Also

StartScript, StopAllScripts, GetScriptsList