mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +01:00
65cd14e33b
* 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.
54 lines
1.9 KiB
Markdown
54 lines
1.9 KiB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||
|
||
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [grow](./bitburner.ns.grow.md)
|
||
|
||
## NS.grow() method
|
||
|
||
Spoof money in a server's bank account, increasing the amount available.
|
||
|
||
<b>Signature:</b>
|
||
|
||
```typescript
|
||
grow(host: string, opts?: BasicHGWOptions): Promise<number>;
|
||
```
|
||
|
||
## Parameters
|
||
|
||
| Parameter | Type | Description |
|
||
| --- | --- | --- |
|
||
| host | string | Hostname of the target server to grow. |
|
||
| opts | [BasicHGWOptions](./bitburner.basichgwoptions.md) | Optional parameters for configuring function behavior. |
|
||
|
||
<b>Returns:</b>
|
||
|
||
Promise<number>
|
||
|
||
The number by which the money on the server was multiplied for the growth.
|
||
|
||
## Remarks
|
||
|
||
RAM cost: 0.15 GB
|
||
|
||
Use your hacking skills to increase the amount of money available on a server. The runtime for this command depends on your hacking level and the target server’s security level. When `grow` completes, the money available on a target server will be increased by a certain, fixed percentage. This percentage is determined by the target server’s growth rate (which varies between servers) and security level. Generally, higher-level servers have higher growth rates. The [getServerGrowth](./bitburner.ns.getservergrowth.md) function can be used to obtain a server’s growth rate.
|
||
|
||
Like [hack](./bitburner.ns.hack.md)<!-- -->, `grow` can be called on any server, regardless of where the script is running. The grow() command requires root access to the target server, but there is no required hacking level to run the command. It also raises the security level of the target server by 0.004.
|
||
|
||
## Example 1
|
||
|
||
|
||
```ts
|
||
// NS1:
|
||
var currentMoney = getServerMoneyAvailable("foodnstuff");
|
||
currentMoney = currentMoney * grow("foodnstuff");
|
||
```
|
||
|
||
## Example 2
|
||
|
||
|
||
```ts
|
||
// NS2:
|
||
let currentMoney = ns.getServerMoneyAvailable("foodnstuff");
|
||
currentMoney *= await ns.grow("foodnstuff");
|
||
```
|
||
|