mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-24 07:02:26 +01:00
DOCS: Improved documentation for functions that take a FilenameOrPID (#759)
This commit is contained in:
parent
ad9bde40e0
commit
b7fdcdf35d
@ -31,8 +31,6 @@ RAM cost: 0.1 GB
|
|||||||
|
|
||||||
Returns a boolean indicating whether the specified file exists on the target server. The filename for programs is case insensitive, other file types are case sensitive. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.
|
Returns a boolean indicating whether the specified file exists on the target server. The filename for programs is case insensitive, other file types are case sensitive. For example, fileExists(“brutessh.exe”) will work fine, even though the actual program is named 'BruteSSH.exe'.
|
||||||
|
|
||||||
\*
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ getRunningScript(
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of the script. |
|
| filename | [FilenameOrPID](./bitburner.filenameorpid.md) | _(Optional)_ Optional. Filename or PID of the script. |
|
||||||
| hostname | string | _(Optional)_ Optional. Name of host server the script is running on. |
|
| hostname | string | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
||||||
| args | (string \| number \| boolean)\[\] | Arguments to identify the script |
|
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
@ -34,5 +34,5 @@ The info about the running script if found, and null otherwise.
|
|||||||
|
|
||||||
RAM cost: 0.3 GB
|
RAM cost: 0.3 GB
|
||||||
|
|
||||||
Running with no args returns current script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary.
|
Running with no args returns current script. If you use a PID as the first parameter, the hostname and args parameters are unnecessary. If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on. Remember that a script is semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | bool
|
|||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| script | [FilenameOrPID](./bitburner.filenameorpid.md) | Filename or PID of script to check. This is case-sensitive. |
|
| script | [FilenameOrPID](./bitburner.filenameorpid.md) | Filename or PID of script to check. This is case-sensitive. |
|
||||||
| host | string | _(Optional)_ Hostname of target server. |
|
| host | string | _(Optional)_ Hostname of target server. Optional, defaults to the server the calling script is running on. |
|
||||||
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify which scripts to search for. |
|
| args | (string \| number \| boolean)\[\] | Arguments to specify/identify the script. Optional, when looking for scripts run without arguments. |
|
||||||
|
|
||||||
**Returns:**
|
**Returns:**
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ True if the specified script is running on the target server, and false otherwis
|
|||||||
|
|
||||||
RAM cost: 0.1 GB
|
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 semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
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. If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on. Remember that a script is semi-uniquely identified by both its name and its arguments. (You can run multiple copies of scripts with the same arguments, but for the purposes of functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
15
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -5830,7 +5830,7 @@ export interface NS {
|
|||||||
* For example, fileExists(“brutessh.exe”) will work fine, even though the actual program
|
* For example, fileExists(“brutessh.exe”) will work fine, even though the actual program
|
||||||
* is named 'BruteSSH.exe'.
|
* is named 'BruteSSH.exe'.
|
||||||
*
|
*
|
||||||
* * @example
|
* @example
|
||||||
* ```js
|
* ```js
|
||||||
* // The function call will return true if the script named foo.js exists on the foodnstuff server, and false otherwise.
|
* // The function call will return true if the script named foo.js exists on the foodnstuff server, and false otherwise.
|
||||||
* ns.fileExists("foo.js", "foodnstuff");
|
* ns.fileExists("foo.js", "foodnstuff");
|
||||||
@ -5851,6 +5851,7 @@ export interface NS {
|
|||||||
*
|
*
|
||||||
* Returns a boolean indicating whether the specified script is running on the target server.
|
* 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.
|
* If you use a PID instead of a filename, the hostname and args parameters are unnecessary.
|
||||||
|
* If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on.
|
||||||
* Remember that a script is semi-uniquely identified by both its name and its arguments.
|
* Remember that a script is semi-uniquely identified by both its name and its arguments.
|
||||||
* (You can run multiple copies of scripts with the same arguments, but for the purposes of
|
* (You can run multiple copies of scripts with the same arguments, but for the purposes of
|
||||||
* functions like this that check based on filename, the filename plus arguments forms the key.)
|
* functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||||
@ -5867,8 +5868,8 @@ export interface NS {
|
|||||||
* ns.isRunning("foo.js", "joesguns", 1, 5, "test");
|
* ns.isRunning("foo.js", "joesguns", 1, 5, "test");
|
||||||
* ```
|
* ```
|
||||||
* @param script - Filename or PID of script to check. This is case-sensitive.
|
* @param script - Filename or PID of script to check. This is case-sensitive.
|
||||||
* @param host - Hostname of target server.
|
* @param host - Hostname of target server. Optional, defaults to the server the calling script is running on.
|
||||||
* @param args - Arguments to specify/identify which scripts to search for.
|
* @param args - Arguments to specify/identify the script. Optional, when looking for scripts run without arguments.
|
||||||
* @returns True if the specified script is running on the target server, and false otherwise.
|
* @returns True if the specified script is running on the target server, and false otherwise.
|
||||||
*/
|
*/
|
||||||
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
|
isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;
|
||||||
@ -5880,10 +5881,14 @@ export interface NS {
|
|||||||
*
|
*
|
||||||
* Running with no args returns current script.
|
* Running with no args returns current script.
|
||||||
* If you use a PID as the first parameter, the hostname and args parameters are unnecessary.
|
* If you use a PID as the first parameter, the hostname and args parameters are unnecessary.
|
||||||
|
* If hostname is omitted while filename is used as the first parameter, hostname defaults to the server the calling script is running on.
|
||||||
|
* Remember that a script is semi-uniquely identified by both its name and its arguments.
|
||||||
|
* (You can run multiple copies of scripts with the same arguments, but for the purposes of
|
||||||
|
* functions like this that check based on filename, the filename plus arguments forms the key.)
|
||||||
*
|
*
|
||||||
* @param filename - Optional. Filename or PID of the script.
|
* @param filename - Optional. Filename or PID of the script.
|
||||||
* @param hostname - Optional. Name of host server the script is running on.
|
* @param hostname - Hostname of target server. Optional, defaults to the server the calling script is running on.
|
||||||
* @param args - Arguments to identify the script
|
* @param args - Arguments to specify/identify the script. Optional, when looking for scripts run without arguments.
|
||||||
* @returns The info about the running script if found, and null otherwise.
|
* @returns The info about the running script if found, and null otherwise.
|
||||||
*/
|
*/
|
||||||
getRunningScript(
|
getRunningScript(
|
||||||
|
Loading…
Reference in New Issue
Block a user