Skip to content

EventRegistry ​

com.jsmacrosce.jsmacros.client.event.EventRegistry

Client-side registry for profile macro triggers, exposed through the client's core rather than as a separate global library.

js
const Client = Java.type('com.jsmacrosce.jsmacros.client.JsMacrosClient');  
const registry = Client.clientCore.eventRegistry;  
Chat.log(registry.getScriptTriggers().size());

Constructors ​

new EventRegistry ​

new EventRegistry(Core<?, ?> runner)#
Associates this registry with the provided core.

Parameters:

  • runner: the core associated with this registry

Methods ​

addScriptTrigger ​

addScriptTrigger(ScriptTrigger rawMacro): void#
Registers a profile trigger as a client event or key listener. Legacy event aliases are remapped first; event triggers with a Joined prefix have that prefix removed and the supplied trigger's joined flag set. The trigger is retained by reference.

Parameters:

  • rawMacro: the profile trigger to register; its event or joined setting may be modified

getScriptTriggers ​

getScriptTriggers(): List<ScriptTrigger>#
Returns a new list of triggers held by registered macro listeners. The list contains the original trigger references; changing the list does not change registration.
Returns: a new list of registered macro trigger references

removeScriptTrigger ​

removeScriptTrigger(ScriptTrigger rawMacro): boolean#
Removes the first listener backed by this exact trigger instance under its current event name, or the key-event name for key triggers. Other event names are not searched.

Parameters:

  • rawMacro: the trigger instance whose listener should be removed
Returns: true if one listener was removed; false if no matching listener was found