2023-10-23 10:24:30 +02:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [nextUpdate](./bitburner.corporation.nextupdate.md)
|
|
|
|
|
|
|
|
## Corporation.nextUpdate() method
|
|
|
|
|
2024-08-16 11:02:23 +02:00
|
|
|
Sleep until the next Corporation update happens.
|
2023-10-23 10:24:30 +02:00
|
|
|
|
|
|
|
**Signature:**
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
nextUpdate(): Promise<CorpStateName>;
|
|
|
|
```
|
|
|
|
**Returns:**
|
|
|
|
|
|
|
|
Promise<[CorpStateName](./bitburner.corpstatename.md)<!-- -->>
|
|
|
|
|
|
|
|
Promise that resolves to the name of the state that was just processed.
|
|
|
|
|
|
|
|
## Remarks
|
|
|
|
|
|
|
|
RAM cost: 1 GB
|
|
|
|
|
|
|
|
The amount of real time spent asleep between updates can vary due to "bonus time" (usually 200 milliseconds - 2 seconds).
|
|
|
|
|
2024-08-16 11:02:23 +02:00
|
|
|
If the returned state is X, it means X just happened.
|
|
|
|
|
|
|
|
Possible states are START, PURCHASE, PRODUCTION, EXPORT, SALE.
|
|
|
|
|
2023-10-23 10:24:30 +02:00
|
|
|
## Example
|
|
|
|
|
|
|
|
|
|
|
|
```js
|
|
|
|
while (true) {
|
|
|
|
const prevState = await ns.corporation.nextUpdate();
|
2024-05-23 10:42:47 +02:00
|
|
|
const nextState = ns.corporation.getCorporation().nextState;
|
2023-10-23 10:24:30 +02:00
|
|
|
ns.print(`Corporation finished with ${prevState}, next will be ${nextState}.`);
|
|
|
|
// Manage the Corporation
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|