mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 05:33:54 +01:00
923 B
923 B
NS.kill() method
Terminate another script.
Signature:
kill(scriptPid: number): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
scriptPid | number | PID of the script to kill |
Returns:
boolean
True if the script is successfully killed, and false otherwise.
Remarks
RAM cost: 0.5 GB
Kills the script with the specified PID. Killing a script by its PID will typically have better performance, especially if you have many scripts running. If this function successfully kills the specified script, then it will return true. Otherwise, it will return false.
Example
if (kill(10)) {
print("Killed script with PID 10!");
}