2022-10-21 17:16:00 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home ](./index.md ) > [bitburner ](./bitburner.md ) > [NS ](./bitburner.ns.md ) > [isRunning ](./bitburner.ns.isrunning.md )
## NS.isRunning() method
Check if a script is running.
2023-02-11 19:18:50 +01:00
**Signature:**
2022-10-21 17:16:00 +02:00
```typescript
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| script | [FilenameOrPID ](./bitburner.filenameorpid.md ) | Filename or PID of script to check. This is case-sensitive. |
2023-02-11 19:18:50 +01:00
| host | string | _(Optional)_ Hostname of target server. |
2022-10-21 17:16:00 +02:00
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify which scripts to search for. |
2023-02-11 19:18:50 +01:00
**Returns:**
2022-10-21 17:16:00 +02:00
boolean
2022-11-20 18:07:22 +01:00
True if the specified script is running on the target server, and false otherwise.
2022-10-21 17:16:00 +02:00
## Remarks
RAM cost: 0.1 GB
Returns a boolean indicating whether the specified script is running on the target server. If you use a PID instead of a filename, the hostname and args parameters are unnecessary. Remember that a script is uniquely identified by both its name and its arguments.
2023-02-14 07:32:01 +01:00
## Example
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
```js
//The function call will return true if there is a script named foo.js with no arguments running on the foodnstuff server, and false otherwise:
ns.isRunning("foo.js", "foodnstuff");
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
//The function call will return true if there is a script named foo.js with no arguments running on the current server, and false otherwise:
ns.isRunning("foo.js", ns.getHostname());
2022-10-21 17:16:00 +02:00
2023-02-14 07:32:01 +01:00
//The function call will return true if there is a script named foo.js running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:
ns.isRunning("foo.js", "joesguns", 1, 5, "test");
2022-10-21 17:16:00 +02:00
```