function autotrack:CastTrack()
if not UnitExists("target") then return end
if UnitIsFriend("player", "target") then return end
if UnitIsDead ("target") then return end
local ct = UnitCreatureType("target")
local tt = GetTrackingTexture()
local numTrack = GetNumTrackingTypes()
if ct == nil or ct == "" then
return
end
if self.localization and self.localization[ct] then
local lct = self.localization[ct]
if lct == "UNSPECIFIED" then
return
end
for i = 1, numTrack do
local n, t = GetTrackingInfo(i)
if n == lct then
if t ~= tt then
self

oSetTracking(i)
end
end
end
else
ct = strlower(ct)
for i = 1, numTrack do
local n, t = GetTrackingInfo(i)
if string.find(strlower(n), ct) then
if t ~= tt then
self

oSetTracking(i)
end
end
end
end
end
[свернуть]