DOCUMENTATION: Fix newline issues in IPvGO docs and add missing RAM cost (#2602)

This commit is contained in:
catloversg
2026-03-28 00:26:45 +07:00
committed by GitHub
parent 3d5079a4e6
commit e3ae5478d5
17 changed files with 251 additions and 144 deletions

View File

@@ -21,7 +21,7 @@ Array containing current stamina and max stamina.
RAM cost: 4 GB
Returns an array with two elements: \* \[Current stamina, Max stamina\]
Returns an array with two elements: \[Current stamina, Max stamina\]
## Example

View File

@@ -56,7 +56,7 @@ True if successful, and false otherwise.
## Remarks
2.25 GB
RAM cost: 2.25 GB
Deletes one of your cloud servers, which is specified by its hostname/ip.

View File

@@ -56,5 +56,5 @@ Returns an array with the hostnames or IP addresses of all of the cloud servers
## Remarks
1.05 GB
RAM cost: 1.05 GB

View File

@@ -8,20 +8,15 @@ Retrieves a simplified version of the board state. "X" represents black pieces,
For example, a 5x5 board might look like this:
\[
```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.\#",
".XO.\#",
\]
"XXO.#",
".XO.#",
]
```
Each string represents a vertical column on the board, and each character in the string represents a point.
Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].

View File

@@ -8,19 +8,15 @@ Returns all the prior moves in the current game, as an array of simple board sta
For example, a single 5x5 prior move board might look like this:
\[
```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.\#",
".XO.\#",
\]
"XXO.#",
".XO.#",
]
```
**Signature:**

View File

@@ -99,20 +99,15 @@ Retrieves a simplified version of the board state. "X" represents black pieces,
For example, a 5x5 board might look like this:
\[
```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.\#",
".XO.\#",
\]
"XXO.#",
".XO.#",
]
```
Each string represents a vertical column on the board, and each character in the string represents a point.
Traditional notation for Go is e.g. "B,1" referring to second ("B") column, first rank. This is the equivalent of index \[1\]\[0\].
@@ -154,19 +149,15 @@ Returns all the prior moves in the current game, as an array of simple board sta
For example, a single 5x5 prior move board might look like this:
\[
```
[
"XX.O.",
"X..OO",
".XO..",
"XXO.\#",
".XO.\#",
\]
"XXO.#",
".XO.#",
]
```
</td></tr>

View File

@@ -15,3 +15,7 @@ clearAllPointHighlights(): void;
void
## Remarks
RAM cost: 0 GB

View File

@@ -4,13 +4,23 @@
## GoAnalysis.getChains() method
Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null.`
Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null`<!-- -->.
Takes an optional boardState argument; by default uses the current board state.
The data from getChains() can be used with the data from getBoardState() to see which player (or empty) each chain is
For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board. <pre lang="javascript"> \[ \[ 0,0,0,3,4\], \[ 1,0,0,3,3\], \[ 1,1,0,0,0\], \[null,1,0,2,2\], \[null,1,0,2,5\], \] </pre>
For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board.
```
[
[ 0,0,0,3,4],
[ 1,0,0,3,3],
[ 1,1,0,0,0],
[null,1,0,2,2],
[null,1,0,2,5],
]
```
**Signature:**

View File

@@ -10,7 +10,17 @@ Takes an optional boardState argument; by default uses the current board state.
Filled points of any color are indicated with '.'
In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center: <pre lang="javascript"> \[ "OO..?", "OO.?.", "O.?.X", ".?.XX", "?..X\#", \] </pre>
In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center:
```
[
"OO..?",
"OO.?.",
"O.?.X",
".?.XX",
"?..X#",
]
```
**Signature:**

View File

@@ -8,7 +8,17 @@ Returns a number for each point, representing how many open nodes its network/ch
Takes an optional boardState argument; by default uses the current board state.
For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured! <pre lang="javascript"> \[ \[-1, 5,-1,-1, 2\], \[ 5, 5,-1,-1,-1\], \[-1,-1, 4,-1,-1\], \[ 3,-1,-1, 3, 1\], \[ 3,-1,-1, 3, 1\], \] </pre>
For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured!
```
[
[-1, 5,-1,-1, 2],
[ 5, 5,-1,-1,-1],
[-1,-1, 4,-1,-1],
[ 3,-1,-1, 3, 1],
[ 3,-1,-1, 3, 1],
]
```
**Signature:**

View File

@@ -8,7 +8,19 @@ Displays the game history, captured nodes, and gained bonuses for each opponent
The details are keyed by opponent name, in this structure:
<pre lang="javascript"> { <OpponentName>: { wins: number, losses: number, winStreak: number, highestWinStreak: number, favor: number, bonusPercent: number, bonusDescription: string, } } </pre>
```
{
<OpponentName>: {
wins: number,
losses: number,
winStreak: number,
highestWinStreak: number,
favor: number,
bonusPercent: number,
bonusDescription: string,
}
}
```
**Signature:**
@@ -21,3 +33,7 @@ Partial&lt;Record&lt;[GoOpponent](./bitburner.goopponent.md)<!-- -->, [SimpleOpp
A dictionary of opponent stats keyed by opponent name.
## Remarks
RAM cost: 0 GB

View File

@@ -6,15 +6,17 @@
Shows if each point on the board is a valid move for the player. By default, analyzes the current board state. Takes an optional boardState (and an optional prior-move boardState, if desired) to analyze a custom board.
The true/false validity of each move can be retrieved via the X and Y coordinates of the move. `const validMoves = ns.go.analysis.getValidMoves();`
`const moveIsValid = validMoves[x][y];`
The true/false validity of each move can be retrieved via the X and Y coordinates of the move.
```js
const validMoves = ns.go.analysis.getValidMoves();
const moveIsValid = validMoves[x][y];
```
Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.
Also note that, when given a custom board state, only one prior move can be analyzed. This means that the superko rules (no duplicate board states in the full game history) is not supported; you will have to implement your own analysis for that.
The current valid moves for white can also be seen by simply calling `ns.go.analysis.getValidMoves(true)` .
The current valid moves for white can also be seen by simply calling `ns.go.analysis.getValidMoves(true)`<!-- -->.
**Signature:**

View File

@@ -54,13 +54,23 @@ Removes the highlight color and text from the specified node.
</td><td>
Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null.`
Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null`<!-- -->.
Takes an optional boardState argument; by default uses the current board state.
The data from getChains() can be used with the data from getBoardState() to see which player (or empty) each chain is
For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board. <pre lang="javascript"> \[ \[ 0,0,0,3,4\], \[ 1,0,0,3,3\], \[ 1,1,0,0,0\], \[null,1,0,2,2\], \[null,1,0,2,5\], \] </pre>
For example, a 5x5 board might look like this. There is a large chain \#1 on the left side, smaller chains 2 and 3 on the right, and a large chain 0 taking up the center of the board.
```
[
[ 0,0,0,3,4],
[ 1,0,0,3,3],
[ 1,1,0,0,0],
[null,1,0,2,2],
[null,1,0,2,5],
]
```
</td></tr>
@@ -77,7 +87,17 @@ Takes an optional boardState argument; by default uses the current board state.
Filled points of any color are indicated with '.'
In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center: <pre lang="javascript"> \[ "OO..?", "OO.?.", "O.?.X", ".?.XX", "?..X\#", \] </pre>
In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center:
```
[
"OO..?",
"OO.?.",
"O.?.X",
".?.XX",
"?..X#",
]
```
</td></tr>
@@ -92,7 +112,17 @@ Returns a number for each point, representing how many open nodes its network/ch
Takes an optional boardState argument; by default uses the current board state.
For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured! <pre lang="javascript"> \[ \[-1, 5,-1,-1, 2\], \[ 5, 5,-1,-1,-1\], \[-1,-1, 4,-1,-1\], \[ 3,-1,-1, 3, 1\], \[ 3,-1,-1, 3, 1\], \] </pre>
For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured!
```
[
[-1, 5,-1,-1, 2],
[ 5, 5,-1,-1,-1],
[-1,-1, 4,-1,-1],
[ 3,-1,-1, 3, 1],
[ 3,-1,-1, 3, 1],
]
```
</td></tr>
@@ -107,7 +137,19 @@ Displays the game history, captured nodes, and gained bonuses for each opponent
The details are keyed by opponent name, in this structure:
<pre lang="javascript"> { <OpponentName>: { wins: number, losses: number, winStreak: number, highestWinStreak: number, favor: number, bonusPercent: number, bonusDescription: string, } } </pre>
```
{
<OpponentName>: {
wins: number,
losses: number,
winStreak: number,
highestWinStreak: number,
favor: number,
bonusPercent: number,
bonusDescription: string,
}
}
```
</td></tr>
@@ -120,15 +162,17 @@ The details are keyed by opponent name, in this structure:
Shows if each point on the board is a valid move for the player. By default, analyzes the current board state. Takes an optional boardState (and an optional prior-move boardState, if desired) to analyze a custom board.
The true/false validity of each move can be retrieved via the X and Y coordinates of the move. `const validMoves = ns.go.analysis.getValidMoves();`
`const moveIsValid = validMoves[x][y];`
The true/false validity of each move can be retrieved via the X and Y coordinates of the move.
```js
const validMoves = ns.go.analysis.getValidMoves();
const moveIsValid = validMoves[x][y];
```
Note that the \[0\]\[0\] point is shown on the bottom-left on the visual board (as is traditional), and each string represents a vertical column on the board. In other words, the printed example above can be understood to be rotated 90 degrees clockwise compared to the board UI as shown in the IPvGO subnet tab.
Also note that, when given a custom board state, only one prior move can be analyzed. This means that the superko rules (no duplicate board states in the full game history) is not supported; you will have to implement your own analysis for that.
The current valid moves for white can also be seen by simply calling `ns.go.analysis.getValidMoves(true)` .
The current valid moves for white can also be seen by simply calling `ns.go.analysis.getValidMoves(true)`<!-- -->.
</td></tr>

View File

@@ -52,3 +52,7 @@ _(Optional)_ Optional. if true, reset win/loss records for all opponents. Leaves
void
## Remarks
RAM cost: 0 GB

View File

@@ -52,3 +52,7 @@ Value(s) to be alerted.
void
## Remarks
RAM cost: 0 GB

View File

@@ -84,3 +84,7 @@ _(Optional)_ Duration of toast in ms. Can also be `null` to create a persistent
void
## Remarks
RAM cost: 0 GB

View File

@@ -3902,8 +3902,7 @@ export interface Bladeburner {
* @remarks
* RAM cost: 4 GB
*
* Returns an array with two elements:
* * [Current stamina, Max stamina]
* Returns an array with two elements: [Current stamina, Max stamina]
* @example
* ```js
* function getStaminaPercentage() {
@@ -4232,7 +4231,7 @@ export interface Cloud {
/**
* Delete a cloud server.
* @remarks
* 2.25 GB
* RAM cost: 2.25 GB
*
* Deletes one of your cloud servers, which is specified by its hostname/ip.
*
@@ -4249,7 +4248,8 @@ export interface Cloud {
* Returns an array with the hostnames or IP addresses of all of the cloud servers you have purchased.
* Returns hostnames by default.
*
* @remarks 1.05 GB
* @remarks
* RAM cost: 1.05 GB
*
* @param returnOpts - Optional. Controls whether the function returns IPs
* @returns Returns an array with the hostnames or IP addresses of all of the cloud servers you have purchased.
@@ -5187,9 +5187,11 @@ export interface GoAnalysis {
* Takes an optional boardState (and an optional prior-move boardState, if desired) to analyze a custom board.
*
* The true/false validity of each move can be retrieved via the X and Y coordinates of the move.
* `const validMoves = ns.go.analysis.getValidMoves();`
*
* `const moveIsValid = validMoves[x][y];`
* ```js
* const validMoves = ns.go.analysis.getValidMoves();
* const moveIsValid = validMoves[x][y];
* ```
*
* Note that the [0][0] point is shown on the bottom-left on the visual board (as is traditional), and each
* string represents a vertical column on the board. In other words, the printed example above can be understood to
@@ -5214,7 +5216,7 @@ export interface GoAnalysis {
/**
* Returns an ID for each point. All points that share an ID are part of the same network (or "chain"). Empty points
* are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null.`
* are also given chain IDs to represent continuous empty space. Dead nodes are given the value `null`.
*
* Takes an optional boardState argument; by default uses the current board state.
*
@@ -5222,7 +5224,8 @@ export interface GoAnalysis {
*
* For example, a 5x5 board might look like this. There is a large chain #1 on the left side, smaller chains
* 2 and 3 on the right, and a large chain 0 taking up the center of the board.
* <pre lang="javascript">
*
* ```
* [
* [ 0,0,0,3,4],
* [ 1,0,0,3,3],
@@ -5230,7 +5233,7 @@ export interface GoAnalysis {
* [null,1,0,2,2],
* [null,1,0,2,5],
* ]
* </pre>
* ```
*
* @remarks
* RAM cost: 16 GB
@@ -5251,7 +5254,8 @@ export interface GoAnalysis {
*
* For example, a 5x5 board might look like this. The chain in the top-left touches 5 total empty nodes, and the one
* in the center touches four. The group in the bottom-right only has one liberty; it is in danger of being captured!
* <pre lang="javascript">
*
* ```
* [
* [-1, 5,-1,-1, 2],
* [ 5, 5,-1,-1,-1],
@@ -5259,7 +5263,7 @@ export interface GoAnalysis {
* [ 3,-1,-1, 3, 1],
* [ 3,-1,-1, 3, 1],
* ]
* </pre>
* ```
*
* @remarks
* RAM cost: 16 GB
@@ -5281,7 +5285,8 @@ export interface GoAnalysis {
* Filled points of any color are indicated with '.'
*
* In this example, white encircles some space in the top-left, black encircles some in the top-right, and between their routers is contested space in the center:
* <pre lang="javascript">
*
* ```
* [
* "OO..?",
* "OO.?.",
@@ -5289,7 +5294,7 @@ export interface GoAnalysis {
* ".?.XX",
* "?..X#",
* ]
* </pre>
* ```
*
* @remarks
* RAM cost: 16 GB
@@ -5306,9 +5311,9 @@ export interface GoAnalysis {
*
* The details are keyed by opponent name, in this structure:
*
* <pre lang="javascript">
* \{
* <OpponentName>: \{
* ```
* {
* <OpponentName>: {
* wins: number,
* losses: number,
* winStreak: number,
@@ -5316,9 +5321,12 @@ export interface GoAnalysis {
* favor: number,
* bonusPercent: number,
* bonusDescription: string,
* \}
* \}
* </pre>
* }
* }
* ```
*
* @remarks
* RAM cost: 0 GB
*
* @returns A dictionary of opponent stats keyed by opponent name.
*/
@@ -5326,6 +5334,10 @@ export interface GoAnalysis {
/**
* Reset all win/loss and winstreak records for the No AI opponent.
*
* @remarks
* RAM cost: 0 GB
*
* @param resetAll - Optional. if true, reset win/loss records for all opponents. Leaves node power and bonuses unchanged. Defaults to false.
*/
resetStats(resetAll?: boolean): void;
@@ -5370,7 +5382,12 @@ export interface GoAnalysis {
*/
clearPointHighlight(x: number, y: number): void;
/** Removes all highlights from the board. */
/**
* Removes all highlights from the board.
*
* @remarks
* RAM cost: 0 GB
*/
clearAllPointHighlights(): void;
}
@@ -5601,19 +5618,15 @@ export interface Go {
*
* For example, a 5x5 board might look like this:
*
* ```
* [
*
* "XX.O.",
*
* "X..OO",
*
* ".XO..",
*
* "XXO.#",
*
* ".XO.#",
*
* ]
* ```
*
* Each string represents a vertical column on the board, and each character in the string represents a point.
*
@@ -5633,19 +5646,15 @@ export interface Go {
*
* For example, a single 5x5 prior move board might look like this:
*
* ```
* [
*
* "XX.O.",
*
* "X..OO",
*
* ".XO..",
*
* "XXO.#",
*
* ".XO.#",
*
* ]
* ```
*
* @remarks
* RAM cost: 0 GB
@@ -8834,12 +8843,20 @@ export interface NS {
/**
* Open up a message box.
*
* @remarks
* RAM cost: 0 GB
*
* @param args - Value(s) to be alerted.
*/
alert(...args: any[]): void;
/**
* Queue a toast (bottom-right notification).
*
* @remarks
* RAM cost: 0 GB
*
* @param msg - Message in the toast.
* @param variant - Type of toast. Must be one of success, info, warning, error. Defaults to success.
* @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000.