Вывод фрейма как уведомление (Lua)
Пишу профиль под одну софтину для автоматизации в World of Warcraft. Нужно сделать проверку на игровой мир, и вывод сообщения. Проблема в том что сообщение либо выводится и при этом выключается профиль, либо не выводится вообще.
Функция на проверку игрового мира;
data.SirusCheck = function()
local result = false
if (GetRealmName() == "Scourge x2 - 3.3.5a+"
or GetRealmName() == "Neltharion x3 - 3.3.5a+"
or GetRealmName() == "Sirus x10 - 3.3.5a+"
or GetRealmName() == "Algalon x4 - 3.3.5a") then
result = true
end
return result
end
А вот и кусок профиля
if build == 30300 and data and toolkit and data.SirusCheck() then
---- Весь код вот тут
ni.bootstrap.profile("Retri_DarhangeR", queue, abilities, OnLoad, OnUnLoad);
else
local queue = {
"Error",
}
local abilities = {
["Error"] = function()
ni.vars.profiles.enabled = false;
if build > 30300 then
ni.frames.floatingtext:message("This profile is meant for WotLK 3.3.5a! Sorry!")
elseif data == nil then
ni.frames.floatingtext:message("Data file is missing or corrupted!");
elseif toolkit == nil then
ni.frames.floatingtext:message("Toolkit file is missing or corrupted!")
end
end,
}
ni.bootstrap.profile("Retri_DarhangeR", queue, abilities);
end
Идея в том, что бы было что-то типа такого:
if data.SirusCheck() then
ni.frames.floatingtext:message("Вы тут, поздравляю!")
end
А в самой игре имело вид:
