EloiStree / HelloWarcraftQAXR

Learn coding by creating bot and script for QA on Wow and other games through XR.
1 stars 0 forks source link

Note: Position are not usable with LUA in wow when in instance. What else ? #77

Open EloiStree opened 6 months ago

EloiStree commented 6 months ago

Following code allow color picking outside of instance.
World map and facing all stop working in instance.

function(progress, r1, g1, b1, a1, r2, g2, b2, a2)
    posX=0
    posY=0
    facing=0

    if IsInInstance() then
        posX = 0
        posY = 0
        facing=0
    else
        local map = C_Map.GetBestMapForUnit("player");
        local pos = C_Map.GetPlayerMapPosition(map,"player");
        local posX,posY = pos:GetXY()
        local facing = GetPlayerFacing() / (2*3.1418)
    end

    return posX,posY,facing,1
end