IAuraAccessor
Definition of the IAuraAccessor interface in C#
IAuraAccessor
AI-first navigation: see AI Scripting Runtime, AI Auras Overview, AI Aura Actions, and AI Aura Triggers for how aura accessors fit into script workflows.
public interface IAuraAccessor : IHasId, ICanBeLoaded, ICanBeArchived, IHasTimestamp, IHasVariables, IHasPath
{
bool? IsActive { get; }
/// <summary>
/// Indicates whether this item is disabled (available for selection/edit) or not
/// </summary>
bool IsEnabled { get; }
/// <summary>
/// Contains a list of conditions which are required for this item to start "ticking"
/// </summary>
IObservableList<IAuraTrigger> EnablingConditions { get; }
IObservableList<IAuraOverlay> Overlays { [NotNull] get; }
IObservableList<IAuraTrigger> Triggers { [NotNull] get; }
IObservableList<IAuraAction> OnEnterActions { [NotNull] get; }
IObservableList<IAuraAction> WhileActiveActions { [NotNull] get; }
IObservableList<IAuraAction> OnExitActions { [NotNull] get; }
}
Read an aura's state
In an EyeAuras C# Script, create an aura named TargetAura beside the script:
var aura = AuraTree.GetAuraByPath("./TargetAura");
Log.Info($"Active: {aura.IsActive}; loaded: {aura.IsLoaded}");
IsActive is bool?: true means active, false inactive, and null unknown.
IsLoaded is a separate state. GetAuraByPath throws ArgumentException for a
missing aura; use FindAuraByPath and a null check when absence is expected.
Pass IAuraTreeScriptingApi or the selected accessor explicitly to helper classes.
Although the interface declares IsEnabled, AuraAccessor at c8b2304 does
not bind it to the aura. Its false value does not establish that the aura is disabled.
Execute an aura's action lists
Configure actions on TargetAura, then run this from another C# Script:
var aura = AuraTree.GetAuraByPath("./TargetAura");
await aura.ExecuteAsync(cancellationToken);
Log.Info("Actions completed");
This executes OnEnterActions, WhileActiveActions, and OnExitActions in
sequence. WhileActiveActions runs once; this is not a loop or an assignment
to IsActive. The token is checked before each action and passed to that action;
cancellation of an action already running depends on its implementation.
The optional token defaults to default. Execute(cancellationToken) blocks
synchronously; respect each action's thread requirements.
EnablingConditions, Triggers, Overlays, and the action lists are live
observable collections. Variables and paths come from inherited IHasVariables
and IHasPath. Collections and accessors belong to the aura tree.