Reference › Function reference › Platform

Platform.runes.GetRuneTypeObservation

public

Call as

addon.Platform:GetRuneTypeObservation(index)

Available directly through addon; no dependency is needed.

What it does

Observe one exact native rune slot using GetRuneType with its single index argument. Require a readable finite positive integral type; known future numeric types remain distinct from the selected type, and Death is an exact type rather than a wildcard. Missing, failed, restricted or malformed observations remain unavailable. No class, unit, count or inferred base-rune query is added.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).
indexnumberExact integral native rune slot from 1 through 6.

Returns

1number | nilReadable finite positive integral rune type, or nil when unavailable.
2string | nilPolicy, slot-validation or required observation availability reason for a nil type.

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
GetRuneTypeClassic 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 death = 0
for index = 1, 6 do
  local runeType = addon.Platform:GetRuneTypeObservation(index)
  if runeType == nil then return nil end
  if runeType == 4 then death = death + 1 end -- 4 is a Death rune
end
return death >= 2

Dependencies

Source

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

Platform.runes.GetRuneTypeObservation(self, index)
    local policy=self:GetCombatDataPolicy()
    if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
    local valid,reason=validIndex(self,index)
    if not valid then return nil,reason end
    local api=GetRuneType
    if type(api)~='function' then return nil,'missing-api' end
    local ok,value=pcall(api,index)
    if not ok then return nil,'api-error' end
    local runeType,why=numberField(self,value,'rune-type-unavailable')
    if runeType==nil then return nil,why end
    if runeType<=0 or runeType%1~=0 then return nil,'invalid-api-result' end
    return runeType

Back to Function reference