mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +01:00
Merge pull request #1895 from TheCoderJT/editingGitDocs
Editing git docs
This commit is contained in:
commit
2da9f87031
32
dist/bitburner.d.ts
vendored
32
dist/bitburner.d.ts
vendored
@ -2124,6 +2124,27 @@ export declare interface NodeStats {
|
||||
/**
|
||||
* Collection of all functions passed to scripts
|
||||
* @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 {
|
||||
/**
|
||||
@ -2321,9 +2342,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 +3280,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 * ```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": [
|
||||
{
|
||||
"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 server’s 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 server’s 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 server’s 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.
|
||||
```
|
||||
|
||||
|
@ -11,12 +11,37 @@ Collection of all functions passed to scripts
|
||||
```typescript
|
||||
export interface NS extends Singularity
|
||||
```
|
||||
|
||||
<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
|
||||
|
||||
| Property | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| -------------------------------------------------- | ----------------------------------------------- | --------------------------------------------------- |
|
||||
| [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. |
|
||||
| [codingcontract](./bitburner.ns.codingcontract.md) | [CodingContract](./bitburner.codingcontract.md) | Namespace for codingcontract functions. |
|
||||
@ -31,7 +56,7 @@ export interface NS extends Singularity
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| [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. |
|
||||
| [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. |
|
||||
| [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. |
|
||||
@ -130,4 +155,3 @@ export interface NS extends Singularity
|
||||
| [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. |
|
||||
| [writePort(port, data)](./bitburner.ns.writeport.md) | Write data to a port. |
|
||||
|
||||
|
1
package-lock.json
generated
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",
|
||||
|
21
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
21
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -3726,6 +3726,27 @@ interface Stanek {
|
||||
/**
|
||||
* Collection of all functions passed to scripts
|
||||
* @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 {
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user