ServiceTrigger
com.jsmacrosce.jsmacros.core.service.ServiceTrigger
Mutable configuration for a service trigger. Obtain a registered trigger with ServiceManager.getTrigger(String) after checking its name, for example:
js
const manager = JsMacros.getServiceManager();
if (manager.getServices().contains("example")) {
const trigger = manager.getTrigger("example");
Chat.log(`${trigger.file}: enabled=${trigger.enabled}`);
}Constructors
new ServiceTrigger
Fields
enabled
enabled: boolean#Whether the service is configured as enabled; this does not indicate that it is running.
file
Methods
equals
hashCode
hashCode(): int#Computes a hash from this trigger's path and enabled flag. The result may change when either mutable field changes, so avoid using a trigger as a hash key while those fields are being modified.
Returns: hash code derived from the current field values
toScriptTrigger
toScriptTrigger(): ScriptTrigger#Converts this configuration to an event trigger for the
Service event. The new trigger uses file.toString(), this instance's enabled flag, and joined == false; conversion does not register or start a service. A null file causes NullPointerException.Returns: a new service event trigger