Merge pull request #1895 from TheCoderJT/editingGitDocs

Editing git docs
This commit is contained in:
hydroflame 2021-12-16 12:11:05 -05:00 committed by GitHub
commit 2da9f87031
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 199 additions and 156 deletions

32
dist/bitburner.d.ts vendored

@ -2124,6 +2124,27 @@ export declare interface NodeStats {
/** /**
* Collection of all functions passed to scripts * Collection of all functions passed to scripts
* @public * @public
* @remarks
* <b>Basic ns1 usage example:</b>
* ```ts
* // Basic ns functions can be used directly
* methodName();
* // Some related functions are gathered within a common namespace
* property.methodName();
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}
* <hr>
* <b>Basic ns2 usage example:</b>
* ```ts
* export async function main(ns) {
* // Basic ns functions can be accessed on the ns object
* await ns.methodName;
* // Some related functions are gathered under a sub-property of the ns object
* await ns.property.methodName;
* }
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
* <hr>
*/ */
export declare interface NS extends Singularity { export declare interface NS extends Singularity {
/** /**
@ -2321,9 +2342,9 @@ export declare interface NS extends Singularity {
* *
* @example * @example
* ```ts * ```ts
* //For example, assume the following returns 1: * //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% 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% of 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.
@ -3259,13 +3280,12 @@ export declare interface NS extends Singularity {
deleteServer(host: string): boolean; deleteServer(host: string): boolean;
/** /**
* Returns an array with either the hostnames or IPs of all of the servers you have purchased. * Returns an array with the hostnames of all of the servers you have purchased.
* *
* @remarks 2.25 GB * @remarks 2.25 GB
* @param hostnameMode - Optional. Defaults to true. Returns hostnames if true, and IPs if false. * @returns Returns an array with the hostnames of all of the servers you have purchased.
* @returns Returns an array with either the hostnames or IPs of all of the servers you have purchased.
*/ */
getPurchasedServers(hostnameMode?: boolean): string[]; getPurchasedServers(): string[];
/** /**
* Returns the maximum number of servers you can purchase. * Returns the maximum number of servers you can purchase.

@ -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 * @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 * 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",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
@ -15562,19 +15562,11 @@
{ {
"kind": "MethodSignature", "kind": "MethodSignature",
"canonicalReference": "bitburner!NS#getPurchasedServers:member(1)", "canonicalReference": "bitburner!NS#getPurchasedServers:member(1)",
"docComment": "/**\n * Returns an array with either the hostnames or IPs of all of the servers you have purchased.\n *\n * @remarks\n *\n * 2.25 GB\n *\n * @param hostnameMode - Optional. Defaults to true. Returns hostnames if true, and IPs if false.\n *\n * @returns Returns an array with either the hostnames or IPs of all of the servers you have purchased.\n */\n", "docComment": "/**\n * Returns an array with the hostnames of all of the servers you have purchased.\n *\n * @remarks\n *\n * 2.25 GB\n *\n * @returns Returns an array with the hostnames of all of the servers you have purchased.\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",
"text": "getPurchasedServers(hostnameMode?: " "text": "getPurchasedServers(): "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": "): "
}, },
{ {
"kind": "Content", "kind": "Content",
@ -15587,20 +15579,12 @@
], ],
"isOptional": false, "isOptional": false,
"returnTypeTokenRange": { "returnTypeTokenRange": {
"startIndex": 3, "startIndex": 1,
"endIndex": 4 "endIndex": 2
}, },
"releaseTag": "Public", "releaseTag": "Public",
"overloadIndex": 1, "overloadIndex": 1,
"parameters": [ "parameters": [],
{
"parameterName": "hostnameMode",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"name": "getPurchasedServers" "name": "getPurchasedServers"
}, },
{ {
@ -16839,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 1:\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% 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% of its total money.\n * ```\n *\n */\n",
"excerptTokens": [ "excerptTokens": [
{ {
"kind": "Content", "kind": "Content",

@ -4,25 +4,18 @@
## NS.getPurchasedServers() method ## NS.getPurchasedServers() method
Returns an array with either the hostnames or IPs of all of the servers you have purchased. Returns an array with the hostnames of all of the servers you have purchased.
<b>Signature:</b> <b>Signature:</b>
```typescript ```typescript
getPurchasedServers(hostnameMode?: boolean): string[]; getPurchasedServers(): string[];
``` ```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| hostnameMode | boolean | Optional. Defaults to true. Returns hostnames if true, and IPs if false. |
<b>Returns:</b> <b>Returns:</b>
string\[\] string\[\]
Returns an array with either the hostnames or IPs of all of the servers you have purchased. Returns an array with the hostnames of all of the servers you have purchased.
## Remarks ## Remarks

@ -22,7 +22,7 @@ getWeakenTime(host: string): number;
number number
Returns the amount of time in milliseconds it takes to execute the weaken Netscript function. Returns Infinity if called on a Hacknet Server. Returns the amount of time in milliseconds it takes to execute the grow Netscript function. Returns Infinity if called on a Hacknet Server.
## Remarks ## Remarks

@ -34,8 +34,8 @@ Returns the percentage of the specified servers money you will steal with a s
```ts ```ts
//For example, assume the following returns 1: //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% 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% of its total money.
``` ```

@ -11,12 +11,37 @@ 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
<b>Basic ns1 usage example:</b>
```ts
// Basic ns functions can be used directly
methodName();
// Some related functions are gathered within a common namespace
property.methodName();
```
[ns1 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html) <hr> <b>Basic ns2 usage example:</b>
```ts
export async function main(ns) {
// Basic ns functions can be accessed on the ns object
await ns.methodName;
// Some related functions are gathered under a sub-property of the ns object
await ns.property.methodName;
}
```
[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. |
@ -31,7 +56,7 @@ export interface NS extends Singularity
## 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 |
@ -61,7 +86,7 @@ export interface NS extends Singularity
| [getPurchasedServerCost(ram)](./bitburner.ns.getpurchasedservercost.md) | Get cost of purchasing a server. | | [getPurchasedServerCost(ram)](./bitburner.ns.getpurchasedservercost.md) | Get cost of purchasing a server. |
| [getPurchasedServerLimit()](./bitburner.ns.getpurchasedserverlimit.md) | Returns the maximum number of servers you can purchase. | | [getPurchasedServerLimit()](./bitburner.ns.getpurchasedserverlimit.md) | Returns the maximum number of servers you can purchase. |
| [getPurchasedServerMaxRam()](./bitburner.ns.getpurchasedservermaxram.md) | Returns the maximum RAM that a purchased server can have. | | [getPurchasedServerMaxRam()](./bitburner.ns.getpurchasedservermaxram.md) | Returns the maximum RAM that a purchased server can have. |
| [getPurchasedServers(hostnameMode)](./bitburner.ns.getpurchasedservers.md) | Returns an array with either the hostnames or IPs of all of the servers you have purchased. | | [getPurchasedServers()](./bitburner.ns.getpurchasedservers.md) | Returns an array with the hostnames of all of the servers you have purchased. |
| [getRunningScript(filename, hostname, args)](./bitburner.ns.getrunningscript.md) | Get general info about a running script. | | [getRunningScript(filename, hostname, args)](./bitburner.ns.getrunningscript.md) | Get general info about a running script. |
| [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain.md) | Get the exp gain of a script. | | [getScriptExpGain(script, host, args)](./bitburner.ns.getscriptexpgain.md) | Get the exp gain of a script. |
| [getScriptIncome(script, host, args)](./bitburner.ns.getscriptincome.md) | Get the income of a script. | | [getScriptIncome(script, host, args)](./bitburner.ns.getscriptincome.md) | Get the income of a script. |
@ -130,4 +155,3 @@ export interface NS extends Singularity
| [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. |

1
package-lock.json generated

@ -5,6 +5,7 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bitburner",
"version": "1.1.0", "version": "1.1.0",
"hasInstallScript": true, "hasInstallScript": true,
"license": "SEE LICENSE IN license.txt", "license": "SEE LICENSE IN license.txt",

@ -3726,6 +3726,27 @@ interface Stanek {
/** /**
* Collection of all functions passed to scripts * Collection of all functions passed to scripts
* @public * @public
* @remarks
* <b>Basic ns1 usage example:</b>
* ```ts
* // Basic ns functions can be used directly
* methodName();
* // Some related functions are gathered within a common namespace
* property.methodName();
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}
* <hr>
* <b>Basic ns2 usage example:</b>
* ```ts
* export async function main(ns) {
* // Basic ns functions can be accessed on the ns object
* await ns.methodName;
* // Some related functions are gathered under a sub-property of the ns object
* await ns.property.methodName;
* }
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
* <hr>
*/ */
export interface NS extends Singularity { export interface NS extends Singularity {
/** /**