bitburner-src/markdown/bitburner.ns.getrunningscript.md

39 lines
1.1 KiB
Markdown
Raw Normal View History

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getRunningScript](./bitburner.ns.getrunningscript.md)
## NS.getRunningScript() method
Get general info about a running script.
<b>Signature:</b>
```typescript
2022-07-16 05:47:19 +02:00
getRunningScript(
filename?: FilenameOrPID,
hostname?: string,
...args: (string | number | boolean)[]
): RunningScript | null;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2022-01-16 00:39:37 +01:00
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | Optional. Filename or PID of the script. |
| hostname | string | Optional. Name of host server the script is running on. |
2022-07-16 05:47:19 +02:00
| args | (string \| number \| boolean)\[\] | Arguments to identify the script |
<b>Returns:</b>
2022-04-13 07:35:35 +02:00
[RunningScript](./bitburner.runningscript.md) \| null
2022-03-17 21:50:46 +01:00
The info about the running script if found, and null otherwise.
## Remarks
RAM cost: 0.3 GB
2022-03-17 21:50:46 +01:00
Running with no args returns current script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary.
2022-01-08 19:25:06 +01:00