Skip to content

Commit

Permalink
nexSys event examples
Browse files Browse the repository at this point in the history
  • Loading branch information
NexusUnleashed committed Sep 4, 2024
1 parent 33633ca commit e9c9827
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/nexSys/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ Here's a table of our events:

**Returns**: nexSys Aff object, containing detailed information about the affliction.

```js
const example = function (args) {
if (args.name === "aeon") {
nexusclient.display_notice("I guess this is the end");
}
};
eventStream.registerEvent("AffGot", example);
```
---
## AffLost
Expand All @@ -70,6 +79,14 @@ Here's a table of our events:
**Description**: Triggered when a specific affliction is gained by the player. Replace `<affliction>` with the actual affliction name.

**Returns**: Specific nexSys Aff object for the gained affliction.
**Example**:

```js
const example = function (args) {
nexusclient.display_notice("I guess this is the end");
};
eventStream.registerEvent("aeonGotAffEvent", example);
```
---
Expand Down Expand Up @@ -310,6 +327,17 @@ Here's a table of our events:
}
```
**Example**:
```js
const example = function (args) {
if (args.max / args.current < 0.5) {
nexusclient.send_commands("touch crystal|pt save me!");
}
};
eventStream.registerEvent("HealthUpdated", example);
```
---
## ManaUpdated
Expand Down

0 comments on commit e9c9827

Please sign in to comment.