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
78 changes: 78 additions & 0 deletions Core/MultiBotComm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ local function ensureBridgeState()
state.professionRecipes = state.professionRecipes or {}
state.professionRecipeSeq = state.professionRecipeSeq or 0
state.professionRecipeActive = state.professionRecipeActive or nil
state.professionRecipeCraftSeq = state.professionRecipeCraftSeq or 0
state.professionRecipeCrafts = state.professionRecipeCrafts or {}
state.outfitSeq = state.outfitSeq or 0
state.outfitActive = state.outfitActive or nil
state.outfitCommands = state.outfitCommands or {}
Expand Down Expand Up @@ -622,6 +624,35 @@ function Comm.RequestProfessionRecipes(name, skillId)
return true
end

function Comm.RunProfessionRecipeCraft(name, skillId, spellId, itemId)
local state = ensureBridgeState()
name = trim(name)
skillId = tonumber(skillId or 0) or 0
spellId = tonumber(spellId or 0) or 0
itemId = tonumber(itemId or 0) or 0
if name == "" or skillId <= 0 or spellId <= 0 or itemId < 0 or not state.connected then
return false
end

state.professionRecipeCraftSeq = (tonumber(state.professionRecipeCraftSeq) or 0) + 1
local token = tostring(math.floor(safeNow() * 1000)) .. "-craft-" .. tostring(state.professionRecipeCraftSeq)
state.professionRecipeCrafts[token] = {
botName = name,
botNameKey = string.lower(name),
skillId = skillId,
spellId = spellId,
itemId = itemId,
startedAt = safeNow(),
}

if not Comm.Send("RUN", "CRAFT_RECIPE~" .. name .. "~" .. token .. "~" .. skillId .. "~" .. spellId .. "~" .. itemId) then
state.professionRecipeCrafts[token] = nil
return false
end

return token
end

function Comm.MarkDisconnected(reason)
local state = ensureBridgeState()
state.connected = false
Expand All @@ -632,6 +663,7 @@ function Comm.MarkDisconnected(reason)
state.spellbookActive = nil
state.botSkillActive = nil
state.professionRecipeActive = nil
state.professionRecipeCrafts = {}
state.outfitActive = nil
state.outfitCommands = {}
end
Expand Down Expand Up @@ -1411,6 +1443,45 @@ function Comm.ApplyOutfitCommandPayload(payload)
return true
end

function Comm.ApplyProfessionRecipeCraftPayload(payload)
local botName, rest = splitOnce(payload or "", "~")
local token, rest2 = splitOnce(rest or "", "~")
local skillId, rest3 = splitOnce(rest2 or "", "~")
local spellId, rest4 = splitOnce(rest3 or "", "~")
local itemId, rest5 = splitOnce(rest4 or "", "~")
local result, reason = splitOnce(rest5 or "", "~")

botName = trim(urlDecodeField(botName))
token = trim(token)
skillId = tonumber(skillId or "0") or 0
spellId = tonumber(spellId or "0") or 0
itemId = tonumber(itemId or "0") or 0
result = trim(result)
reason = trim(urlDecodeField(reason))

local state = ensureBridgeState()
local command = state.professionRecipeCrafts and state.professionRecipeCrafts[token] or nil
if not command then
return false
end

command.botName = botName ~= "" and botName or command.botName
command.botNameKey = string.lower(command.botName or "")
command.skillId = skillId > 0 and skillId or command.skillId
command.spellId = spellId > 0 and spellId or command.spellId
command.itemId = itemId >= 0 and itemId or command.itemId
command.result = result
command.reason = reason

if MultiBot.OnBridgeProfessionRecipeCraftResult then
MultiBot.OnBridgeProfessionRecipeCraftResult(command.botName, command.skillId, command.spellId, command.itemId, result, reason, command)
end

state.professionRecipeCrafts[token] = nil
debugPrint("ADDON:RX", "PROFESSION_RECIPE_CRAFT", command.botName, command.skillId, command.spellId, result, reason)
return true
end

function Comm.ApplyGlyphsBeginPayload(payload)
local botName, token = splitOnce(payload or "", "~")
botName = trim(urlDecodeField(botName))
Expand Down Expand Up @@ -2160,6 +2231,12 @@ function Comm.HandleAddonMessage(prefix, message, distribution, sender)
return true
end

if opcode == "PROFESSION_RECIPE_CRAFT" then
state.connected = true
state.lastError = nil
return Comm.ApplyProfessionRecipeCraftPayload(payload)
end

if opcode == "RTI_ACK" then
state.connected = true
state.lastError = nil
Expand Down Expand Up @@ -2289,6 +2366,7 @@ function Comm.OnPlayerEnteringWorld()
state.botSkillActive = nil
state.professionRecipes = {}
state.professionRecipeActive = nil
state.professionRecipeCrafts = {}
state.outfitActive = nil
state.outfitCommands = {}
Comm.MarkDisconnected(nil)
Expand Down
29 changes: 28 additions & 1 deletion Locales/MultiBotAceLocale-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ local deDEValues = {
["character.info"] = "Charakterinformationen",
["character.skills"] = "Fertigkeiten",
["profession.recipes.loading"] = "Wird geladen...",
["profession.recipes.craft"] = "Herstellen",
["profession.recipes.craft.tooltip"] = "Fordert den Bot auf, dieses Rezept einmal herzustellen.",
["profession.recipes.craft.pending"] = "Herstellung angefordert...",
["profession.recipes.craft.ok"] = "Herstellung gestartet.",
["profession.recipes.craft.failed"] = "Herstellungsanfrage fehlgeschlagen.",
["profession.recipes.craft.err"] = "Herstellung fehlgeschlagen: %s",
["profession.recipes.craft.reason.NO_BOT"] = "Bot nicht gefunden.",
["profession.recipes.craft.reason.NO_AI"] = "Bot-KI nicht verfügbar.",
["profession.recipes.craft.reason.BAD_REQUEST"] = "Ungültige Rezeptanfrage.",
["profession.recipes.craft.reason.UNKNOWN_RECIPE"] = "Rezept ist diesem Bot nicht bekannt.",
["profession.recipes.craft.reason.SKILL_MISMATCH"] = "Rezept passt nicht zu diesem Beruf.",
["profession.recipes.craft.reason.BAD_RECIPE"] = "Ungültiges Rezept.",
["profession.recipes.craft.reason.ITEM_MISMATCH"] = "Rezeptergebnis stimmt nicht überein.",
["profession.recipes.craft.reason.NO_MATERIALS"] = "Materialien fehlen.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS"] = "Benötigte Handwerksstation nicht in der Nähe.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS.cooking"] = "Du musst in der Nähe eines Kochfeuers sein.",
["profession.recipes.craft.reason.REQUIRES_AREA"] = "Das kann hier nicht hergestellt werden.",
["profession.recipes.craft.reason.MISSING_TOOLS"] = "Benötigtes Werkzeug fehlt oder ist nicht angelegt.",
["profession.recipes.craft.reason.MOVING"] = "Der Bot muss stehen bleiben.",
["profession.recipes.craft.reason.NOT_STANDING"] = "Der Bot musste aufstehen. Erneut versuchen.",
["profession.recipes.craft.reason.NOT_READY"] = "Das Rezept ist noch nicht bereit.",
["profession.recipes.craft.reason.OUT_OF_RANGE"] = "Der Bot ist außer Reichweite.",
["profession.recipes.craft.reason.TRY_AGAIN"] = "Gleich erneut versuchen.",
["profession.recipes.craft.reason.IN_FLIGHT"] = "Der Bot kann im Flug nicht herstellen.",
["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).",
["character.skills.count"] = "Fertigkeit(en)",
["character.skills.loading"] = "Wird geladen...",
["character.skills.category.class"] = "Klassenfertigkeiten",
Expand Down Expand Up @@ -396,7 +423,7 @@ local deDEValues = {
["tips.main.creator"] = "Creator-Switch\n|cffffffffDieser Schalter aktiviert oder deaktiviert die Creator-Control.|r\n\n|cffff0000Linksklicken um die Creator-Control ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.beast"] = "Beastmaster-Switch\n|cffffffffDieser Schalter aktiviert oder deaktiviert die Beastmaster-Control.\nDie Beastmaster-Control ist für Mod-NPC-Beastmaster des Azerothcore.\nMod-NPC-Beastmaster erlaubt es jedem Character eine Bestie wie Jäger zu haben.\nDein Character kann die notwendigen Zauber bei 'White Fang' erlernen.\nDer GameMaster muss 'White Fang' in der Spielwelt platzieren.\n|cffff0000Linksklicken um die Beastmaster-Control ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.disperse"] = "Disperse-Switch\n|cffffffffDieser Schalter zeigt oder versteckt die Disperse-Control.|r\n\n|cffff0000Linksklicken um die Disperse-Control ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.loot"] = "Beuteregeln-Switch\n|cffffffffDieser Schalter zeigt oder versteckt die Beuteregeln-Control.|r\n\n|cffff0000Linksklicken um die Beuteregeln-Control ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.loot"] = "Beuteregeln-Switch\n|cffffffffDieser Schalter zeigt oder versteckt die Beuteregeln-Control.|r\n\n|cffff0000Linksklicken um die Beuteregeln-Control ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.expand"] = "Expand-Switch\n|cffffffffDiese Schaltfläche expandiert oder reduziert die Stay-Follow-Control.\n|cffff0000Linksklicken um die Stay-Follow-Control zu expandieren oder reduzieren|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.release"] = "Auto-Release\n|cffffffffDiese Erweiterung erkennt wenn ein Bot stirbt.\nTote Bots werden automatisch freigelassen und herbeigerufen.\nDadurch werden die Bots innerhalb von Sekunden wiederbelebt.|r\n\n|cffff0000Linksklicken um Auto-Release ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
["tips.main.stats"] = "Auto-Stats\n|cffffffffDiese Erweiterung visualisiert die Werte vom Stats-Kommando.\nDie Stats-Werte aktualisieren sich alle 45 Sekunden.|r\n\n|cffff0000Linksklicken um Auto-Stats ein- oder auszuschalten|r\n|cff999999(Ausführreihenfolge: System)|r",
Expand Down
27 changes: 27 additions & 0 deletions Locales/MultiBotAceLocale-enGB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ local enGBValues = {
["character.info"] = "Character Info",
["character.skills"] = "Skills",
["profession.recipes.loading"] = "Loading...",
["profession.recipes.craft"] = "Craft",
["profession.recipes.craft.tooltip"] = "Ask the bot to craft this recipe once.",
["profession.recipes.craft.pending"] = "Craft requested...",
["profession.recipes.craft.ok"] = "Craft started.",
["profession.recipes.craft.failed"] = "Craft request failed.",
["profession.recipes.craft.err"] = "Craft failed: %s",
["profession.recipes.craft.reason.NO_BOT"] = "Bot not found.",
["profession.recipes.craft.reason.NO_AI"] = "Bot AI unavailable.",
["profession.recipes.craft.reason.BAD_REQUEST"] = "Invalid recipe request.",
["profession.recipes.craft.reason.UNKNOWN_RECIPE"] = "Recipe not known by this bot.",
["profession.recipes.craft.reason.SKILL_MISMATCH"] = "Recipe does not match this profession.",
["profession.recipes.craft.reason.BAD_RECIPE"] = "Invalid recipe.",
["profession.recipes.craft.reason.ITEM_MISMATCH"] = "Recipe result mismatch.",
["profession.recipes.craft.reason.NO_MATERIALS"] = "Missing materials.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS"] = "Required crafting station not found nearby.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS.cooking"] = "You must be near a cooking fire.",
["profession.recipes.craft.reason.REQUIRES_AREA"] = "You cannot craft that here.",
["profession.recipes.craft.reason.MISSING_TOOLS"] = "Required tool missing or not equipped.",
["profession.recipes.craft.reason.MOVING"] = "The bot must stop moving.",
["profession.recipes.craft.reason.NOT_STANDING"] = "The bot had to stand up. Try again.",
["profession.recipes.craft.reason.NOT_READY"] = "The recipe is not ready yet.",
["profession.recipes.craft.reason.OUT_OF_RANGE"] = "The bot is out of range.",
["profession.recipes.craft.reason.TRY_AGAIN"] = "Try again in a moment.",
["profession.recipes.craft.reason.IN_FLIGHT"] = "The bot cannot craft while flying.",
["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).",
["character.skills.count"] = "skill(s)",
["character.skills.loading"] = "Loading...",
["character.skills.category.class"] = "Class Skills",
Expand Down
28 changes: 28 additions & 0 deletions Locales/MultiBotAceLocale-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,34 @@ local enUSValues = {
["character.info"] = "Character Info",
["character.skills"] = "Skills",
["profession.recipes.loading"] = "Loading...",
["profession.recipes.craft"] = "Craft",
["profession.recipes.craft"] = "Craft",
["profession.recipes.craft.tooltip"] = "Ask the bot to craft this recipe once.",
["profession.recipes.craft.pending"] = "Craft requested...",
["profession.recipes.craft.ok"] = "Craft started.",
["profession.recipes.craft.failed"] = "Craft request failed.",
["profession.recipes.craft.err"] = "Craft failed: %s",
["profession.recipes.craft.reason.NO_BOT"] = "Bot not found.",
["profession.recipes.craft.reason.NO_AI"] = "Bot AI unavailable.",
["profession.recipes.craft.reason.BAD_REQUEST"] = "Invalid recipe request.",
["profession.recipes.craft.reason.UNKNOWN_RECIPE"] = "Recipe not known by this bot.",
["profession.recipes.craft.reason.SKILL_MISMATCH"] = "Recipe does not match this profession.",
["profession.recipes.craft.reason.BAD_RECIPE"] = "Invalid recipe.",
["profession.recipes.craft.reason.ITEM_MISMATCH"] = "Recipe result mismatch.",
["profession.recipes.craft.reason.NO_MATERIALS"] = "Missing materials.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS"] = "Required crafting station not found nearby.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS.cooking"] = "You must be near a cooking fire.",
["profession.recipes.craft.reason.REQUIRES_AREA"] = "You cannot craft that here.",
["profession.recipes.craft.reason.MISSING_TOOLS"] = "Required tool missing or not equipped.",
["profession.recipes.craft.reason.MOVING"] = "The bot must stop moving.",
["profession.recipes.craft.reason.NOT_STANDING"] = "The bot had to stand up. Try again.",
["profession.recipes.craft.reason.NOT_READY"] = "The recipe is not ready yet.",
["profession.recipes.craft.reason.OUT_OF_RANGE"] = "The bot is out of range.",
["profession.recipes.craft.reason.TRY_AGAIN"] = "Try again in a moment.",
["profession.recipes.craft.reason.IN_FLIGHT"] = "The bot cannot craft while flying.",
["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).",
["character.skills.count"] = "skill(s)",
["character.skills.loading"] = "Loading...",
["character.skills.category.class"] = "Class Skills",
Expand Down
27 changes: 27 additions & 0 deletions Locales/MultiBotAceLocale-esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ local esESValues = {
["character.info"] = "Información del personaje",
["character.skills"] = "Habilidades",
["profession.recipes.loading"] = "Cargando...",
["profession.recipes.craft"] = "Crear",
["profession.recipes.craft.tooltip"] = "Pide al bot que cree esta receta una vez.",
["profession.recipes.craft.pending"] = "Creación solicitada...",
["profession.recipes.craft.ok"] = "Creación iniciada.",
["profession.recipes.craft.failed"] = "La solicitud de creación falló.",
["profession.recipes.craft.err"] = "Creación fallida: %s",
["profession.recipes.craft.reason.NO_BOT"] = "Bot no encontrado.",
["profession.recipes.craft.reason.NO_AI"] = "IA del bot no disponible.",
["profession.recipes.craft.reason.BAD_REQUEST"] = "Solicitud de receta no válida.",
["profession.recipes.craft.reason.UNKNOWN_RECIPE"] = "El bot no conoce esta receta.",
["profession.recipes.craft.reason.SKILL_MISMATCH"] = "La receta no coincide con esta profesión.",
["profession.recipes.craft.reason.BAD_RECIPE"] = "Receta no válida.",
["profession.recipes.craft.reason.ITEM_MISMATCH"] = "El resultado de la receta no coincide.",
["profession.recipes.craft.reason.NO_MATERIALS"] = "Faltan materiales.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS"] = "No hay una estación de creación requerida cerca.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS.cooking"] = "Debes estar cerca de un fuego de cocina.",
["profession.recipes.craft.reason.REQUIRES_AREA"] = "No puedes crear eso aquí.",
["profession.recipes.craft.reason.MISSING_TOOLS"] = "Falta una herramienta requerida o no está equipada.",
["profession.recipes.craft.reason.MOVING"] = "El bot debe dejar de moverse.",
["profession.recipes.craft.reason.NOT_STANDING"] = "El bot tuvo que levantarse. Inténtalo de nuevo.",
["profession.recipes.craft.reason.NOT_READY"] = "La receta aún no está lista.",
["profession.recipes.craft.reason.OUT_OF_RANGE"] = "El bot está fuera de alcance.",
["profession.recipes.craft.reason.TRY_AGAIN"] = "Inténtalo de nuevo en un momento.",
["profession.recipes.craft.reason.IN_FLIGHT"] = "El bot no puede crear mientras vuela.",
["profession.recipes.craft.reason.LOST_CONTROL"] = "El bot no puede actuar ahora.",
["profession.recipes.craft.reason.CHANNELING"] = "El bot ya está canalizando un hechizo.",
["profession.recipes.craft.reason.cast_code"] = "El servidor rechazó el lanzamiento (código %s).",
["character.skills.count"] = "habilidad(es)",
["character.skills.loading"] = "Cargando...",
["character.skills.category.class"] = "Habilidades de clase",
Expand Down
27 changes: 27 additions & 0 deletions Locales/MultiBotAceLocale-frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,33 @@ local frFRValues = {
["character.info"] = "Infos personnage",
["character.skills"] = "Compétences",
["profession.recipes.loading"] = "Chargement...",
["profession.recipes.craft"] = "Créer",
["profession.recipes.craft.tooltip"] = "Demande au bot de créer cette recette une fois.",
["profession.recipes.craft.pending"] = "Création demandée...",
["profession.recipes.craft.ok"] = "Création lancée.",
["profession.recipes.craft.failed"] = "La demande de création a échoué.",
["profession.recipes.craft.err"] = "Création échouée : %s",
["profession.recipes.craft.reason.NO_BOT"] = "Bot introuvable.",
["profession.recipes.craft.reason.NO_AI"] = "IA du bot indisponible.",
["profession.recipes.craft.reason.BAD_REQUEST"] = "Demande de recette invalide.",
["profession.recipes.craft.reason.UNKNOWN_RECIPE"] = "Recette inconnue de ce bot.",
["profession.recipes.craft.reason.SKILL_MISMATCH"] = "La recette ne correspond pas à ce métier.",
["profession.recipes.craft.reason.BAD_RECIPE"] = "Recette invalide.",
["profession.recipes.craft.reason.ITEM_MISMATCH"] = "Résultat de recette incohérent.",
["profession.recipes.craft.reason.NO_MATERIALS"] = "Composants manquants.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS"] = "Poste de fabrication requis introuvable à proximité.",
["profession.recipes.craft.reason.REQUIRES_SPELL_FOCUS.cooking"] = "Il faut être près d'un feu de cuisine.",
["profession.recipes.craft.reason.REQUIRES_AREA"] = "Impossible de créer cette recette ici.",
["profession.recipes.craft.reason.MISSING_TOOLS"] = "Outil requis manquant ou non équipé.",
["profession.recipes.craft.reason.MOVING"] = "Le bot doit arrêter de bouger.",
["profession.recipes.craft.reason.NOT_STANDING"] = "Le bot devait se lever. Réessaie.",
["profession.recipes.craft.reason.NOT_READY"] = "La recette n'est pas encore prête.",
["profession.recipes.craft.reason.OUT_OF_RANGE"] = "Le bot est hors de portée.",
["profession.recipes.craft.reason.TRY_AGAIN"] = "Réessaie dans un instant.",
["profession.recipes.craft.reason.IN_FLIGHT"] = "Le bot ne peut pas créer en vol.",
["profession.recipes.craft.reason.LOST_CONTROL"] = "Le bot ne peut pas agir maintenant.",
["profession.recipes.craft.reason.CHANNELING"] = "Le bot canalise déjà un sort.",
["profession.recipes.craft.reason.cast_code"] = "Le serveur a refusé le cast (code %s).",
["character.skills.count"] = "compétence(s)",
["character.skills.loading"] = "Chargement...",
["character.skills.category.class"] = "Compétences de classe",
Expand Down
Loading
Loading