Add notifications for essence
This commit is contained in:
19
Heimdall.lua
19
Heimdall.lua
@@ -78,6 +78,7 @@ local function init()
|
|||||||
---@field networkMessenger HeimdallNetworkMessengerConfig
|
---@field networkMessenger HeimdallNetworkMessengerConfig
|
||||||
---@field configurator HeimdallConfiguratorConfig
|
---@field configurator HeimdallConfiguratorConfig
|
||||||
---@field stinkyCache HeimdallStinkyCacheConfig
|
---@field stinkyCache HeimdallStinkyCacheConfig
|
||||||
|
---@field essencex HeimdallEssencexConfig
|
||||||
---@field whisperNotify table<string, string>
|
---@field whisperNotify table<string, string>
|
||||||
---@field addonPrefix string
|
---@field addonPrefix string
|
||||||
---@field stinkies table<string, boolean>
|
---@field stinkies table<string, boolean>
|
||||||
@@ -248,6 +249,17 @@ local function init()
|
|||||||
---@field commander string
|
---@field commander string
|
||||||
---@field ttl number
|
---@field ttl number
|
||||||
|
|
||||||
|
---@class HeimdallEssencexConfig
|
||||||
|
---@field enabled boolean
|
||||||
|
---@field debug boolean
|
||||||
|
---@field masterChannel string
|
||||||
|
---@field who boolean
|
||||||
|
---@field spotter boolean
|
||||||
|
--/run Heimdall_Data.config.essencex.masterChannel="EssenceAgent"
|
||||||
|
--/run Heimdall_Data.config.essencex.enabled=true
|
||||||
|
--/run Heimdall_Data.config.essencex.spotter=true
|
||||||
|
--/run Heimdall_Data.config.essencex.who=true
|
||||||
|
|
||||||
--- Data ---
|
--- Data ---
|
||||||
---@class HeimdallMessengerData
|
---@class HeimdallMessengerData
|
||||||
---@field queue table<string, Message>
|
---@field queue table<string, Message>
|
||||||
@@ -495,6 +507,13 @@ local function init()
|
|||||||
commander = shared.GetOrDefault(Heimdall_Data, { "config", "stinkyCache", "commander" }, "Heimdállr"),
|
commander = shared.GetOrDefault(Heimdall_Data, { "config", "stinkyCache", "commander" }, "Heimdállr"),
|
||||||
ttl = shared.GetOrDefault(Heimdall_Data, { "config", "stinkyCache", "ttl" }, 10),
|
ttl = shared.GetOrDefault(Heimdall_Data, { "config", "stinkyCache", "ttl" }, 10),
|
||||||
},
|
},
|
||||||
|
essencex = {
|
||||||
|
enabled = shared.GetOrDefault(Heimdall_Data, { "config", "essencex", "enabled" }, false),
|
||||||
|
debug = shared.GetOrDefault(Heimdall_Data, { "config", "essencex", "debug" }, false),
|
||||||
|
masterChannel = shared.GetOrDefault(Heimdall_Data, { "config", "essencex", "masterChannel" }, "Essencex"),
|
||||||
|
who = shared.GetOrDefault(Heimdall_Data, { "config", "essencex", "who" }, false),
|
||||||
|
spotter = shared.GetOrDefault(Heimdall_Data, { "config", "essencex", "spotter" }, false),
|
||||||
|
},
|
||||||
addonPrefix = shared.GetOrDefault(Heimdall_Data, { "config", "addonPrefix" }, "HEIMDALL"),
|
addonPrefix = shared.GetOrDefault(Heimdall_Data, { "config", "addonPrefix" }, "HEIMDALL"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -955,7 +955,7 @@ function shared.Config.Init()
|
|||||||
Heimdall_Data.config.inviter.listeningChannel,
|
Heimdall_Data.config.inviter.listeningChannel,
|
||||||
function(self)
|
function(self)
|
||||||
local text = self:GetText()
|
local text = self:GetText()
|
||||||
if string.match(text, "%d+") then
|
if string.match(text, "%D+") then
|
||||||
Heimdall_Data.config.inviter.listeningChannel = text
|
Heimdall_Data.config.inviter.listeningChannel = text
|
||||||
print("Listening channel set to", tostring(text))
|
print("Listening channel set to", tostring(text))
|
||||||
else
|
else
|
||||||
|
@@ -153,6 +153,7 @@ function shared.Spotter.Init()
|
|||||||
print(string.format("[%s] Player %s coordinates: %.2f, %.2f", ModuleName, name, x * 100, y * 100))
|
print(string.format("[%s] Player %s coordinates: %.2f, %.2f", ModuleName, name, x * 100, y * 100))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local pvpOn = UnitIsPVP(unit)
|
||||||
local stinky = shared.IsStinky(name) or false
|
local stinky = shared.IsStinky(name) or false
|
||||||
SetMapToCurrentZone()
|
SetMapToCurrentZone()
|
||||||
SetMapByID(GetCurrentMapAreaID())
|
SetMapByID(GetCurrentMapAreaID())
|
||||||
@@ -163,6 +164,7 @@ function shared.Spotter.Init()
|
|||||||
stinky and string.format("(%s)", "!!!!") or "",
|
stinky and string.format("(%s)", "!!!!") or "",
|
||||||
race,
|
race,
|
||||||
faction,
|
faction,
|
||||||
|
pvpOn and shared.L.en.tidbits.pvpOn or shared.L.en.tidbits.pvpOff,
|
||||||
string.gsub(FormatHP(hp), "M", "kk"),
|
string.gsub(FormatHP(hp), "M", "kk"),
|
||||||
string.gsub(FormatHP(maxHp), "M", "kk"),
|
string.gsub(FormatHP(maxHp), "M", "kk"),
|
||||||
location,
|
location,
|
||||||
@@ -210,11 +212,20 @@ function shared.Spotter.Init()
|
|||||||
stinky and string.format("(%s)", "!!!!") or "",
|
stinky and string.format("(%s)", "!!!!") or "",
|
||||||
ruRace or race,
|
ruRace or race,
|
||||||
ruFaction or faction,
|
ruFaction or faction,
|
||||||
FormatHP(hp),
|
pvpOn and shared.L.ru.tidbits.pvpOn or shared.L.ru.tidbits.pvpOff,
|
||||||
FormatHP(maxHp),
|
string.gsub(FormatHP(hp), "M", "kk"),
|
||||||
|
string.gsub(FormatHP(maxHp), "M", "kk"),
|
||||||
string.format("%s (%s)", ruZone or zone, ruSubzone or subzone),
|
string.format("%s (%s)", ruZone or zone, ruSubzone or subzone),
|
||||||
tostring(GetCurrentMapAreaID()),
|
tostring(GetCurrentMapAreaID()),
|
||||||
x * 100, y * 100)
|
x * 100, y * 100)
|
||||||
|
if Heimdall_Data.config.essencex.spotter and Heimdall_Data.config.essencex.enabled then
|
||||||
|
local msg = {
|
||||||
|
channel = "CHANNEL",
|
||||||
|
data = Heimdall_Data.config.essencex.masterChannel,
|
||||||
|
message = text
|
||||||
|
}
|
||||||
|
table.insert(shared.messenger.queue, msg)
|
||||||
|
end
|
||||||
|
|
||||||
if Heimdall_Data.config.spotter.debug then
|
if Heimdall_Data.config.spotter.debug then
|
||||||
print(string.format("[%s] Sending notification: %s", ModuleName, text))
|
print(string.format("[%s] Sending notification: %s", ModuleName, text))
|
||||||
|
@@ -200,6 +200,10 @@ function shared.Whoer.Init()
|
|||||||
}
|
}
|
||||||
--table.insert(shared.messenger.queue, msg)
|
--table.insert(shared.messenger.queue, msg)
|
||||||
table.insert(shared.networkMessenger.queue, msg)
|
table.insert(shared.networkMessenger.queue, msg)
|
||||||
|
if Heimdall_Data.config.essencex.who and Heimdall_Data.config.essencex.enabled then
|
||||||
|
msg.data = Heimdall_Data.config.essencex.masterChannel
|
||||||
|
table.insert(shared.messenger.queue, msg)
|
||||||
|
end
|
||||||
|
|
||||||
if Heimdall_Data.config.who.doWhisper then
|
if Heimdall_Data.config.who.doWhisper then
|
||||||
if Heimdall_Data.config.who.debug then
|
if Heimdall_Data.config.who.debug then
|
||||||
@@ -277,6 +281,11 @@ function shared.Whoer.Init()
|
|||||||
}
|
}
|
||||||
--table.insert(shared.messenger.queue, msg)
|
--table.insert(shared.messenger.queue, msg)
|
||||||
table.insert(shared.networkMessenger.queue, msg)
|
table.insert(shared.networkMessenger.queue, msg)
|
||||||
|
if Heimdall_Data.config.essencex.who and Heimdall_Data.config.essencex.enabled then
|
||||||
|
msg.data = Heimdall_Data.config.essencex.masterChannel
|
||||||
|
table.insert(shared.messenger.queue, msg)
|
||||||
|
end
|
||||||
|
|
||||||
if Heimdall_Data.config.who.doWhisper then
|
if Heimdall_Data.config.who.doWhisper then
|
||||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||||
---@type Message
|
---@type Message
|
||||||
@@ -331,6 +340,12 @@ function shared.Whoer.Init()
|
|||||||
}
|
}
|
||||||
--table.insert(shared.messenger.queue, msg)
|
--table.insert(shared.messenger.queue, msg)
|
||||||
table.insert(shared.networkMessenger.queue, msg)
|
table.insert(shared.networkMessenger.queue, msg)
|
||||||
|
if Heimdall_Data.config.essencex.who and Heimdall_Data.config.essencex.enabled then
|
||||||
|
--if player.guild == "БеспредеЛ" then
|
||||||
|
msg.data = Heimdall_Data.config.essencex.masterChannel
|
||||||
|
table.insert(shared.messenger.queue, msg)
|
||||||
|
--end
|
||||||
|
end
|
||||||
|
|
||||||
if Heimdall_Data.config.who.doWhisper then
|
if Heimdall_Data.config.who.doWhisper then
|
||||||
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
for _, name in pairs(Heimdall_Data.config.whisperNotify) do
|
||||||
|
8
_L.lua
8
_L.lua
@@ -10,7 +10,7 @@ shared.L = {
|
|||||||
bonkDetected = "%s hit %s (%s)",
|
bonkDetected = "%s hit %s (%s)",
|
||||||
combatAlerterInCombat = "I am in combat with %s at %s (%s) at [%s](%2.2f, %2.2f)",
|
combatAlerterInCombat = "I am in combat with %s at %s (%s) at [%s](%2.2f, %2.2f)",
|
||||||
snifferStinky = "I smell a stinky %s",
|
snifferStinky = "I smell a stinky %s",
|
||||||
spotterSpotted = "I see (%s) %s/%s %s of race %s (%s) with health %s/%s at %s [%s](%2.2f, %2.2f)",
|
spotterSpotted = "I see (%s) %s/%s %s of race %s (%s) with pvp %s and health %s/%s at %s [%s](%2.2f, %2.2f)",
|
||||||
whoerNew = "%s %s of class %s, race %s (%s) and guild %s in %s, first seen: %s, last seen: %s, times seen: %d",
|
whoerNew = "%s %s of class %s, race %s (%s) and guild %s in %s, first seen: %s, last seen: %s, times seen: %d",
|
||||||
whoerMoved = "%s of class %s (%s - %s) and guild %s moved to %s",
|
whoerMoved = "%s of class %s (%s - %s) and guild %s moved to %s",
|
||||||
whoerGone = "%s of class %s and guild %s left %s",
|
whoerGone = "%s of class %s and guild %s left %s",
|
||||||
@@ -19,6 +19,8 @@ shared.L = {
|
|||||||
hostile = "hostile",
|
hostile = "hostile",
|
||||||
friendly = "friendly",
|
friendly = "friendly",
|
||||||
unknown = "unknown",
|
unknown = "unknown",
|
||||||
|
pvpOn = "ON",
|
||||||
|
pvpOff = "OFF",
|
||||||
},
|
},
|
||||||
config = {
|
config = {
|
||||||
afkThreshold = "Afk Threshold",
|
afkThreshold = "Afk Threshold",
|
||||||
@@ -92,7 +94,7 @@ shared.L = {
|
|||||||
bonkDetected = "%s ударил %s (%s)",
|
bonkDetected = "%s ударил %s (%s)",
|
||||||
combatAlerterInCombat = "Я в бою с %s на %s (%s) на [%s](%2.2f, %2.2f)",
|
combatAlerterInCombat = "Я в бою с %s на %s (%s) на [%s](%2.2f, %2.2f)",
|
||||||
snifferStinky = "Я чувствую запах %s",
|
snifferStinky = "Я чувствую запах %s",
|
||||||
spotterSpotted = "Я вижу (%s) %s/%s %s (%s) с %s/%s здоровьем на %s [%s](%2.2f, %2.2f)",
|
spotterSpotted = "Я вижу (%s) %s/%s %s расы %s (%s) с pvp %s и здоровьем %s/%s на %s [%s](%2.2f, %2.2f)",
|
||||||
whoerNew =
|
whoerNew =
|
||||||
"%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d",
|
"%s %s класса %s, расы %s (%s) и гильдии %s в %s, первый раз видели: %s, последний раз видели: %s, раз видели: %d",
|
||||||
whoerMoved = "%s класса %s (%s - %s) и гильдии %s переместился в %s",
|
whoerMoved = "%s класса %s (%s - %s) и гильдии %s переместился в %s",
|
||||||
@@ -104,6 +106,8 @@ shared.L = {
|
|||||||
hostile = "враждебный",
|
hostile = "враждебный",
|
||||||
friendly = "дружественный",
|
friendly = "дружественный",
|
||||||
unknown = "неизвестный",
|
unknown = "неизвестный",
|
||||||
|
pvpOn = "вкл",
|
||||||
|
pvpOff = "выкл",
|
||||||
},
|
},
|
||||||
config = {
|
config = {
|
||||||
alertSound = "Звук Оповещения",
|
alertSound = "Звук Оповещения",
|
||||||
|
Reference in New Issue
Block a user