Fix growthAnalyzeSecurity doc

Also a format fix from a previous sloppy commit
This commit is contained in:
omuretsu 2023-02-28 09:57:02 -05:00
parent f16246f939
commit 75481aa195
4 changed files with 6 additions and 6 deletions

@ -4,7 +4,7 @@
## NS.growthAnalyzeSecurity() method
Calculate the security increase for a number of threads.
Calculate the security increase for a number of grow threads.
**Signature:**
@ -17,7 +17,7 @@ growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): numbe
| Parameter | Type | Description |
| --- | --- | --- |
| threads | number | Amount of threads that will be used. |
| hostname | string | _(Optional)_ Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the server's maximum amount of money. |
| hostname | string | _(Optional)_ Optional. Hostname of the target server. If provided, security increase is limited by the number of threads needed to reach maximum money. |
| cores | number | _(Optional)_ Optional. The number of cores of the server that would run grow. |
**Returns:**

@ -121,7 +121,7 @@ export async function main(ns) {
| [getWeakenTime(host)](./bitburner.ns.getweakentime.md) | Get the execution time of a weaken() call. |
| [grow(host, opts)](./bitburner.ns.grow.md) | Spoof money in a server's bank account, increasing the amount available. |
| [growthAnalyze(host, multiplier, cores)](./bitburner.ns.growthanalyze.md) | Calculate the number of grow threads needed for a given multiplicative growth factor. |
| [growthAnalyzeSecurity(threads, hostname, cores)](./bitburner.ns.growthanalyzesecurity.md) | Calculate the security increase for a number of threads. |
| [growthAnalyzeSecurity(threads, hostname, cores)](./bitburner.ns.growthanalyzesecurity.md) | Calculate the security increase for a number of grow threads. |
| [hack(host, opts)](./bitburner.ns.hack.md) | Steal a server's money. |
| [hackAnalyze(host)](./bitburner.ns.hackanalyze.md) | Get the part of money stolen with a single thread. |
| [hackAnalyzeChance(host)](./bitburner.ns.hackanalyzechance.md) | Get the chance of successfully hacking a server. |

@ -176,7 +176,7 @@ export const ns: InternalAPI<NSFull> = {
return 0; // To prevent returning infinity below
}
return hackAmount / server.moneyAvailable * percentHacked;
return (hackAmount / server.moneyAvailable) * percentHacked;
},
hackAnalyze: (ctx) => (_hostname) => {
const hostname = helpers.string(ctx, "hostname", _hostname);

@ -4828,14 +4828,14 @@ export interface NS {
growthAnalyze(host: string, multiplier: number, cores?: number): number;
/**
* Calculate the security increase for a number of threads.
* Calculate the security increase for a number of grow threads.
* @remarks
* RAM cost: 1 GB
*
* Returns the security increase that would occur if a grow with this many threads happened.
*
* @param threads - Amount of threads that will be used.
* @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the server's maximum amount of money.
* @param hostname - Optional. Hostname of the target server. If provided, security increase is limited by the number of threads needed to reach maximum money.
* @param cores - Optional. The number of cores of the server that would run grow.
* @returns The security increase.
*/