Call as
Platform.runes.validIndex(self, index)
Record the dependency Platform.runes.validIndex, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.
What it does
Validates a rune slot index. Returns true for a readable integer from 1 through 6; otherwise nil with "restricted-value" or "invalid-rune-index".
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (normally addon.Platform), used for its CanReadValue check. |
index | any | Rune slot index to validate. |
Returns
| 1 | boolean | nil | True when index is a valid rune slot; nil otherwise. |
|---|---|---|
| 2 | string | nil | Reason when invalid. |
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.
It reads no game API directly.
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.
How the addon calls it
Platform.runes.GetRuneCooldownObservationlocal valid,reason=validIndex(self,index)Platform.runes.GetRuneTypeObservationlocal valid,reason=validIndex(self,index)
Dependencies
finite→Platform.runes.finite
Source
Platform/runes.lua, line 24. Read only in game; Duplicate makes an editable copy.
Platform.runes.validIndex(self, index)
if not self:CanReadValue(index) then return nil,'restricted-value' end
if not finite(index) or index%1~=0 or index<1 or index>6 then return nil,'invalid-rune-index' end
return true