bitburner-src/markdown/bitburner.ns.growthanalyze.md

57 lines
1.8 KiB
Markdown
Raw Normal View History

2021-10-30 18:34:14 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [growthAnalyze](./bitburner.ns.growthanalyze.md)
## NS.growthAnalyze() method
Calculate the number of grow thread needed to grow a server by a certain multiplier.
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
2021-11-22 17:36:13 +01:00
growthAnalyze(host: string, growthAmount: number, cores?: number): number;
2021-10-30 18:34:14 +02:00
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
2021-10-30 21:46:34 +02:00
| host | string | Hostname of the target server. |
2021-10-30 18:34:14 +02:00
| growthAmount | number | Multiplicative factor by which the server is grown. Decimal form.. |
2021-11-22 17:36:13 +01:00
| cores | number | |
2021-10-30 18:34:14 +02:00
<b>Returns:</b>
number
The amount of grow calls needed to grow the specified server by the specified amount
## Remarks
2021-10-30 21:46:34 +02:00
RAM cost: 1 GB
2021-10-30 18:34:14 +02:00
This function returns the number of “growths” needed in order to increase the amount of money available on the specified server by the specified amount. The specified amount is multiplicative and is in decimal form, not percentage.
Warning: The value returned by this function isnt necessarily a whole number.
2022-01-08 19:25:06 +01:00
## Example 1
2021-10-30 18:34:14 +02:00
2021-10-30 21:46:34 +02:00
```ts
2022-01-08 19:25:06 +01:00
// NS1:
2021-10-30 18:34:14 +02:00
//For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:
2022-01-08 19:25:06 +01:00
var growTimes = growthAnalyze("foodnstuff", 2);
//If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).
```
## Example 2
```ts
// NS2:
//For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:
const growTimes = ns.growthAnalyze("foodnstuff", 2);
2021-10-30 18:34:14 +02:00
//If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).
```