bitburner-src/markdown/bitburner.ns.growthanalyze.md
Snarling 65cd14e33b
DOC: Add ns documentation for possible sleeve tasks (#217)
* Add specific types for sleeve tasks
* Moved LocationName enum to overall enums file
* Add LocationName enum to those provided to player
* remove trailing s on CompanyPosNames enum (now CompanyPosName, in line with LocationName)
* Also regenerated all ns documentation. This leads to an expected error when checking for generated files, because PRs should not normally touch markdown files. Also leads to a lint failure in generated file bitburner.d.ts
* also removed some exporting from NetscriptDefinitions.d.ts for anything that wasn't imported somewhere else.
2022-11-20 12:07:22 -05:00

1.8 KiB
Raw Blame History

Home > bitburner > NS > growthAnalyze

NS.growthAnalyze() method

Calculate the number of grow threads needed to grow a server by a certain multiplier.

Signature:

growthAnalyze(host: string, growthAmount: number, cores?: number): number;

Parameters

Parameter Type Description
host string Hostname of the target server.
growthAmount number Multiplicative factor by which the server is grown. Decimal form.
cores number

Returns:

number

The amount of grow calls needed to grow the specified server by the specified amount.

Remarks

RAM cost: 1 GB

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.

Example 1

// NS1:
//For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:
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

// 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);
//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).