Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
function myCreateTexture(x,y)
local texture = UIParent:CreateTexture()
texture:SetPoint("TOPLEFT", UIParent, "TOPLEFT", x*10, y*10)
texture:SetSize(10,10)
return texture
end
local textures = {
myCreateTexture(0,0),
myCreateTexture(1,0),
}
local timer = CreateFrame("Frame")
timer.elapsed = 0
timer.tick = 0.5
timer.func = function()
local x, y = GetPlayerMapPosition("player");
local x1, x2 = math.modf(x*255)
local y1, y2 = math.modf(y*255)
textures[1]:SetTexture(x1/255, x2, GetPlayerFacing()/7)
textures[2]:SetTexture(y1/255, y2, GetUnitPitch("player")/4+0.5)
end
timer:SetScript("OnUpdate", function(this, elapsed)
this.elapsed = this.elapsed + elapsed
if this.elapsed > this.tick then
this.elapsed = 0
this.func()
end
end)
Создание несложного бота для WoW, программирование маршрутов