Events
nexSys builds on eventStream and emits events for state changes, output scheduling, and user actions. This page summarizes the most important events and naming patterns.
Naming patterns
- Afflictions:
${aff}GotAffEvent,${aff}LostAffEvent - Defences:
${def}GotDefEvent,${def}LostDefEvent - Balances:
${bal}GotBalEvent,${bal}LostBalEvent - Trackables:
${name}GotTrackableEvent,${name}LostTrackableEvent
System events
| Event | Payload | Description |
|---|---|---|
SystemLoaded | none | nexSys finished initial startup. |
SystemPaused | none | System paused. |
SystemUnpaused | none | System unpaused. |
SystemSlowModeOn | none | Slow mode enabled. |
SystemSlowModeOff | none | Slow mode disabled. |
SystemStatusSetEvent | { status, arg } | Settings change propagated to serverside. |
SystemCharVitalsUpdated | sys.char | Vitals and stats updated. |
SystemCharStatusUpdated | sys.char | Status info updated (class, race, target). |
RoomChangedEvent | GMCP Room.Info | Room change detected. |
Affliction events
| Event | Payload | Description |
|---|---|---|
AffGot | Aff | Any affliction gained. |
AffLost | Aff | Any affliction lost. |
${aff}GotAffEvent | Aff | Specific affliction gained. |
${aff}LostAffEvent | Aff | Specific affliction lost. |
${aff}AffCountAddEvent | number | Countable aff increment. |
${aff}AffCountSubtractEvent | number | Countable aff decrement. |
${aff}AffCountSetEvent | number | Countable aff set. |
Defence events
| Event | Payload | Description |
|---|---|---|
DefGot | Def | Any defence gained. |
DefLost | Def | Any defence lost. |
${def}GotDefEvent | Def | Specific defence gained. |
${def}LostDefEvent | Def | Specific defence lost. |
Balance events
| Event | Payload | Description |
|---|---|---|
BalanceGot | Balance | Any balance regained. |
BalanceLost | Balance | Any balance lost. |
eqBalRecoveredEvent | none | Balance and equilibrium recovered together. |
Trackables
| Event | Payload | Description |
|---|---|---|
TrackableGot | Trackable | Trackable gained. |
TrackableLost | Trackable | Trackable lost. |
Limb tracking
| Event | Payload | Description |
|---|---|---|
nexSysLimbHit | Limb | Limb damage recorded. |
nexSysLimbBreak | Limb | Limb break detected. |
nexSysLimbReset | Limb | Limb state reset. |
Output scheduling
| Event | Payload | Description |
|---|---|---|
SystemOutputAdd | string or string[] | Add output commands. |
OutputSentEvent | string[] | Output sent to server. |
SystemOutputCompleteEvent | none | Output finished (echoed by server). |
Example
const onAffGot = (aff) => {
if (aff.name === "aeon") {
nexusclient.display_notice("Aeon detected");
}
};
eventStream.registerEvent("AffGot", onAffGot);