Llamar como
addon.Platform:IsAutoRepeatActive(spellID)
Disponible directamente a través de addon; no se necesita ninguna dependencia.
Qué hace
Lee el estado de repetición automática del jugador para un hechizo como Disparar o Disparo automático. Es distinto de un lanzamiento actual o en cola. Los clientes modernos reciben el ID de hechizo exacto; una consulta antigua resuelve primero la casilla del libro de hechizos del jugador. Las políticas restringidas del cliente, los resultados ilegibles y las casillas del libro no disponibles devuelven nil con un motivo. Observa el estado y nunca inicia ni detiene un hechizo.
Argumentos
| Nombre | Tipo | Qué hace |
|---|---|---|
self | RMPlatform | Adaptador de plataforma de Rotation Master (implícito en las llamadas con dos puntos). |
spellID | number | ID de hechizo entero positivo, no una casilla del libro de hechizos. |
Retornos
| 1 | boolean | nil | True si el cliente indica que este hechizo se repite automáticamente; false si indica que está inactivo; nil si no está disponible. |
|---|---|---|
| 2 | string | nil | Motivo de validación o disponibilidad para un resultado nil. |
Ediciones
Las funciones auxiliares integradas se registran en todas las ediciones. Lo que cambia es la API del juego que leen; donde falta alguna, la función auxiliar usa una alternativa o devuelve nil con un motivo.
- No disponible en esa edición (el motivo aparece en la información emergente)
- Solo mientras estén activas las alternativas de Blizzard para API obsoletas
Valores secretos (Retail y Forever)
En Retail y Forever, el juego les entrega a los addons valores secretos. Esta función auxiliar verifica lo que lee (addon.Platform:CanReadValue) y, en lugar de un secreto que no puede comparar, devuelve nil con un motivo como restricted-value. Trata nil como no disponible, no como falso.
Ejemplo
local shooting = addon.Platform:IsAutoRepeatActive(75) -- Auto Shot
if shooting == nil then return nil end
return not shootingDependencias
identifier→Platform.spells.identifier
Código fuente
Platform/spells.lua, línea 697. Solo lectura en el juego; Duplicar crea una copia editable.
Platform.spells.IsAutoRepeatActive(self, spellID)
local policy=self:GetCombatDataPolicy()
if policy~='probe' and policy~='restricted' then return nil,'unsupported-policy' end
local valid,reason=identifier(spellID,true)
if not valid then return nil,reason end
local native=C_Spell and C_Spell.IsAutoRepeatSpell
local ok,active
if type(native)=='function' then
ok,active=pcall(native,spellID)
else
if type(IsAutoRepeatSpell)~='function' or type(FindSpellBookSlotBySpellID)~='function' then return nil,'missing-api' end
local found,slot=pcall(FindSpellBookSlotBySpellID,spellID,false)
if not found then return nil,'api-error' end
if not self:CanReadValue(slot) then return nil,'restricted-value' end
if slot==nil then return nil,'spell-not-in-book' end
if type(slot)~='number' or slot<1 or slot==math.huge or slot%1~=0 then return nil,'invalid-api-result' end
ok,active=pcall(IsAutoRepeatSpell,slot,BOOKTYPE_SPELL or 'spell')
end
if not ok then return nil,'api-error' end
if not self:CanReadValue(active) then return nil,'restricted-value' end
if type(native)~='function' then
if active==0 then active=false elseif active==1 then active=true end
end
if type(active)~='boolean' then return nil,'invalid-api-result' end
return active




