mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
MISC: Make spawn able to have 0 delay (#1333)
This eliminates a hole where spawn was unrelaible, because other scripts could jump in and steal the RAM. It's not an API break, because 0 used to be an invalid value.
This commit is contained in:
8
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
8
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@@ -283,7 +283,10 @@ interface RunOptions {
|
||||
|
||||
/** @public */
|
||||
interface SpawnOptions extends RunOptions {
|
||||
/** Number of milliseconds to delay before spawning script, defaults to 10000 (10s). Must be a positive integer. */
|
||||
/**
|
||||
* Number of milliseconds to delay before spawning script, defaults to 10000 (10s).
|
||||
* Must be a non-negative integer. If 0, the script will be spawned synchronously.
|
||||
*/
|
||||
spawnDelay?: number;
|
||||
}
|
||||
|
||||
@@ -6261,6 +6264,9 @@ export interface NS {
|
||||
* constrained by the RAM usage of the current one. This function can only be used to run scripts
|
||||
* on the local server.
|
||||
*
|
||||
* The delay specified can be 0; in this case the new script will synchronously replace
|
||||
* the old one. (There will not be any opportunity for other scripts to use up the RAM in-between.)
|
||||
*
|
||||
* Because this function immediately terminates the script, it does not have a return value.
|
||||
*
|
||||
* Running this function with 0 or fewer threads will cause a runtime error.
|
||||
|
||||
Reference in New Issue
Block a user