CHAT_MSG_SYSTEM function(_,msg) if string.match(msg, "X:") and not string.match(msg, "ZoneX:") then aura_env.tX = string.match(msg, "X: [%-*(%d+)%.*]+") or 0 aura_env.tY = string.match(msg, "Y: [%-*(%d+)%.*]+") or 0 aura_env.tX = string.match(aura_env.tX, "[%-*(%d+)%.*]+") aura_env.tY = string.match(aura_env.tY, "[%-*(%d+)%.*]+") end end CHAT_MSG_WHISPER function(_,msg,sender) sender = string.match(sender, "%a+") if sender == UnitName("player") and msg ~= "trackon" and msg ~= "trackoff" and msg ~= "acquiretarget" then aura_env.target = string.match(msg, "%a+") print(aura_env.target) end if msg == "trackon" and aura_env.enable == 0 and sender == UnitName("player") then aura_env.enable = 1 print(aura_env.enable, aura_env.target) end if msg == "trackoff" and aura_env.enable == 1 and sender == UnitName("player") then aura_env.enable = 0 print(aura_env.enable, aura_env.target) end if msg == "acquiretarget" and sender == UnitName("player") then aura_env.target = UnitName("target") print(aura_env.enable, aura_env.target) end end EVERY FRAME function() if aura_env.enable == 1 and aura_env.target ~= nil then local tt = math.floor((GetTime() - aura_env.startTime) * 10) if tt ~= aura_env.lastTime and tt % aura_env.tickRate == 0 then print(aura_env.target) aura_env.lastTime = tt SendChatMessage(".gps " .. aura_env.target, "say") end end end EVERY FRAME function() local function range (val, min, max, max2) val = 1 - (((max - val) / (max - min)) * max2) return val end aura_env.pX = UnitPosition("player") or 0 aura_env.pY = select(2,UnitPosition("player")) or 0 local X = aura_env.pX - aura_env.tX local Y = aura_env.pY - aura_env.tY local playerFace = GetPlayerFacing() or 0 local playerA = math.floor(playerFace * 100) playerA = range(playerA, 0, 630, 360) - 1 playerA = - playerA playerA = playerA - 90 if playerA < 0 then playerA = playerA + 360 end aura_env.hyp = math.sqrt((math.abs(X^2)) + (math.abs(Y^2))) aura_env.angle = math.deg(math.atan2(X,Y)) if aura_env.angle < 0 then aura_env.angle = aura_env.angle + 360 end aura_env.angle = aura_env.angle - playerA end ANIMATION function() return - aura_env.angle end INIT aura_env.pX = UnitPosition("player") or 0 aura_env.pY = select(2,UnitPosition("player")) or 0 aura_env.tX = UnitPosition("player") or 0 aura_env.tY = select(2,UnitPosition("player")) or 0 aura_env.angle = 0 aura_env.target = "" aura_env.enable = 0 aura_env.tickRate = 5 aura_env.startTime = GetTime()