Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Core/MultiBotEngine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,23 @@ local function _mbStrategySubject(commandScope, target)
return commandScope
end

local function _mbStrategyReasonText(reason)
reason = tostring(reason or "")
local code = string.match(reason, "^([A-Z][A-Z0-9_]*)$")
if(not code) then
code = string.match(reason, "^([A-Z][A-Z0-9_]*)~")
end
if(not code) then
code = "UNKNOWN"
end

local fallback = MultiBot.L("strategy.reason.UNKNOWN", "The strategy command failed for an unknown reason.")
return MultiBot.L("strategy.reason." .. code, fallback)
Comment thread
Wishmaster117 marked this conversation as resolved.
end

local function _mbWarnStrategyMutationBlocked(commandScope, target, reason)
local subject = _mbStrategySubject(commandScope, target)
local detail = tostring(reason or "STRATEGY_REJECTED")
local detail = _mbStrategyReasonText(reason or "STRATEGY_REJECTED")
local message = string.format(MultiBot.L("strategy.warning.blocked"), subject, detail)

if(DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.AddMessage) then
Expand Down
39 changes: 39 additions & 0 deletions Locales/MultiBotAceLocale-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ local deDEValues = {
["profession.recipes.craft.reason.LOST_CONTROL"] = "Der Bot kann gerade nicht handeln.",
["profession.recipes.craft.reason.CHANNELING"] = "Der Bot kanalisiert bereits einen Zauber.",
["profession.recipes.craft.reason.cast_code"] = "Der Server hat den Zauber abgelehnt (Code %s).",
["profession.recipes.craft.reason.UNKNOWN"] = "Der Server hat einen unbekannten Herstellungsfehler gemeldet.",
["character.tab.skills"] = "Fertigkeiten",
["character.tab.reputations"] = "Ruf",
["character.tab.emblems"] = "Abzeichen",
Expand Down Expand Up @@ -148,6 +149,9 @@ local deDEValues = {
["info.inventory.item_action.reason.BUY_FAILED"] = "Kauf fehlgeschlagen.",
["info.inventory.item_action.reason.NOT_SUPPORTED"] = "Diese Aktion wird von der Bridge noch nicht unterstützt.",
["info.inventory.item_action.reason.FAILED"] = "Die Aktion ist fehlgeschlagen.",
["info.inventory.item_action.reason.FORBIDDEN"] = "Du darfst diesen Bot nicht steuern.",
["info.inventory.item_action.reason.RATE_LIMIT"] = "Zu viele Gegenstandsaktionen. Versuche es gleich erneut.",
["info.inventory.item_action.reason.UNKNOWN"] = "Der Server hat einen unbekannten Fehler bei der Gegenstandsaktion gemeldet.",
["tips.units.rti"] = "RTI",
["tips.inventory.bank.deposit"] = "In die Bank einzahlen|cffffffff\nKlicke auf einen Gegenstand, um die entsprechenden Stapel aus den Taschen des Bots in seine Bank zu verschieben.\nDer Bot muss sich in der Nähe eines Bankiers befinden.|r\n\n|cffff0000Betrifft nur den Bot, dessen Inventar geöffnet ist.|r",
["tips.inventory.gbank.deposit"] = "In die Gildenbank einzahlen|cffffffff\nKlicke auf einen Gegenstand, um die entsprechenden Stapel aus den Taschen des Bots in den ersten Reiter der Gildenbank zu verschieben.\nDer Bot muss sich in der Nähe einer Gildenbank befinden und Einzahlungsrechte besitzen.|r\n\n|cffff0000Betrifft nur den Bot, dessen Inventar geöffnet ist.|r",
Expand Down Expand Up @@ -1012,6 +1016,7 @@ local deDEValues = {
["info.trainer.reason.NO_SPELL"] = "Zauber nicht gefunden.",
["info.trainer.reason.NO_MATCHING_SPELL"] = "Dieser Zauber ist nicht mehr verfügbar.",
["info.trainer.reason.TOO_EXPENSIVE"] = "Der Bot hat nicht genug verfügbares Geld.",
["info.trainer.reason.UNKNOWN"] = "Der Server hat einen unbekannten Lehrerfehler gemeldet.",
["tips.outfits.equip"] = "Linksklick: Ausrüsten\nRechtsklick: Ersetzen",
-- Chatless formation query
["tips.tankFace"] = "Tank Face|cffffffff\nAktiviert die Positionierungsstrategie Tank Face.\nWenn der Bot im Nahkampf Aggro hat, versucht er, das Ziel von der Gruppe wegzudrehen.\nDiese Strategie weist keine Tank-Rolle zu und ist unabhängig von Tank und Tank-Assist.|r\n\n|cffff0000Linksklicken, um Tank Face ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: Bot)|r",
Expand All @@ -1036,6 +1041,40 @@ local deDEValues = {
["formation.name.unknown"] = "Unbekannt",
["strategy.warning.blocked"] = "|cffff4444[MultiBot]|r %s: Strategiebefehl fehlgeschlagen (%s). Es wurde kein Fallback über den Chat gesendet.",
["strategy.warning.refused"] = "MultiBot: Strategiebefehl abgelehnt - %s",
["strategy.reason.STRATEGY_BRIDGE_UNAVAILABLE"] = "Die Strategie-Bridge ist nicht verfügbar.",
["strategy.reason.STRATEGY_NOT_CONNECTED"] = "Die Strategie-Bridge ist nicht verbunden.",
["strategy.reason.DISCONNECTED"] = "Die Verbindung zur Strategie-Bridge wurde getrennt.",
["strategy.reason.STRATEGY_CAPABILITY_UNAVAILABLE"] = "Die verbundene Bridge unterstützt keine Strategieänderungen.",
["strategy.reason.STRATEGY_CLIENT_UNAVAILABLE"] = "Strategieänderungen sind im Addon nicht verfügbar.",
["strategy.reason.STRATEGY_UNAVAILABLE"] = "Strategieänderungen sind nicht verfügbar.",
["strategy.reason.STRATEGY_REJECTED"] = "Der Strategiebefehl wurde abgelehnt.",
["strategy.reason.STRATEGY_INVALID_RESULT"] = "Die Bridge hat ein ungültiges Strategieergebnis geliefert.",
["strategy.reason.STRATEGY_SEND_FAILED"] = "Der Strategiebefehl konnte nicht gesendet werden.",
["strategy.reason.STRATEGY_INVALID_SCOPE"] = "Ungültiger Zielbereich für die Strategie.",
["strategy.reason.STRATEGY_TARGET_REQUIRED"] = "Ein Bot-Ziel ist erforderlich.",
["strategy.reason.STRATEGY_TARGET_NOT_ALLOWED"] = "Für diesen Bereich ist kein Bot-Ziel erlaubt.",
["strategy.reason.STRATEGY_INVALID_STATE_SCOPE"] = "Ungültiger Strategie-Bereich für Kampf/Nichtkampf.",
["strategy.reason.STRATEGY_INVALID_CHANGES"] = "Ungültige Strategieänderungen.",
["strategy.reason.STRATEGY_TOO_MANY_REQUESTS"] = "Zu viele Strategieanfragen sind noch offen.",
["strategy.reason.STRATEGY_TIMEOUT"] = "Die Strategieanfrage hat das Zeitlimit überschritten.",
["strategy.reason.TIMEOUT"] = "Die Strategieanfrage hat das Zeitlimit überschritten.",
["strategy.reason.BAD_FIELD_COUNT"] = "Fehlerhaft aufgebaute Strategieanfrage.",
["strategy.reason.BAD_SCOPE"] = "Ungültiger Zielbereich für die Strategie.",
["strategy.reason.BAD_ENCODING"] = "Ungültig codierte Strategiedaten.",
["strategy.reason.BAD_TARGET"] = "Ungültiges Strategieziel.",
["strategy.reason.BAD_TOKEN"] = "Ungültiges Token der Strategieanfrage.",
["strategy.reason.BAD_STATE"] = "Ungültiger Strategiestatus.",
["strategy.reason.BAD_CHANGES"] = "Ungültige Strategieänderungen.",
["strategy.reason.BAD_OPERATION"] = "Ungültige Strategieoperation.",
["strategy.reason.BAD_STRATEGY"] = "Ungültiger Strategiename.",
["strategy.reason.TOO_MANY_OPERATIONS"] = "Zu viele Strategieänderungen in einer Anfrage.",
["strategy.reason.RATE_LIMIT"] = "Zu viele Strategieanfragen. Versuche es gleich erneut.",
["strategy.reason.NO_MATCH"] = "Kein steuerbarer Bot passt zur Strategieanfrage.",
["strategy.reason.BOT_LIMIT"] = "Zu viele Bots passen zur Strategieanfrage.",
["strategy.reason.PARTIAL"] = "Der Strategiebefehl wurde nur teilweise angewendet.",
["strategy.reason.FAILED"] = "Der Strategiebefehl ist fehlgeschlagen.",
["strategy.reason.ACK_TOO_LONG"] = "Die Strategiebestätigung ist zu groß.",
["strategy.reason.UNKNOWN"] = "Der Strategiebefehl ist aus unbekanntem Grund fehlgeschlagen.",
["info.outfits.feedback_equip"] = "Outfit „%s“ ausgerüstet.",
["info.outfits.feedback_replace"] = "Outfit „%s“ ersetzt.",
["info.outfits.feedback_update"] = "Outfit „%s“ aktualisiert.",
Expand Down
39 changes: 39 additions & 0 deletions Locales/MultiBotAceLocale-enGB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ local enGBValues = {
["profession.recipes.craft.reason.LOST_CONTROL"] = "The bot cannot act right now.",
["profession.recipes.craft.reason.CHANNELING"] = "The bot is already channeling a spell.",
["profession.recipes.craft.reason.cast_code"] = "The server refused the cast (code %s).",
["profession.recipes.craft.reason.UNKNOWN"] = "The server returned an unknown crafting error.",
["character.tab.skills"] = "Skills",
["character.tab.reputations"] = "Reputations",
["character.tab.emblems"] = "Emblems",
Expand Down Expand Up @@ -148,6 +149,9 @@ local enGBValues = {
["info.inventory.item_action.reason.BUY_FAILED"] = "Purchase failed.",
["info.inventory.item_action.reason.NOT_SUPPORTED"] = "This action is not supported by the bridge yet.",
["info.inventory.item_action.reason.FAILED"] = "The action failed.",
["info.inventory.item_action.reason.FORBIDDEN"] = "You are not allowed to control this bot.",
["info.inventory.item_action.reason.RATE_LIMIT"] = "Too many item actions. Try again in a moment.",
["info.inventory.item_action.reason.UNKNOWN"] = "The server returned an unknown item-action error.",
["tips.units.rti"] = "RTI",
["tips.inventory.bank.deposit"] = "Deposit to bank|cffffffff\nClick an item to move matching stacks from the bot's bags to its bank.\nThe bot must be near a banker.|r\n\n|cffff0000Affects only the bot whose inventory is open.|r",
["tips.inventory.gbank.deposit"] = "Deposit to guild bank|cffffffff\nClick an item to move matching stacks from the bot's bags to the first guild bank tab.\nThe bot must be near a guild bank and have deposit rights.|r\n\n|cffff0000Affects only the bot whose inventory is open.|r",
Expand Down Expand Up @@ -1015,6 +1019,7 @@ local enGBValues = {
["info.trainer.reason.NO_SPELL"] = "Spell not found.",
["info.trainer.reason.NO_MATCHING_SPELL"] = "This spell is no longer available.",
["info.trainer.reason.TOO_EXPENSIVE"] = "The bot does not have enough available money.",
["info.trainer.reason.UNKNOWN"] = "The server returned an unknown trainer error.",
["tips.outfits.equip"] = "Left click: Equip\nRight click: Replace",
-- Chatless formation query
["tips.tankFace"] = "Tank Face|cffffffff\nEnables the Tank Face positioning strategy.\nWhen the bot has aggro in melee, it tries to face the target away from the group.\nThis strategy does not assign the Tank role and is independent from Tank and Tank Assist.|r\n\n|cffff0000Left-click to toggle Tank Face|r\n|cff999999(Executed by: Bot)|r",
Expand All @@ -1039,6 +1044,40 @@ local enGBValues = {
["formation.name.unknown"] = "Unknown",
["strategy.warning.blocked"] = "|cffff4444[MultiBot]|r %s: strategy command failed (%s). No chat fallback was sent.",
["strategy.warning.refused"] = "MultiBot: strategy command refused - %s",
["strategy.reason.STRATEGY_BRIDGE_UNAVAILABLE"] = "Strategy bridge is unavailable.",
["strategy.reason.STRATEGY_NOT_CONNECTED"] = "The strategy bridge is not connected.",
["strategy.reason.DISCONNECTED"] = "The strategy bridge connection was lost.",
["strategy.reason.STRATEGY_CAPABILITY_UNAVAILABLE"] = "Strategy mutation is not supported by the connected bridge.",
["strategy.reason.STRATEGY_CLIENT_UNAVAILABLE"] = "Strategy mutation is unavailable in the addon.",
["strategy.reason.STRATEGY_UNAVAILABLE"] = "Strategy mutation is unavailable.",
["strategy.reason.STRATEGY_REJECTED"] = "The strategy command was rejected.",
["strategy.reason.STRATEGY_INVALID_RESULT"] = "The bridge returned an invalid strategy result.",
["strategy.reason.STRATEGY_SEND_FAILED"] = "The strategy command could not be sent.",
["strategy.reason.STRATEGY_INVALID_SCOPE"] = "Invalid strategy target scope.",
["strategy.reason.STRATEGY_TARGET_REQUIRED"] = "A bot target is required.",
["strategy.reason.STRATEGY_TARGET_NOT_ALLOWED"] = "A bot target is not allowed for this scope.",
["strategy.reason.STRATEGY_INVALID_STATE_SCOPE"] = "Invalid combat/non-combat strategy scope.",
["strategy.reason.STRATEGY_INVALID_CHANGES"] = "Invalid strategy changes.",
["strategy.reason.STRATEGY_TOO_MANY_REQUESTS"] = "Too many strategy requests are pending.",
["strategy.reason.STRATEGY_TIMEOUT"] = "The strategy request timed out.",
["strategy.reason.TIMEOUT"] = "The strategy request timed out.",
["strategy.reason.BAD_FIELD_COUNT"] = "Malformed strategy request.",
["strategy.reason.BAD_SCOPE"] = "Invalid strategy target scope.",
["strategy.reason.BAD_ENCODING"] = "Invalid encoded strategy data.",
["strategy.reason.BAD_TARGET"] = "Invalid strategy target.",
["strategy.reason.BAD_TOKEN"] = "Invalid strategy request token.",
["strategy.reason.BAD_STATE"] = "Invalid strategy state scope.",
["strategy.reason.BAD_CHANGES"] = "Invalid strategy changes.",
["strategy.reason.BAD_OPERATION"] = "Invalid strategy operation.",
["strategy.reason.BAD_STRATEGY"] = "Invalid strategy name.",
["strategy.reason.TOO_MANY_OPERATIONS"] = "Too many strategy changes in one request.",
["strategy.reason.RATE_LIMIT"] = "Too many strategy requests. Try again in a moment.",
["strategy.reason.NO_MATCH"] = "No controllable bot matched the strategy request.",
["strategy.reason.BOT_LIMIT"] = "Too many bots matched the strategy request.",
["strategy.reason.PARTIAL"] = "The strategy command was only partially applied.",
["strategy.reason.FAILED"] = "The strategy command failed.",
["strategy.reason.ACK_TOO_LONG"] = "The strategy acknowledgement was too large.",
["strategy.reason.UNKNOWN"] = "The strategy command failed for an unknown reason.",
["info.outfits.feedback_equip"] = "Outfit \"%s\" equipped.",
["info.outfits.feedback_replace"] = "Outfit \"%s\" replaced.",
["info.outfits.feedback_update"] = "Outfit \"%s\" updated.",
Expand Down
39 changes: 39 additions & 0 deletions Locales/MultiBotAceLocale-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ local enUSValues = {
["profession.recipes.craft.reason.LOST_CONTROL"] = "The bot cannot act right now.",
["profession.recipes.craft.reason.CHANNELING"] = "The bot is already channeling a spell.",
["profession.recipes.craft.reason.cast_code"] = "The server refused the cast (code %s).",
["profession.recipes.craft.reason.UNKNOWN"] = "The server returned an unknown crafting error.",
["character.tab.skills"] = "Skills",
["character.tab.reputations"] = "Reputations",
["character.tab.emblems"] = "Emblems",
Expand Down Expand Up @@ -148,6 +149,9 @@ local enUSValues = {
["info.inventory.item_action.reason.BUY_FAILED"] = "Purchase failed.",
["info.inventory.item_action.reason.NOT_SUPPORTED"] = "This action is not supported by the bridge yet.",
["info.inventory.item_action.reason.FAILED"] = "The action failed.",
["info.inventory.item_action.reason.FORBIDDEN"] = "You are not allowed to control this bot.",
["info.inventory.item_action.reason.RATE_LIMIT"] = "Too many item actions. Try again in a moment.",
["info.inventory.item_action.reason.UNKNOWN"] = "The server returned an unknown item-action error.",
["tips.units.rti"] = "RTI",
["tips.inventory.bank.deposit"] = "Deposit to bank|cffffffff\nClick an item to move matching stacks from the bot bags to its bank.\nThe bot must be near a banker.|r\n\n|cffff0000Only affects the Bot whose inventory is open.|r",
["tips.inventory.gbank.deposit"] = "Deposit to guild bank|cffffffff\nClick an item to move matching stacks from the bot bags to the first guild bank tab.\nThe bot must be near a guild bank and have deposit rights.|r\n\n|cffff0000Only affects the Bot whose inventory is open.|r",
Expand Down Expand Up @@ -1015,6 +1019,7 @@ local enUSValues = {
["info.trainer.reason.NO_SPELL"] = "Spell not found.",
["info.trainer.reason.NO_MATCHING_SPELL"] = "This spell is no longer available.",
["info.trainer.reason.TOO_EXPENSIVE"] = "The bot does not have enough available money.",
["info.trainer.reason.UNKNOWN"] = "The server returned an unknown trainer error.",
["tips.outfits.equip"] = "Left click: Equip\nRight click: Replace",
-- Chatless formation query
["tips.tankFace"] = "Tank Face|cffffffff\nEnables the Tank Face positioning strategy.\nWhen the bot has aggro in melee, it tries to face the target away from the group.\nThis strategy does not assign the Tank role and is independent from Tank and Tank Assist.|r\n\n|cffff0000Left-click to toggle Tank Face|r\n|cff999999(Executed by: Bot)|r",
Expand All @@ -1039,6 +1044,40 @@ local enUSValues = {
["formation.name.unknown"] = "Unknown",
["strategy.warning.blocked"] = "|cffff4444[MultiBot]|r %s: strategy command failed (%s). No chat fallback was sent.",
["strategy.warning.refused"] = "MultiBot: strategy command refused - %s",
["strategy.reason.STRATEGY_BRIDGE_UNAVAILABLE"] = "Strategy bridge is unavailable.",
["strategy.reason.STRATEGY_NOT_CONNECTED"] = "The strategy bridge is not connected.",
["strategy.reason.DISCONNECTED"] = "The strategy bridge connection was lost.",
["strategy.reason.STRATEGY_CAPABILITY_UNAVAILABLE"] = "Strategy mutation is not supported by the connected bridge.",
["strategy.reason.STRATEGY_CLIENT_UNAVAILABLE"] = "Strategy mutation is unavailable in the addon.",
["strategy.reason.STRATEGY_UNAVAILABLE"] = "Strategy mutation is unavailable.",
["strategy.reason.STRATEGY_REJECTED"] = "The strategy command was rejected.",
["strategy.reason.STRATEGY_INVALID_RESULT"] = "The bridge returned an invalid strategy result.",
["strategy.reason.STRATEGY_SEND_FAILED"] = "The strategy command could not be sent.",
["strategy.reason.STRATEGY_INVALID_SCOPE"] = "Invalid strategy target scope.",
["strategy.reason.STRATEGY_TARGET_REQUIRED"] = "A bot target is required.",
["strategy.reason.STRATEGY_TARGET_NOT_ALLOWED"] = "A bot target is not allowed for this scope.",
["strategy.reason.STRATEGY_INVALID_STATE_SCOPE"] = "Invalid combat/non-combat strategy scope.",
["strategy.reason.STRATEGY_INVALID_CHANGES"] = "Invalid strategy changes.",
["strategy.reason.STRATEGY_TOO_MANY_REQUESTS"] = "Too many strategy requests are pending.",
["strategy.reason.STRATEGY_TIMEOUT"] = "The strategy request timed out.",
["strategy.reason.TIMEOUT"] = "The strategy request timed out.",
["strategy.reason.BAD_FIELD_COUNT"] = "Malformed strategy request.",
["strategy.reason.BAD_SCOPE"] = "Invalid strategy target scope.",
["strategy.reason.BAD_ENCODING"] = "Invalid encoded strategy data.",
["strategy.reason.BAD_TARGET"] = "Invalid strategy target.",
["strategy.reason.BAD_TOKEN"] = "Invalid strategy request token.",
["strategy.reason.BAD_STATE"] = "Invalid strategy state scope.",
["strategy.reason.BAD_CHANGES"] = "Invalid strategy changes.",
["strategy.reason.BAD_OPERATION"] = "Invalid strategy operation.",
["strategy.reason.BAD_STRATEGY"] = "Invalid strategy name.",
["strategy.reason.TOO_MANY_OPERATIONS"] = "Too many strategy changes in one request.",
["strategy.reason.RATE_LIMIT"] = "Too many strategy requests. Try again in a moment.",
["strategy.reason.NO_MATCH"] = "No controllable bot matched the strategy request.",
["strategy.reason.BOT_LIMIT"] = "Too many bots matched the strategy request.",
["strategy.reason.PARTIAL"] = "The strategy command was only partially applied.",
["strategy.reason.FAILED"] = "The strategy command failed.",
["strategy.reason.ACK_TOO_LONG"] = "The strategy acknowledgement was too large.",
["strategy.reason.UNKNOWN"] = "The strategy command failed for an unknown reason.",
["info.outfits.feedback_equip"] = "Outfit \"%s\" equipped.",
["info.outfits.feedback_replace"] = "Outfit \"%s\" replaced.",
["info.outfits.feedback_update"] = "Outfit \"%s\" updated.",
Expand Down
Loading
Loading