mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 22:52:29 +01:00
DOC: Fix outdated example for ns.spawn() (#1101)
This commit is contained in:
parent
ef334cb851
commit
22aec2a8b9
@ -17,7 +17,7 @@ spawn(script: string, threadOrOptions?: number | SpawnOptions, ...args: (string
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | string | Filename of script to execute. |
|
| script | string | Filename of script to execute. |
|
||||||
| threadOrOptions | number \| [SpawnOptions](./bitburner.spawnoptions.md) | _(Optional)_ Either an integer number of threads for new script, or a [SpawnOptions](./bitburner.spawnoptions.md) object. Threads defaults to 1. |
|
| threadOrOptions | number \| [SpawnOptions](./bitburner.spawnoptions.md) | _(Optional)_ Either an integer number of threads for new script, or a [SpawnOptions](./bitburner.spawnoptions.md) object. Threads defaults to 1 and spawnDelay defaults to 10,000 ms. |
|
||||||
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. |
|
| args | (string \| number \| boolean)\[\] | Additional arguments to pass into the new script that is being run. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
@ -39,6 +39,6 @@ Running this function with 0 or fewer threads will cause a runtime error.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
//The following example will execute the script ‘foo.js’ with 10 threads, in 500 milliseconds and the arguments ‘foodnstuff’ and 90:
|
//The following example will execute the script ‘foo.js’ with 10 threads, in 500 milliseconds and the arguments ‘foodnstuff’ and 90:
|
||||||
ns.spawn('foo.js', 10, 500, 'foodnstuff', 90);
|
ns.spawn('foo.js', {threads: 10, spawnDelay: 500}, 'foodnstuff', 90);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
4
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -6054,10 +6054,10 @@ export interface NS {
|
|||||||
* @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* //The following example will execute the script ‘foo.js’ with 10 threads, in 500 milliseconds and the arguments ‘foodnstuff’ and 90:
|
* //The following example will execute the script ‘foo.js’ with 10 threads, in 500 milliseconds and the arguments ‘foodnstuff’ and 90:
|
||||||
* ns.spawn('foo.js', 10, 500, 'foodnstuff', 90);
|
* ns.spawn('foo.js', {threads: 10, spawnDelay: 500}, 'foodnstuff', 90);
|
||||||
* ```
|
* ```
|
||||||
* @param script - Filename of script to execute.
|
* @param script - Filename of script to execute.
|
||||||
* @param threadOrOptions - Either an integer number of threads for new script, or a {@link SpawnOptions} object. Threads defaults to 1.
|
* @param threadOrOptions - Either an integer number of threads for new script, or a {@link SpawnOptions} object. Threads defaults to 1 and spawnDelay defaults to 10,000 ms.
|
||||||
* @param args - Additional arguments to pass into the new script that is being run.
|
* @param args - Additional arguments to pass into the new script that is being run.
|
||||||
*/
|
*/
|
||||||
spawn(script: string, threadOrOptions?: number | SpawnOptions, ...args: (string | number | boolean)[]): void;
|
spawn(script: string, threadOrOptions?: number | SpawnOptions, ...args: (string | number | boolean)[]): void;
|
||||||
|
Loading…
Reference in New Issue
Block a user