Макрос на свич Windfury Totem и Grace of Air Totem
Описание:Если нет ВФ бафа на группе - ставит вф тотем, иначе ничего не делает.
Если прошло менее 1 секунды или менее 1+ гкд (для первого тика) после установки вф тотема - ставит тотем на агилу, иначе ничего не делает.
Установка:Нужен
супермакро и английский клиент.

53203352.jpg (74.41 КБ) Просмотров: 4080
Текст макроса (вставляем в левое окно, как на картинке):
- Код: Выделить всё
/run TotemThot()
Lua код макроса (вставляем в правое окно, как на картинке):
- Код: Выделить всё
shLatencyCorrection = 0.052
shScriptDelay = 0.03
shTimeGap = 1
function TotemThot()
local Time = GetTime()
local Latency
if shLatencyCorrection then
Latency = shLatencyCorrection
else
_,_,Latency=GetNetStats()
end
if not LastTotemIsWf then
if LastWfTotemReleaseTime > LastWfTotemTime then
local LastTick = GetLastTick(LastWfTotemReleaseTime, LastWfTotemTime, Latency)
if LastTick and Time - LastWfTotemTime + Latency < 130 then
local value = Time-LastTick
if value < 10 then
if not buffed("Grace of Air") and value < shTimeGap then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
else
CastSpellByName("Windfury Totem")
end
else
CastSpellByName("Windfury Totem")
end
else
CastSpellByName("Windfury Totem")
end
else
local LastTick=GetLastTick(Time, LastWfTotemTime, Latency)
if LastTick then
local value = Time - LastTick
if Time - LastWfTotemTime < shTimeGap+1.5 then -- 1st tick
if not buffed("Grace of Air") and value < shTimeGap+1.5 then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
else -- other tick
if not buffed("Grace of Air") and value < shTimeGap and value > shScriptDelay then
CastSpellByName("Grace of Air Totem")
else return "yes"
end
end
else -- nobody can even remember what wf is
CastSpellByName("Windfury Totem")
end
end
end
function GetLastTick(time1, time2, Latency)
local duration = time1 - time2
if duration + Latency > 130 then return nil end
duration = duration+10-math.ceil(duration/10)*10
if duration>5 then duration=duration-5 end
return (time1 - duration)
end
function wvShamanFrameOnEvent()
local Latency
if shLatencyCorrection then
Latency = shLatencyCorrection
else
_,_,Latency=GetNetStats()
end
if string.find(arg1 or "","You cast Windfury Totem")then
LastWfTotemTime=GetTime()-Latency
LastTotemIsWf=true
elseif
string.find(arg1 or "","You cast Grace of Air Totem")
or
string.find(arg1 or "","You cast Windwall Totem")
or
string.find(arg1 or "","You cast Sentry Totem")
or
string.find(arg1 or "","You cast Nature Resistance Totem")
or
string.find(arg1 or "","You cast Grounding Totem")
or
string.find(arg1 or "","You cast Tranquil Air Totem")
then
if LastTotemIsWf then LastWfTotemReleaseTime=GetTime()-Latency end
LastTotemIsWf=false
end
end
if not wvShamanFrame then
LastWfTotemTime=0
LastWfTotemReleaseTime=0
LastTotemIsWf=false
wvShamanFrame=CreateFrame("FRAME","wvShamanFrame")
wvShamanFrame:RegisterEvent("CHAT_MSG_SPELL_SELF_BUFF")
wvShamanFrame:SetScript("OnEvent", wvShamanFrameOnEvent)
end
Настройка:shLatencyCorrection = 0.052 (вместо 52 мс укажите свой СРЕДНИЙ пинг)
shScriptDelay = 0.03 (вместо 30 мс укажите разницу между максимальным и минимальным пингом не учитывая лаги сервера, затем добавляйте постепенно по 10-20мс или как пожелайте, пока макрос не будет работать идеально)