World of Warcraft Forever API · C_EncounterTimeline.md, for your AI
C_EncounterTimeline
34 functions, 11 events, 4 tables, as Blizzard documents them for Forever 1.60.1 (70959).
Making an addon with an AI? Tell it: Read https://wowaddons.gg/agents.md, then make me a World of Warcraft Forever addon that …, try it with me in the game, and publish it. It checks every call against this API before you try it in the game, then publishes it here. How it works.
Functions
C_EncounterTimeline.AddEditModeEvents
loopTimerDuration = C_EncounterTimeline.AddEditModeEvents()
Adds a predefined set of events to the timeline for display in Edit Mode.
Returns
loopTimerDuration | Seconds |
|---|
C_EncounterTimeline.AddScriptEvent
eventID = C_EncounterTimeline.AddScriptEvent(eventInfo)
Adds a custom event to the timeline.
Arguments
eventInfo | EncounterTimelineScriptEventRequest |
|---|
Returns
eventID | EncounterTimelineEventID |
|---|
C_EncounterTimeline.CancelAllScriptEvents
C_EncounterTimeline.CancelAllScriptEvents()
Cancels all custom timeline events, removing them from the timeline.
C_EncounterTimeline.CancelEditModeEvents
C_EncounterTimeline.CancelEditModeEvents()
Removes all Edit Mode events from the timeline.
C_EncounterTimeline.CancelScriptEvent
C_EncounterTimeline.CancelScriptEvent(eventID)
Cancels a custom timeline event, removing it from the timeline.
Arguments
eventID | EncounterTimelineEventID |
|---|
C_EncounterTimeline.FinishScriptEvent
C_EncounterTimeline.FinishScriptEvent(eventID)
Finishes a custom timeline event, removing it from the timeline.
Arguments
eventID | EncounterTimelineEventID |
|---|
C_EncounterTimeline.GetCurrentTime
currentTime = C_EncounterTimeline.GetCurrentTime()
Returns the current timestamp used for rendering the timeline display.
Returns
currentTime | Seconds |
|---|
C_EncounterTimeline.GetEventColor
color = C_EncounterTimeline.GetEventColor(eventID, [overrideTrigger])
Returns the current color used to render timeline event.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
eventID | EncounterTimelineEventID | |
|---|---|---|
overrideTrigger | EncounterEventColorTrigger may be nil |
Returns
color | colorRGBA |
|---|
C_EncounterTimeline.GetEventCountBySource
count = C_EncounterTimeline.GetEventCountBySource(source)
Returns the number of present events in the timeline by their source type.
Arguments
source | EncounterTimelineEventSource |
|---|
Returns
count | number |
|---|
C_EncounterTimeline.GetEventHighlightTime
highlightTime = C_EncounterTimeline.GetEventHighlightTime()
Returns the duration at which timeline events will be highlighted for imminency.
Returns
highlightTime | Seconds |
|---|
C_EncounterTimeline.GetEventInfo
info = C_EncounterTimeline.GetEventInfo(eventID)
Returns information about a timeline event. This data is generally expected to be static for the lifetime of an event.
Its returns can be secret values (in some instances and fights): guard them before any arithmetic.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
info | EncounterTimelineEventInfo |
|---|
C_EncounterTimeline.GetEventList
events = C_EncounterTimeline.GetEventList()
Returns an unsorted list of event IDs present in the timeline.
Returns
events | EncounterTimelineEventID[] |
|---|
C_EncounterTimeline.GetEventState
state = C_EncounterTimeline.GetEventState(eventID)
Returns the current state of a timeline event.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
state | EncounterTimelineEventState |
|---|
C_EncounterTimeline.GetEventTimeElapsed
timeElapsed = C_EncounterTimeline.GetEventTimeElapsed(eventID)
Returns the elapsed duration of a timeline event.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
timeElapsed | Seconds |
|---|
C_EncounterTimeline.GetEventTimeRemaining
timeRemaining = C_EncounterTimeline.GetEventTimeRemaining(eventID)
Returns the remaining duration of a timeline event.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
timeRemaining | Seconds |
|---|
C_EncounterTimeline.GetEventTimer
duration = C_EncounterTimeline.GetEventTimer(eventID)
Returns a Duration object that tracks the elapsed duration of a timeline event. This object tracks the range [0, duration] of the event and automatically pauses its progression based on event state.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
duration | LuaDurationObject may be nil |
|---|
C_EncounterTimeline.GetEventTrack
track, trackSortIndex = C_EncounterTimeline.GetEventTrack(eventID)
Returns information about the position of an event on the timeline.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
track | EncounterTimelineTrack | |
|---|---|---|
trackSortIndex | luaIndex may be nil |
C_EncounterTimeline.GetSortedEventList
events = C_EncounterTimeline.GetSortedEventList([maxEventCount], [maxEventDuration], [excludeTerminalStates], [excludeHiddenEvents])
Returns a sorted list of event IDs present in the timeline from shortest to longest remaining durations, meeting the requirements of the specified filters.
Arguments
maxEventCount | number may be nil | Maximum number of sorted events to return. |
|---|---|---|
maxEventDuration | Seconds may be nil | Maximum duration of sorted events to return. |
excludeTerminalStates | bool default true | If false, include events that are terminal states such as Canceled or Finished. |
excludeHiddenEvents | bool default true | If false, include events that should be hidden by user configuration, such as events on long tracks when the user has opted to not show long countdowns. |
Returns
events | EncounterTimelineEventID[] |
|---|
C_EncounterTimeline.GetTrackInfo
trackInfo = C_EncounterTimeline.GetTrackInfo(track)
Returns information for a single timeline track.
Arguments
track | EncounterTimelineTrack |
|---|
Returns
trackInfo | EncounterTimelineTrackInfo |
|---|
C_EncounterTimeline.GetTrackList
tracks = C_EncounterTimeline.GetTrackList()
Returns information about all timeline tracks.
Returns
tracks | EncounterTimelineTrackInfo[] |
|---|
C_EncounterTimeline.GetTrackMaxEventDuration
maxEventDuration = C_EncounterTimeline.GetTrackMaxEventDuration(track)
Returns the maximum permitted event duration on a single timeline track.
Arguments
track | EncounterTimelineTrack |
|---|
Returns
maxEventDuration | Seconds |
|---|
C_EncounterTimeline.GetTrackType
trackType = C_EncounterTimeline.GetTrackType(track)
Returns the type of a single timeline track.
Arguments
track | EncounterTimelineTrack |
|---|
Returns
trackType | EncounterTimelineTrackType |
|---|
C_EncounterTimeline.GetViewType
viewType = C_EncounterTimeline.GetViewType()
Returns the current view type of the timeline.
Returns
viewType | EncounterTimelineViewType |
|---|
C_EncounterTimeline.HasActiveEvents
hasActiveEvents = C_EncounterTimeline.HasActiveEvents()
Returns true if the timeline contains any events in the active state.
Returns
hasActiveEvents | bool |
|---|
C_EncounterTimeline.HasAnyEvents
hasAnyEvents = C_EncounterTimeline.HasAnyEvents()
Returns true if the timeline contains any events in any state.
Returns
hasAnyEvents | bool |
|---|
C_EncounterTimeline.HasPausedEvents
hasPausedEvents = C_EncounterTimeline.HasPausedEvents()
Returns true if the timeline contains any events in the paused state.
Returns
hasPausedEvents | bool |
|---|
C_EncounterTimeline.HasVisibleEvents
hasVisibleEvents = C_EncounterTimeline.HasVisibleEvents()
Returns true if the timeline contains any events that are on visible tracks.
Returns
hasVisibleEvents | bool |
|---|
C_EncounterTimeline.IsEventBlocked
blocked = C_EncounterTimeline.IsEventBlocked(eventID)
Returns true if the event is in a 'blocked' state, where the cast for this event may not occur due to encounter conditions not being met.
Arguments
eventID | EncounterTimelineEventID |
|---|
Returns
blocked | bool |
|---|
C_EncounterTimeline.IsFeatureAvailable
isAvailable = C_EncounterTimeline.IsFeatureAvailable()
Returns true if the encounter timeline feature is available on this client.
Returns
isAvailable | bool |
|---|
C_EncounterTimeline.IsFeatureEnabled
isAvailableAndEnabled = C_EncounterTimeline.IsFeatureEnabled()
Returns true if the encounter timeline feature has been enabled by the player. This function will always return false if the feature is not available.
Returns
isAvailableAndEnabled | bool |
|---|
C_EncounterTimeline.PauseScriptEvent
C_EncounterTimeline.PauseScriptEvent(eventID)
Pauses a custom timeline event, hiding it from the timeline. A paused event can later be resumed to show it again, or canceled.
Arguments
eventID | EncounterTimelineEventID |
|---|
C_EncounterTimeline.ResumeScriptEvent
C_EncounterTimeline.ResumeScriptEvent(eventID)
Resumes a custom timeline event, showing it on the timeline again if it is currently paused.
Arguments
eventID | EncounterTimelineEventID |
|---|
C_EncounterTimeline.SetEventIconTextures
C_EncounterTimeline.SetEventIconTextures(eventID, includeIcons, textures)
Updates a given vector of texture objects to reference art assets for icons associated with an event.
Arguments
eventID | EncounterTimelineEventID | |
|---|---|---|
includeIcons | EncounterEventIconmask | Mask to apply to candidate icons. Any icon bits not present in this set will not be assigned to textures. |
textures | SimpleTexture[] | Array of texture objects to update. This will change the assigned atlases and alpha values of the region, applying secret aspects to protect the data. |
C_EncounterTimeline.SetViewType
C_EncounterTimeline.SetViewType(viewType)
Changes the view type for the timeline. This adjusts track layouts to be more appropriate for a specific mode and optimizes event processing.
Arguments
viewType | EncounterTimelineViewType |
|---|
Events
ENCOUNTER_TIMELINE_EVENT_ADDED
Fired when an event has been added to the timeline.
eventInfo | EncounterTimelineEventInfo |
|---|
ENCOUNTER_TIMELINE_EVENT_BLOCK_STATE_CHANGED
Fired when an event has transitioned into or out of a 'blocked' status.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_EVENT_COLOR_CHANGED
Fired when an event has met a condition that should trigger a color change.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_EVENT_HIGHLIGHT
Fired when an event has met a condition that should trigger its highlight glow animation.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_EVENT_REMOVED
Fired when an event has been removed from the timeline. This is guaranteed to fire after an event has transitioned to a 'final' state such as Canceled or Finished, and will be delayed at least one game tick to allow for API queries to still access event data in OnUpdate scripts. This is fired post-removal of the event, and so queries using the supplied event ID will return nil.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_EVENT_STATE_CHANGED
Fired when an event has changed state.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_EVENT_TRACK_CHANGED
Fired when an event has changed track, or has been re-ordered within its existing track.
eventID | EncounterTimelineEventID |
|---|
ENCOUNTER_TIMELINE_LAYOUT_UPDATED
Fired when the layout of tracks on the timeline has been updated. This can include changes to the minimum or maximum durations of tracks.
No payload.
ENCOUNTER_TIMELINE_STATE_UPDATED
Signaled when conditions controlling the visibility of the encounter timeline are updated.
No payload.
ENCOUNTER_TIMELINE_VIEW_ACTIVATED
Fired when a new timeline view is being activated. This is fired after a full layout and timeline data update, allowing the UI to immediately query the API and get usable results.
viewType | EncounterTimelineViewType |
|---|
ENCOUNTER_TIMELINE_VIEW_DEACTIVATED
Fired when the current timeline view is being deactivated. The UI should clear all stored timeline event data and release all frames back to pools during this event.
viewType | EncounterTimelineViewType |
|---|
Tables
EncounterTimelineEventFilter structure
maxEventCount | number may be nil | Maximum number of sorted events to return. |
|---|---|---|
maxEventDuration | Seconds may be nil | Maximum duration of sorted events to return. |
excludeTerminalStates | bool default true | If false, include events that are terminal states such as Canceled or Finished. |
excludeHiddenEvents | bool default true | If false, include events that should be hidden by user configuration, such as events on long tracks when the user has opted to not show long countdowns. |
EncounterTimelineEventInfo structure
id | EncounterTimelineEventID | Instance ID for this event. |
|---|---|---|
source | EncounterTimelineEventSource | Source that this event came from. |
spellName | string | Spell name associated with this event. For script events, this may instead be the contents of the 'overrideName' field if it wasn't empty. |
spellID | number | Spell ID associated with this event. |
iconFileID | fileID | Icon file ID associated with this event. |
duration | Seconds | Base duration of this event at the point that it was queued onto the timeline. |
maxQueueDuration | Seconds | Hold duration for this event after it reaches the end of the timeline. During this period, the event will sit in the queued track of the timeline until manually finished or this added duration expires. |
icons | EncounterEventIconmask | Bitmask of active icon states for this event. |
severity | EncounterEventSeverity | Severity of this event. |
isApproximate | bool | If true, this event is an approximation and may not occur exactly when the timeline suggests it will. |
EncounterTimelineScriptEventRequest structure
spellID | number | |
|---|---|---|
iconFileID | fileID | |
duration | Seconds | |
maxQueueDuration | Seconds default 0 | |
overrideName | stringView default "" | |
icons | EncounterEventIconmask may be nil | |
severity | EncounterEventSeverity default "Medium" | |
paused | bool default false |
EncounterTimelineTrackInfo structure
id | EncounterTimelineTrack | |
|---|---|---|
type | EncounterTimelineTrackType | |
minimumDuration | Seconds may be nil | The exclusive lower bound of durations for events on this track. If zero, this should be treated as an inclusive lower bound. This bound is ignored by the timeline sequence in circumstances where an adjacent Sorted track would exceed its maximum event count, requiring events be pushed 'to the left' by one track. |
maximumDuration | Seconds may be nil | The inclusive upper bound of durations for events on this track. |
minimumEventIntroDuration | Seconds may be nil | Lower duration bound for events that want to transition onto this track from an Indeterminate position. Events below this duration are artificially kept in the indeterminate track state until they can transition into a later track in the timeline sequence. |
minimumEventGapDuration | Seconds may be nil | Minimum duration gap that must exist between two sequential candidate events for this track. If two event durations have a distance under this figure, the later of the two events will be artifically kept in the indeterminate track state until it can transition into a later track in the timeline sequence. |
maximumEventCount | number may be nil | The maximum number of events permitted within this track. This only applies to Sorted tracks. |
sortDirection | EncounterTimelineEventSortDirection may be nil | Sort ordering for events within this track. This only applies to Sorted tracks. |