bitburner-src/markdown/bitburner.ns.ps.md
Olivier Gagnon 43fc5dfd48 work on doc
2021-10-30 12:34:14 -04:00

45 lines
1.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 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; [ps](./bitburner.ns.ps.md)
## NS.ps() method
Returns an array with general information about all scripts running on the specified target server.
<b>Signature:</b>
```typescript
ps(host?: Host): ProcessInfo[];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| host | [Host](./bitburner.host.md) | Host or IP address of the target server. If not specified, it will be the current servers IP by default. |
<b>Returns:</b>
[ProcessInfo](./bitburner.processinfo.md)<!-- -->\[\]
Array with general information about all scripts running on the specified target server.
## Remarks
0.2 GB
## Example
```js
//(using NetscriptJS (Netscript 2.0))
export async function main(ns) {
const ps = ns.ps("home");
for (let i = 0; i < ps.length; ++i) {
ns.tprint(ps[i].filename + ' ' + ps[i].threads);
ns.tprint(ps[i].args);
}
}
```