Merge pull request #1950 from danielyxie/dev

regen doc
This commit is contained in:
hydroflame 2021-12-16 12:59:52 -05:00 committed by GitHub
commit c080f367b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 286 additions and 142 deletions

35
dist/bitburner.d.ts vendored

@ -808,9 +808,9 @@ export declare interface CodingContract {
* *
* @param filename - Filename of the contract. * @param filename - Filename of the contract.
* @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided. * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.
* @returns The specified contracts data; * @returns The specified contracts data, data type depends on contract type.;
*/ */
getData(filename: string, host?: string): string; getData(filename: string, host?: string): any;
/** /**
* Get the number of attempt remaining. * Get the number of attempt remaining.
@ -2128,9 +2128,9 @@ export declare interface NodeStats {
* <b>Basic ns1 usage example:</b> * <b>Basic ns1 usage example:</b>
* ```ts * ```ts
* // Basic ns functions can be used directly * // Basic ns functions can be used directly
* methodName(); * getHostname();
* // Some related functions are gathered within a common namespace * // Some related functions are gathered within a common namespace
* property.methodName(); * stock.getPrice();
* ``` * ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs} * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}
* <hr> * <hr>
@ -2138,9 +2138,9 @@ export declare interface NodeStats {
* ```ts * ```ts
* export async function main(ns) { * export async function main(ns) {
* // Basic ns functions can be accessed on the ns object * // Basic ns functions can be accessed on the ns object
* await ns.methodName; * await ns.getHostname();
* // Some related functions are gathered under a sub-property of the ns object * // Some related functions are gathered under a sub-property of the ns object
* await ns.property.methodName; * await ns.stock.getPrice();
* } * }
* ``` * ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs} * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
@ -2344,7 +2344,7 @@ export declare interface NS extends Singularity {
* ```ts * ```ts
* //For example, assume the following returns 0.01: * //For example, assume the following returns 0.01:
* hackAnalyze("foodnstuff"); * hackAnalyze("foodnstuff");
* //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01% of its total money. * //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.
* ``` * ```
* @param host - Hostname of the target server. * @param host - Hostname of the target server.
* @returns The percentage of money you will steal from the target server with a single hack. * @returns The percentage of money you will steal from the target server with a single hack.
@ -3022,7 +3022,7 @@ export declare interface NS extends Singularity {
* RAM cost: 0.1 GB * RAM cost: 0.1 GB
* *
* Returns the servers instrinsic growth parameter. This growth * Returns the servers instrinsic growth parameter. This growth
* parameter is a number between 1 and 100 that represents how * parameter is a number between 0 and 100 that represents how
* quickly the servers money grows. This parameter affects the * quickly the servers money grows. This parameter affects the
* percentage by which the servers money is increased when using the * percentage by which the servers money is increased when using the
* grow function. A higher growth parameter will result in a * grow function. A higher growth parameter will result in a
@ -4866,6 +4866,25 @@ export declare interface Singularity {
* @returns True if the installation was successful. * @returns True if the installation was successful.
*/ */
installBackdoor(): Promise<void>; installBackdoor(): Promise<void>;
/**
* SF4.2 - Check if the player is focused.
* @remarks
* RAM cost: 0.1 GB
*
*
* @returns True if the player is focused.
*/
isFocused(): boolean;
/**
* SF4.2 - Set the players focus.
* @remarks
* RAM cost: 0.1 GB
*
* @returns True if the focus was changed.
*/
setFocus(focus: boolean): boolean;
} }
/** /**

@ -4998,7 +4998,7 @@
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!CodingContract#getData:member(1)", "canonicalReference": "bitburner!CodingContract#getData:member(1)",
"docComment": "/**\n * Get the input data.\n *\n * @remarks\n *\n * RAM cost: 5 GB\n *\n * Get the data associated with the specific Coding Contract. Note that this is not the same as the contracts description. This is just the data that the contract wants you to act on in order to solve\n *\n * @param filename - Filename of the contract.\n *\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\n *\n * @returns The specified contracts data;\n */\n", "docComment": "/**\n * Get the input data.\n *\n * @remarks\n *\n * RAM cost: 5 GB\n *\n * Get the data associated with the specific Coding Contract. Note that this is not the same as the contracts description. This is just the data that the contract wants you to act on in order to solve\n *\n * @param filename - Filename of the contract.\n *\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\n *\n * @returns The specified contracts data, data type depends on contract type.;\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
@ -5022,7 +5022,7 @@
}, },
{ {
"kind": "Content", "kind": "Content",
"text": "string" "text": "any"
}, },
{ {
"kind": "Content", "kind": "Content",
@ -14221,7 +14221,7 @@
{ {
"kind": "Interface", "kind": "Interface",
"canonicalReference": "bitburner!NS:interface", "canonicalReference": "bitburner!NS:interface",
"docComment": "/**\n * Collection of all functions passed to scripts\n *\n * @remarks\n *\n * <b>Basic ns1 usage example:</b>\n * ```ts\n * // Basic ns functions can be used directly\n * methodName();\n * // Some related functions are gathered within a common namespace\n * property.methodName();\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html | ns1 in-game docs} <hr> <b>Basic ns2 usage example:</b>\n * ```ts\n * export async function main(ns) {\n * // Basic ns functions can be accessed on the ns object\n * await ns.methodName;\n * // Some related functions are gathered under a sub-property of the ns object\n * await ns.property.methodName;\n * }\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html | ns2 in-game docs} <hr>\n *\n * @public\n */\n", "docComment": "/**\n * Collection of all functions passed to scripts\n *\n * @remarks\n *\n * <b>Basic ns1 usage example:</b>\n * ```ts\n * // Basic ns functions can be used directly\n * getHostname();\n * // Some related functions are gathered within a common namespace\n * stock.getPrice();\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html | ns1 in-game docs} <hr> <b>Basic ns2 usage example:</b>\n * ```ts\n * export async function main(ns) {\n * // Basic ns functions can be accessed on the ns object\n * await ns.getHostname();\n * // Some related functions are gathered under a sub-property of the ns object\n * await ns.stock.getPrice();\n * }\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html | ns2 in-game docs} <hr>\n *\n * @public\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
@ -16063,7 +16063,7 @@
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!NS#getServerGrowth:member(1)", "canonicalReference": "bitburner!NS#getServerGrowth:member(1)",
"docComment": "/**\n * Get a server growth parameter.\n *\n * @remarks\n *\n * RAM cost: 0.1 GB\n *\n * Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 1 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow.\n *\n * @param host - Host of target server.\n *\n * @returns Parameter that affects the percentage by which the servers money is increased when using the grow function.\n */\n", "docComment": "/**\n * Get a server growth parameter.\n *\n * @remarks\n *\n * RAM cost: 0.1 GB\n *\n * Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 0 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow.\n *\n * @param host - Host of target server.\n *\n * @returns Parameter that affects the percentage by which the servers money is increased when using the grow function.\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
@ -16823,7 +16823,7 @@
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!NS#hackAnalyze:member(1)", "canonicalReference": "bitburner!NS#hackAnalyze:member(1)",
"docComment": "/**\n * Get the percent of money stolen with a single thread.\n *\n * @remarks\n *\n * RAM cost: 1 GB\n *\n * Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one).\n *\n * @param host - Hostname of the target server.\n *\n * @returns The percentage of money you will steal from the target server with a single hack.\n *\n * @example\n * ```ts\n * //For example, assume the following returns 0.01:\n * hackAnalyze(\"foodnstuff\");\n * //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01% of its total money.\n * ```\n *\n */\n", "docComment": "/**\n * Get the percent of money stolen with a single thread.\n *\n * @remarks\n *\n * RAM cost: 1 GB\n *\n * Returns the percentage of the specified servers money you will steal with a single hack. This value is returned in percentage form, not decimal (Netscript functions typically return in decimal form, but not this one).\n *\n * @param host - Hostname of the target server.\n *\n * @returns The percentage of money you will steal from the target server with a single hack.\n *\n * @example\n * ```ts\n * //For example, assume the following returns 0.01:\n * hackAnalyze(\"foodnstuff\");\n * //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\n * ```\n *\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
@ -25308,6 +25308,34 @@
"parameters": [], "parameters": [],
"name": "isBusy" "name": "isBusy"
}, },
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!Singularity#isFocused:member(1)",
"docComment": "/**\n * SF4.2 - Check if the player is focused.\n *\n * @remarks\n *\n * RAM cost: 0.1 GB\n *\n * @returns True if the player is focused.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "isFocused(): "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"returnTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [],
"name": "isFocused"
},
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!Singularity#joinFaction:member(1)", "canonicalReference": "bitburner!Singularity#joinFaction:member(1)",
@ -25516,6 +25544,50 @@
"parameters": [], "parameters": [],
"name": "purchaseTor" "name": "purchaseTor"
}, },
{
"kind": "MethodSignature",
"canonicalReference": "bitburner!Singularity#setFocus:member(1)",
"docComment": "/**\n * SF4.2 - Set the players focus.\n *\n * @remarks\n *\n * RAM cost: 0.1 GB\n *\n * @returns True if the focus was changed.\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "setFocus(focus: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": "): "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "focus",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "setFocus"
},
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!Singularity#softReset:member(1)", "canonicalReference": "bitburner!Singularity#softReset:member(1)",

@ -9,7 +9,7 @@ Get the input data.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
getData(filename: string, host?: string): string; getData(filename: string, host?: string): any;
``` ```
## Parameters ## Parameters
@ -21,9 +21,9 @@ getData(filename: string, host?: string): string;
<b>Returns:</b> <b>Returns:</b>
string any
The specified contracts data; The specified contracts data, data type depends on contract type.;
## Remarks ## Remarks

@ -28,5 +28,5 @@ Parameter that affects the percentage by which the servers money is increased
RAM cost: 0.1 GB RAM cost: 0.1 GB
Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 1 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow. Returns the servers instrinsic “growth parameter”. This growth parameter is a number between 0 and 100 that represents how quickly the servers money grows. This parameter affects the percentage by which the servers money is increased when using the grow function. A higher growth parameter will result in a higher percentage increase from grow.

@ -36,6 +36,6 @@ Returns the percentage of the specified servers money you will steal with a s
```ts ```ts
//For example, assume the following returns 0.01: //For example, assume the following returns 0.01:
hackAnalyze("foodnstuff"); hackAnalyze("foodnstuff");
//This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01% of its total money. //This means that if hack the foodnstuff server, then you will steal 1% of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.
``` ```

@ -11,7 +11,6 @@ Collection of all functions passed to scripts
```typescript ```typescript
export interface NS extends Singularity export interface NS extends Singularity
``` ```
<b>Extends:</b> [Singularity](./bitburner.singularity.md) <b>Extends:</b> [Singularity](./bitburner.singularity.md)
## Remarks ## Remarks
@ -20,28 +19,26 @@ export interface NS extends Singularity
```ts ```ts
// Basic ns functions can be used directly // Basic ns functions can be used directly
methodName(); getHostname();
// Some related functions are gathered within a common namespace // Some related functions are gathered within a common namespace
property.methodName(); stock.getPrice();
``` ```
[ns1 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html) <hr> <b>Basic ns2 usage example:</b> [ns1 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html) <hr> <b>Basic ns2 usage example:</b>
```ts ```ts
export async function main(ns) { export async function main(ns) {
// Basic ns functions can be accessed on the ns object // Basic ns functions can be accessed on the ns object
await ns.methodName; await ns.getHostname();
// Some related functions are gathered under a sub-property of the ns object // Some related functions are gathered under a sub-property of the ns object
await ns.property.methodName; await ns.stock.getPrice();
} }
``` ```
[ns2 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html) <hr> [ns2 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html) <hr>
## Properties ## Properties
| Property | Type | Description | | Property | Type | Description |
| -------------------------------------------------- | ----------------------------------------------- | --------------------------------------------------- | | --- | --- | --- |
| [args](./bitburner.ns.args.md) | (string \| number \| boolean)\[\] | Arguments passed into the script. | | [args](./bitburner.ns.args.md) | (string \| number \| boolean)\[\] | Arguments passed into the script. |
| [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. | | [bladeburner](./bitburner.ns.bladeburner.md) | [Bladeburner](./bitburner.bladeburner.md) | Namespace for bladeburner functions. |
| [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. | | [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
@ -56,7 +53,7 @@ export async function main(ns) {
## Methods ## Methods
| Method | Description | | Method | Description |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | --- | --- |
| [alert(msg)](./bitburner.ns.alert.md) | Open up a message box. | | [alert(msg)](./bitburner.ns.alert.md) | Open up a message box. |
| [asleep(millis)](./bitburner.ns.asleep.md) | Suspends the script for n milliseconds. Doesn't block with concurrent calls. | | [asleep(millis)](./bitburner.ns.asleep.md) | Suspends the script for n milliseconds. Doesn't block with concurrent calls. |
| [atExit(f)](./bitburner.ns.atexit.md) | Add callback function when the script dies | | [atExit(f)](./bitburner.ns.atexit.md) | Add callback function when the script dies |
@ -155,3 +152,4 @@ export async function main(ns) {
| [wget(url, target, host)](./bitburner.ns.wget.md) | Download a file from the internet. | | [wget(url, target, host)](./bitburner.ns.wget.md) | Download a file from the internet. |
| [write(handle, data, mode)](./bitburner.ns.write.md) | Write data to a file. | | [write(handle, data, mode)](./bitburner.ns.write.md) | Write data to a file. |
| [writePort(port, data)](./bitburner.ns.writeport.md) | Write data to a port. | | [writePort(port, data)](./bitburner.ns.writeport.md) | Write data to a port. |

@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [isFocused](./bitburner.singularity.isfocused.md)
## Singularity.isFocused() method
SF4.2 - Check if the player is focused.
<b>Signature:</b>
```typescript
isFocused(): boolean;
```
<b>Returns:</b>
boolean
True if the player is focused.
## Remarks
RAM cost: 0.1 GB

@ -52,11 +52,13 @@ This API requires Source-File 4 level 1 / 2 / 3 to use.
| [installAugmentations(cbScript)](./bitburner.singularity.installaugmentations.md) | SF4.3 - Install your purchased augmentations. | | [installAugmentations(cbScript)](./bitburner.singularity.installaugmentations.md) | SF4.3 - Install your purchased augmentations. |
| [installBackdoor()](./bitburner.singularity.installbackdoor.md) | SF4.1 - Run the backdoor command in the terminal. | | [installBackdoor()](./bitburner.singularity.installbackdoor.md) | SF4.1 - Run the backdoor command in the terminal. |
| [isBusy()](./bitburner.singularity.isbusy.md) | SF4.1 - Check if the player is busy. | | [isBusy()](./bitburner.singularity.isbusy.md) | SF4.1 - Check if the player is busy. |
| [isFocused()](./bitburner.singularity.isfocused.md) | SF4.2 - Check if the player is focused. |
| [joinFaction(faction)](./bitburner.singularity.joinfaction.md) | SF4.2 - Join a faction. | | [joinFaction(faction)](./bitburner.singularity.joinfaction.md) | SF4.2 - Join a faction. |
| [manualHack()](./bitburner.singularity.manualhack.md) | SF4.1 - Run the hack command in the terminal. | | [manualHack()](./bitburner.singularity.manualhack.md) | SF4.1 - Run the hack command in the terminal. |
| [purchaseAugmentation(faction, augmentation)](./bitburner.singularity.purchaseaugmentation.md) | SF4.3 - Purchase an augmentation | | [purchaseAugmentation(faction, augmentation)](./bitburner.singularity.purchaseaugmentation.md) | SF4.3 - Purchase an augmentation |
| [purchaseProgram(programName)](./bitburner.singularity.purchaseprogram.md) | SF4.1 - Purchase a program from the dark web. | | [purchaseProgram(programName)](./bitburner.singularity.purchaseprogram.md) | SF4.1 - Purchase a program from the dark web. |
| [purchaseTor()](./bitburner.singularity.purchasetor.md) | SF4.1 - Purchase the TOR router. | | [purchaseTor()](./bitburner.singularity.purchasetor.md) | SF4.1 - Purchase the TOR router. |
| [setFocus(focus)](./bitburner.singularity.setfocus.md) | SF4.2 - Set the players focus. |
| [softReset(cbScript)](./bitburner.singularity.softreset.md) | SF4.3 - Soft reset the game. | | [softReset(cbScript)](./bitburner.singularity.softreset.md) | SF4.3 - Soft reset the game. |
| [stopAction()](./bitburner.singularity.stopaction.md) | SF4.1 - Stop the current action. | | [stopAction()](./bitburner.singularity.stopaction.md) | SF4.1 - Stop the current action. |
| [travelToCity(city)](./bitburner.singularity.traveltocity.md) | SF4.1 - Travel to another city. | | [travelToCity(city)](./bitburner.singularity.traveltocity.md) | SF4.1 - Travel to another city. |

@ -0,0 +1,30 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [setFocus](./bitburner.singularity.setfocus.md)
## Singularity.setFocus() method
SF4.2 - Set the players focus.
<b>Signature:</b>
```typescript
setFocus(focus: boolean): boolean;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| focus | boolean | |
<b>Returns:</b>
boolean
True if the focus was changed.
## Remarks
RAM cost: 0.1 GB