added syntax useage to github ns page

This commit is contained in:
Jordan Turner 2021-12-15 10:10:32 -07:00
parent ab24e4865e
commit 687682fcbd
8 changed files with 58 additions and 43 deletions

23
dist/bitburner.d.ts vendored

@ -2124,6 +2124,18 @@ export declare interface NodeStats {
/**
* Collection of all functions passed to scripts
* @public
* @remarks
* <b>Basic ns1 usage example:</b>
* ```
* property.methodName;
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}
* <hr>
* <b>Basic ns2 usage example:</b>
* ```
* ns.property.methodName;
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
*/
export declare interface NS extends Singularity {
/**
@ -2321,9 +2333,9 @@ export declare interface NS extends Singularity {
*
* @example
* ```ts
* //For example, assume the following returns 1:
* //For example, assume the following returns 0.01:
* 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.
* @returns The percentage of money you will steal from the target server with a single hack.
@ -3259,13 +3271,12 @@ export declare interface NS extends Singularity {
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
* @param hostnameMode - Optional. Defaults to true. Returns hostnames if true, and IPs if false.
* @returns Returns an array with either the hostnames or IPs of all of the servers you have purchased.
* @returns Returns an array with the hostnames of all of the servers you have purchased.
*/
getPurchasedServers(hostnameMode?: boolean): string[];
getPurchasedServers(): string[];
/**
* Returns the maximum number of servers you can purchase.

@ -14221,7 +14221,7 @@
{
"kind": "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 * ```\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 * ```\n * ns.property.methodName;\n * ```\n *\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html | ns2 in-game docs}\n *\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
@ -15562,19 +15562,11 @@
{
"kind": "MethodSignature",
"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": [
{
"kind": "Content",
"text": "getPurchasedServers(hostnameMode?: "
},
{
"kind": "Content",
"text": "boolean"
},
{
"kind": "Content",
"text": "): "
"text": "getPurchasedServers(): "
},
{
"kind": "Content",
@ -15587,20 +15579,12 @@
],
"isOptional": false,
"returnTypeTokenRange": {
"startIndex": 3,
"endIndex": 4
"startIndex": 1,
"endIndex": 2
},
"releaseTag": "Public",
"overloadIndex": 1,
"parameters": [
{
"parameterName": "hostnameMode",
"parameterTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"parameters": [],
"name": "getPurchasedServers"
},
{
@ -16839,7 +16823,7 @@
{
"kind": "MethodSignature",
"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": [
{
"kind": "Content",

@ -4,25 +4,18 @@
## 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>
```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>
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

@ -22,7 +22,7 @@ getWeakenTime(host: string): 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

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

@ -13,6 +13,20 @@ export interface NS extends Singularity
```
<b>Extends:</b> [Singularity](./bitburner.singularity.md)
## Remarks
<b>Basic ns1 usage example:</b>
```
property.methodName;
```
[ns1 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html) <hr> <b>Basic ns2 usage example:</b>
```
ns.property.methodName;
```
[ns2 in-game docs](https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html)
## Properties
| Property | Type | Description |
@ -61,7 +75,7 @@ export interface NS extends Singularity
| [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. |
| [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. |
| [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. |

1
package-lock.json generated

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

@ -3707,6 +3707,18 @@ interface Stanek {
/**
* Collection of all functions passed to scripts
* @public
* @remarks
* <b>Basic ns1 usage example:</b>
* ```
* property.methodName;
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}
* <hr>
* <b>Basic ns2 usage example:</b>
* ```
* ns.property.methodName;
* ```
* {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}
*/
export interface NS extends Singularity {
/**