Events
nexSys relies on eventStream as the backend event handler. nexSys provides a variety of events that users may tap into for their own packages and uses.
Events List
Here's a table of our events:
Event Name | Description |
---|---|
AffGot | Any affliction is gained |
AffLost | Any affliction is lost |
<affliction>GotAffEvent | Specific affliction is gained |
<affliction>LostAffEvent | Specific affliction is lost |
DefGot | A defense is gained |
DefLost | A defense is lost |
<defence>GotDefEvent | Specific defense is gained |
<defence>LostDefEvent | Specific defense is lost |
BalanceGot | Balance has been regained |
BalanceLost | Balance has been lost |
<balance>GotBalEvent | Specific balance state has been regained |
<balance>LostBalEvent | Specific balance state has been lost |
eqBalRecoveredEvent | Both Balance and Equilibrium have returned |
SystemPaused | nexSys system is paused |
SystemUnpaused | nexSys system is unpaused |
SystemSlowModeOn | nexSys system slow mode is enabled |
SystemSlowModeOff | nexSys system slow mode is disabled |
PromptEvent | New prompt is received |
RoomChangedEvent | The player has moved to a different room |
ItemAddedToRoom | An item has been added to the current room |
ItemAddedToInv | An item has been added to the inventory |
ItemRemovedFromRoom | An item has been removed from the current room |
ItemRemoveFromInv | An item has been removed from the inventory |
ItemUpdatedRoom | An item in the room has been updated |
ItemUpdatedInv | An item in the inventory has been updated |
ItemListForRoom | The list of items in the current room has been updated |
ItemListForInv | The list of items in the inventory has been updated |
TargetSetEvent | A new target has been set |
TargetChanged | The current target has been changed |
ClassChanged | The player’s class has changed |
HealthUpdated | The player’s health has been updated |
ManaUpdated | The player’s mana has been updated |
RageUpdated | The player’s rage has been updated |
AffGot
Description: Triggered when any affliction is gained by the player.
Returns: nexSys Aff object, containing detailed information about the affliction.
Example:
const example = function (args) {
if (args.name === "aeon") {
nexusclient.display_notice("I guess this is the end");
}
};
eventStream.registerEvent("AffGot", example);
AffLost
Description: Triggered when any affliction is lost by the player.
Returns: nexSys Aff object, containing detailed information about the lost affliction.
<affliction>GotAffEvent
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:
const example = function (args) {
nexusclient.display_notice("I guess this is the end");
};
eventStream.registerEvent("aeonGotAffEvent", example);
<affliction>LostAffEvent
Description: Triggered when a specific affliction is lost by the player. Replace <affliction>
with the actual affliction name.
Returns: Specific nexSys Aff object for the lost affliction.
Example:
const example = function (args) {
nexusclient.display_notice("I'm alive! Or maybe I'm dead...");
};
eventStream.registerEvent("aeonLostAffEvent", example);
DefGot
Description: Triggered when any defense is gained by the player.
Returns: nexSys Def object, detailing the gained defense.
DefLost
Description: Triggered when any defense is lost by the player.
Returns: nexSys Def object, detailing the lost defense.
<defence>GotDefEvent
Description: Triggered when a specific defense is gained by the player. Replace <defence>
with the actual defense name.
Returns: Specific nexSys Def object for the gained defense.
Example:
const example = function () {
nexSys.sys.pause();
};
eventStream.registerEvent("prismaticGotDefEvent", example);
<defence>LostDefEvent
Description: Triggered when a specific defense is lost by the player. Replace <defence>
with the actual defense name.
Returns: Specific nexSys Def object for the lost defense.
Example:
const example = function () {
nexSys.sys.unpause();
};
eventStream.registerEvent("prismaticLostDefEvent", example);
BalanceGot
Description: Triggered when balance is regained by the player.
Returns: Boolean value indicating the new balance state.
BalanceLost
Description: Triggered when balance is lost by the player.
Returns: Boolean value indicating the lost balance state.
<balance>GotBalEvent
Description: Triggered when a specific balance state is regained by the player. Replace <balance>
with the actual balance type.
Returns: Boolean or specific balance state object, depending on the balance type.
<balance>LostBalEvent
Description: Triggered when a specific balance state is lost by the player. Replace <balance>
with the actual balance type.
Returns: Boolean or specific balance state object, depending on the balance type.
eqBalRecoveredEvent
Description: Triggered when both balance and equilibrium have returned to the player.
Returns: Object indicating that both balance and equilibrium are recovered.
SystemPaused
Description: Triggered when the nexSys system is paused.
Returns: Boolean indicating the system's paused state.
SystemUnpaused
Description: Triggered when the nexSys system is unpaused.
Returns: Boolean indicating the system's unpaused state.
SystemSlowModeOn
Description: Triggered when the nexSys system slow mode is enabled.
Returns: Boolean indicating that slow mode is active.
SystemSlowModeOff
Description: Triggered when the nexSys system slow mode is disabled.
Returns: Boolean indicating that slow mode is inactive.
PromptEvent
Description: Triggered when a new prompt is received. Similar to the Nexus onBlock function.
Returns: Object containing the details of the new prompt.
RoomChangedEvent
Description: Triggered when the player has moved to a different room.
Returns: GMCP Room.Info object containing information about the new room, such as room ID and description.
ItemAddedToRoom
Description: Triggered when an item has been added to the current room.
Returns: GMCP item object with details of the added item.
ItemAddedToInv
Description: Triggered when an item has been added to the inventory.
Returns: GMCP item object with details of the added item.
ItemRemovedFromRoom
Description: Triggered when an item has been removed from the current room.
Returns: GMCP item object with details of the removed item.
ItemRemoveFromInv
Description: Triggered when an item has been removed from the inventory.
Returns: GMCP item object with details of the removed item.
Example:
ItemUpdatedRoom
Description: Triggered when an item in the room has been updated.
Returns: GMCP item object with updated details of the item.
ItemUpdatedInv
Description: Triggered when an item in the inventory has been updated.
Returns: GMCP item object with updated details of the item.
ItemListForRoom
Description: Triggered when the list of items in the current room has been updated.
Returns: Array of GMCP item objects, representing the updated list of items.
ItemListForInv
Description: Triggered when the list of items in the inventory has been updated.
Returns: Array of GMCP item objects, representing the updated inventory.
TargetSetEvent
Description: Triggered when a new target is set.
Returns: String value of the new (current) target.
TargetChanged
Description: Triggered when the current target has been changed.
Returns: String value of the new (current) target.
ClassChanged
Description: Triggered when the player's class changes.
Returns: Object detailing the old and new class names.
{
old: string,
new: string
}
HealthUpdated
Description: Event is raised any time the player's health value changes.
Returns: Object with health details.
{
max: int,
current: int,
diff: int
}
Example:
const example = function (args) {
if (args.max / args.current < 0.5) {
nexusclient.send_commands("touch crystal|pt save me!");
}
};
eventStream.registerEvent("HealthUpdated", example);
ManaUpdated
Description: Event is raised any time the player's mana value changes.
Returns: Object with mana details.
{
max: int,
current: int,
diff: int
}
RageUpdated
Description: Event is raised any time the player's rage value changes.
Returns: Object with Rage details.
{
max: int,
current: int,
diff: int
}