레퍼런스 › 함수 레퍼런스 › Platform

Platform.spells.IsAutoRepeatActive

공개

호출 방법

addon.Platform:IsAutoRepeatActive(spellID)

addon을 통해 바로 쓸 수 있으며, 의존성이 필요 없습니다.

하는 일

사격이나 자동 사격 같은 주문의 플레이어 자동 반복 상태를 읽습니다. 현재 시전이나 대기열 시전과는 다릅니다. 최신 클라이언트는 정확한 주문 ID를 받고, 이전 방식 조회는 먼저 플레이어 주문서 칸을 확인합니다. 제한된 클라이언트 정책, 읽을 수 없는 결과, 사용할 수 없는 주문서 칸은 nil과 이유를 반환합니다. 상태만 관찰하며 주문을 시작하거나 멈추지 않습니다.

인수

이름유형하는 일
selfRMPlatformRotation Master 플랫폼 어댑터 (콜론 호출에서는 암묵적).
spellIDnumber주문서 칸이 아닌 양의 정수 주문 ID.

반환값

1boolean | nil클라이언트가 이 주문이 자동 반복 중이라고 보고하면 true, 비활성이라고 보고하면 false, 사용할 수 없으면 nil.
2string | nilnil 결과에 대한 검증 또는 사용 불가 이유.

버전

기본 제공 도우미는 모든 버전에 등록됩니다. 다른 점은 읽는 게임 API이며, API가 없으면 도우미는 대체 동작을 하거나 이유와 함께 nil을 반환합니다.

  • 해당 버전에서 사용할 수 없음 (이유는 툴팁에 표시)
  • Blizzard의 지원 중단 대체 함수가 켜져 있을 때만
게임 APIClassic EraTBC AnniversaryClassic progressionForeverRetail
C_Spell.IsAutoRepeatSpellClassic EraTBC AnniversaryClassic progressionForeverRetail
FindSpellBookSlotBySpellIDClassic EraTBC AnniversaryClassic progressionForeverRetail
IsAutoRepeatSpellClassic EraTBC AnniversaryClassic progressionForeverRetail

비공개 값 (Retail과 Forever)

Retail과 Forever에서는 게임이 애드온에 비공개 값을 넘깁니다. 이 도우미는 읽는 값을 확인하고(addon.Platform:CanReadValue), 비교할 수 없는 비공개 값 대신 restricted-value 같은 이유와 함께 nil을 반환합니다. nil은 거짓이 아니라 사용할 수 없음으로 취급하세요.

예시

local shooting = addon.Platform:IsAutoRepeatActive(75) -- Auto Shot
if shooting == nil then return nil end
return not shooting

의존성

소스

Platform/spells.lua, 697번째 줄. 게임에서는 읽기 전용이며, 복제하면 편집 가능한 사본이 생깁니다.

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

함수 레퍼런스(으)로 돌아가기