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

54 lines
1.9 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; [grow](./bitburner.ns.grow.md)
## NS.grow() method
2021-11-03 05:27:21 +01:00
Spoof money in a servers bank account, increasing the amount available.
2021-10-30 18:34:14 +02:00
<b>Signature:</b>
```typescript
2021-10-30 21:46:34 +02:00
grow(host: string, opts?: BasicHGWOptions): Promise<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 to grow. |
2021-10-30 18:34:14 +02:00
| opts | [BasicHGWOptions](./bitburner.basichgwoptions.md) | Optional parameters for configuring function behavior. |
<b>Returns:</b>
Promise&lt;number&gt;
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 servers 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 servers growth rate (which varies between servers) and security level. Generally, higher-level servers have higher growth rates. The getServerGrowth() function can be used to obtain a servers growth rate.
2021-11-03 05:27:21 +01:00
Like hack, `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.
2021-10-30 18:34:14 +02:00
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:
2022-03-17 21:50:46 +01:00
var currentMoney = getServerMoneyAvailable("foodnstuff");
2022-01-08 19:25:06 +01:00
currentMoney = currentMoney * (1 + grow("foodnstuff"));
```
## Example 2
```ts
// NS2:
2022-03-17 21:50:46 +01:00
let currentMoney = ns.getServerMoneyAvailable("foodnstuff");
2022-01-08 19:25:06 +01:00
currentMoney *= (1 + await ns.grow("foodnstuff"));
2021-10-30 18:34:14 +02:00
```