Reference › Function reference › Platform

Platform.health_forecast.GetHealthForecastTimeObservation

public

Call as

addon.Platform:GetHealthForecastTimeObservation()

Available directly through addon; no dependency is needed.

What it does

Observe a fresh protected zero-argument GetTime for a needed health forecast. Require readability and a finite number; preserve signed and fractional values without adding a monotonic, integral or nonnegative restriction. No clock cache or extra native query is used.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).

Returns

1number | nilFresh readable finite clock, or nil when unavailable.
2string | nilCapability or clock observation availability reason.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
GetTimeClassic EraTBC AnniversaryClassic progressionForeverRetail
canaccessvalueClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

Example

local now = addon.Platform:GetHealthForecastTimeObservation()
-- value.deadline: a GetTime() timestamp chosen in the condition editor
if not now or type(value.deadline) ~= "number" then return nil end
return now >= value.deadline

Dependencies

Source

Platform/health_forecast.lua, line 130. Read only in game; Duplicate makes an editable copy.

Platform.health_forecast.GetHealthForecastTimeObservation(self)
    if type(GetTime)~='function' then return nil,'missing-api' end
    local ok,now=pcall(GetTime)
    if not ok then return nil,'api-error' end
    if not self:CanReadValue(now) then return nil,'restricted-value' end
    if canaccessvalue and not canaccessvalue(now) then return nil,'restricted-value' end
    if not finite(now) then return nil,'invalid-forecast-time' end
    return now

Back to Function reference