bitburner-src/markdown/bitburner.ns.ps.md
Olivier Gagnon feb0430aff work on doc
2021-10-30 15:46:34 -04:00

1.0 KiB
Raw Blame History

Home > bitburner > NS > ps

NS.ps() method

Returns an array with general information about all scripts running on the specified target server.

Signature:

ps(host?: string): ProcessInfo[];

Parameters

Parameter Type Description
host string Host or IP address of the target server. If not specified, it will be the current servers IP by default.

Returns:

ProcessInfo[]

Array with general information about all scripts running on the specified target server.

Remarks

RAM cost: 0.2 GB

Example

//(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);
   }
}