2022-10-21 17:16:00 +02:00
|
|
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
|
|
|
|
|
|
[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [atExit](./bitburner.ns.atexit.md)
|
|
|
|
|
|
|
|
## NS.atExit() method
|
|
|
|
|
|
|
|
Add callback function when the script dies
|
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Signature:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
```typescript
|
2024-03-06 01:22:45 +01:00
|
|
|
atExit(f: () => void, id?: string): void;
|
2022-10-21 17:16:00 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Parameters
|
|
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| f | () => void | |
|
2024-03-06 01:22:45 +01:00
|
|
|
| id | string | _(Optional)_ |
|
2022-10-21 17:16:00 +02:00
|
|
|
|
2023-02-11 19:18:50 +01:00
|
|
|
**Returns:**
|
2022-10-21 17:16:00 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
## Remarks
|
|
|
|
|
|
|
|
RAM cost: 0 GB
|
|
|
|
|
|
|
|
NS2 exclusive
|
|
|
|
|
|
|
|
Add callback to be executed when the script dies.
|
|
|
|
|