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
33 changes: 33 additions & 0 deletions Core/MultiBotComm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ local function ensureBridgeState()
state.glyphSeq = state.glyphSeq or 0
state.glyphActive = state.glyphActive or nil
state.rtiSeq = state.rtiSeq or 0
state.combatSeq = state.combatSeq or 0
return state
end

Expand Down Expand Up @@ -269,6 +270,31 @@ function Comm.RunRtiCommand(scope, target, command)
return Comm.Send("RUN", "RTI~" .. scope .. "~" .. urlEncodeField(target) .. "~" .. token .. "~" .. urlEncodeField(command))
end

function Comm.RunCombatCommand(scope, target, command)
local state = ensureBridgeState()

if not state.connected then
return false
end

command = trim(command or "")
if command == "" then
return false
end

scope = string.upper(trim(scope or "BOT"))
target = trim(target or "")

if scope ~= "ALL" and scope ~= "GROUP" and scope ~= "BOT" then
return false
end

state.combatSeq = (tonumber(state.combatSeq) or 0) + 1
local token = tostring(math.floor(safeNow() * 1000)) .. "-" .. tostring(state.combatSeq)

return Comm.Send("RUN", "COMBAT~" .. scope .. "~" .. urlEncodeField(target) .. "~" .. token .. "~" .. urlEncodeField(command))
end

function Comm.RequestOutfits(name)
local state = ensureBridgeState()
name = trim(name)
Expand Down Expand Up @@ -1615,6 +1641,13 @@ function Comm.HandleAddonMessage(prefix, message, distribution, sender)
return true
end

if opcode == "COMBAT_ACK" then
state.connected = true
state.lastError = nil
debugPrint("ADDON:RX", "COMBAT_ACK", payload or "")
return true
end

if opcode == "ERR" then
state.lastError = payload
debugPrint("ADDON:RX", "ERR", payload or "")
Expand Down
76 changes: 76 additions & 0 deletions Core/MultiBotEvery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,64 @@ if not StaticPopupDialogs["MULTIBOT_AUTOGEAR_CONFIRM"] then
}
end

local function showEveryMessage(message)
if DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.AddMessage then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ff99MultiBot|r " .. tostring(message or ""))
elseif print then
print("MultiBot " .. tostring(message or ""))
end
end

local function runBotCombatCommand(button, command)
if not button or type(command) ~= "string" or command == "" then
return false
end

local botName = button.getName and button.getName() or ""
if botName == "" then
return false
end

local comm = MultiBot and MultiBot.Comm or nil
if comm and comm.RunCombatCommand and comm.RunCombatCommand("BOT", botName, command) then
return true
end

showEveryMessage(MultiBot.L("tips.every.combatbridge", "Bridge unavailable: combat command was not sent."))
return false
end

local function runBotCombatToggle(button, enableCommand, disableCommand)
if not button then
return
end

if button.state then
if runBotCombatCommand(button, disableCommand) then
button.setDisable()
end
elseif runBotCombatCommand(button, enableCommand) then
button.setEnable()
end
end

local function addBotCombatButton(parent, name, x, y, icon, tip, enableCommand, disableCommand)
local button = parent.addButton(name, x, y, icon, tip)

if disableCommand then
button.setDisable()
button.doLeft = function(self)
runBotCombatToggle(self, enableCommand, disableCommand)
end
else
button.doLeft = function(self)
runBotCombatCommand(self, enableCommand)
end
end

return button
end

MultiBot.addEvery = function(pFrame, pCombat, pNormal)

-- MENU MISC --------------------------------------------
Expand Down Expand Up @@ -171,6 +229,24 @@ MultiBot.addEvery = function(pFrame, pCombat, pNormal)
MultiBot.BuildBotRTIUI(pFrame, botName, 394, 0)
end

local combatFrame = pFrame.addFrame("CombatCommands", 424, 29, nil, 58, 114)
combatFrame:Hide()
combatFrame._mbDropdownManaged = true

pFrame.addButton("Combat", 424, 0, "Ability_Warrior_BattleShout", MultiBot.L("tips.every.combat"))
.doLeft = function()
MultiBot.ShowHideSwitch(combatFrame)
end

addBotCombatButton(combatFrame, "CombatFocus", -28, 84, "Ability_Hunter_MasterMarksman", MultiBot.L("tips.every.combatfocus"), "co +focus", "co -focus")
addBotCombatButton(combatFrame, "CombatAoe", 0, 84, "Spell_Fire_SelfDestruct", MultiBot.L("tips.every.combataoe"), "co +aoe", "co -aoe")
addBotCombatButton(combatFrame, "CombatDpsAssist", -28, 56, "Ability_Hunter_Assassinate2", MultiBot.L("tips.every.combatdpsassist"), "co +dps assist", "co -dps assist")
addBotCombatButton(combatFrame, "CombatTankAssist", 0, 56, "Ability_Warrior_DefensiveStance", MultiBot.L("tips.every.combattankassist"), "co +tank assist", "co -tank assist")
addBotCombatButton(combatFrame, "CombatWait0", -28, 28, "Spell_Holy_BorrowedTime", MultiBot.L("tips.every.combatwait0"), "wait for attack time 0")
addBotCombatButton(combatFrame, "CombatWait3", 0, 28, "Spell_Holy_BorrowedTime", MultiBot.L("tips.every.combatwait3"), "wait for attack time 3")
addBotCombatButton(combatFrame, "CombatWait5", -28, 0, "Spell_Holy_BorrowedTime", MultiBot.L("tips.every.combatwait5"), "wait for attack time 5")
addBotCombatButton(combatFrame, "CombatWait10", 0, 0, "Spell_Holy_BorrowedTime", MultiBot.L("tips.every.combatwait10"), "wait for attack time 10")

pFrame.addButton("Spellbook", 274, 0, "inv_misc_book_09", MultiBot.L("tips.every.spellbook")).setDisable()
.doLeft = function(pButton)
if(pButton.state) then
Expand Down
27 changes: 27 additions & 0 deletions Locales/MultiBotAceLocale-deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,33 @@ local deDEValues = {
["tips.every.talent"] = "Talente|cffffffff\nDiese Schaltfläche öffnet oder schließt die Talente des Bots.\nDie Talente öffnen zeitverzögert, damit das System die Punkte laden kann.|r\n\n|cffff0000Linksklicken um das Talente zu öffnen oder schließen|r\n|cff999999(Execution-Order: Bot)|r",
["tips.every.wipe"] = "Wipe|cffffffff\nSetzt den Bot vollständig zurück, indem er getötet und wiederbelebt wird,\nnützlich zum Zurücksetzen seines Zustands (Position, Gesundheit, Mana usw.).|r\n\n|cffff0000Linksklick: sendet den Wipe-Befehl an den ausgewählten Bot|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.settalent"] = "Talente auswählen|cffffffff\nZeigt ein Menü der verfügbaren Spezialisierungen (PvE/PvP) für den ausgewählten Bot an.\nDie sekundäre Spezialisierung wird auf Stufe 40 freigeschaltet.|r\n\n|cffff0000Linksklick, um den Talentvorlagen-Selektor des Bots ein-/auszublenden|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combat"] = "Kampf|cffffffff\nÖffnet die Kampfstrategie- und Timing‑Befehle für diesen Bot.|r\n|cffff0000Linksklick zum Öffnen oder Schließen|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatfocus"] = "Focus‑Strategie|cffffffff\nAktiviert oder deaktiviert co +focus / co -focus für diesen Bot.|r\n|cffff0000Linksklick zum Umschalten|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combataoe"] = "AoE‑Strategie|cffffffff\nAktiviert oder deaktiviert co +aoe / co -aoe für diesen Bot.|r\n|cffff0000Linksklick zum Umschalten|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatdpsassist"] = "DPS‑Assist‑Strategie|cffffffff\nAktiviert oder deaktiviert co +dps assist / co -dps assist für diesen Bot.|r\n|cffff0000Linksklick zum Umschalten|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combattankassist"] = "Tank‑Assist‑Strategie|cffffffff\nAktiviert oder deaktiviert co +tank assist / co -tank assist für diesen Bot.|r\n|cffff0000Linksklick zum Umschalten|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatwait0"] = "Wait for attack: 0 Sek.|cffffffff\nSendet wait for attack time 0 an diesen Bot.|r\n|cffff0000Linksklick zum Senden|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatwait3"] = "Wait for attack: 3 Sek.|cffffffff\nSendet wait for attack time 3 an diesen Bot.|r\n|cffff0000Linksklick zum Senden|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatwait5"] = "Wait for attack: 5 Sek.|cffffffff\nSendet wait for attack time 5 an diesen Bot.|r\n|cffff0000Linksklick zum Senden|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.every.combatwait10"] = "Wait for attack: 10 Sek.|cffffffff\nSendet wait for attack time 10 an diesen Bot.|r\n|cffff0000Linksklick zum Senden|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.main.pullcontrol"] = "Pull‑Kontrolle|cffffffff\nÖffnet die Pull‑ und Kampfsteuerung über die Bridge.|r",
["tips.main.pullscopebot"] = "Scope: ausgewählter Bot|cffffffff\nBefehle werden nur an den aktuell ausgewählten Bot gesendet.|r",
["tips.main.pullscopegroup"] = "Scope: Gruppe|cffffffff\nBefehle werden an gruppierte Bots gesendet.|r",
["tips.main.pullscopeall"] = "Scope: Raid/Alle|cffffffff\nBefehle werden an alle verfügbaren Bots gesendet.|r",
["tips.main.pullwait"] = "Wait‑Strategie|cffffffff\nAktiviert oder deaktiviert co +wait for attack / co -wait for attack und wendet den gewählten Delay an.|r",
["tips.main.pullfocus"] = "Focus‑Strategie|cffffffff\nAktiviert oder deaktiviert co +focus / co -focus.|r",
["tips.main.pulldpsassist"] = "DPS‑Assist|cffffffff\nAktiviert oder deaktiviert co +dps assist / co -dps assist.|r",
["tips.main.pullaoe"] = "AoE|cffffffff\nAktiviert oder deaktiviert co +aoe / co -aoe.|r",
["tips.main.pullpresetsingle"] = "Preset Single Target|cffffffff\nDeaktiviert AoE und aktiviert DPS assist.|r",
["tips.main.pullpresetaoe"] = "Preset AoE Pack|cffffffff\nAktiviert AoE und DPS assist.|r",
["tips.main.pullpresetsafe"] = "Preset Safe Pull|cffffffff\nAktiviert Focus, DPS assist und Wait for attack.|r",
["tips.main.pullpresetreset"] = "Kampf zurücksetzen|cffffffff\nDeaktiviert Focus, DPS assist, AoE, Tank assist und Wait for attack.|r",
["tips.main.pullrti"] = "Pull RTI‑Ziel|cffffffff\nSendet pull rti target über die Bridge.|r",
["tips.main.attackrti"] = "Attack RTI‑Ziel|cffffffff\nSendet attack rti target über die Bridge.|r",
["tips.main.pullwaittime"] = "Delay anwenden|cffffffff\nSendet wait for attack time mit dem Wert des Sliders.|r",
["info.pullcontrol.no_selected_bot"] = "Wähle zuerst einen Bot für den Scope 'Selected' aus.",
["info.pullcontrol.bridge"] = "Die Kampf‑Bridge ist nicht verbunden.",
["tips.every.combatbridge"] = "Bridge nicht verfügbar: Der Kampfbefehl wurde nicht gesendet.",
["tips.spec.dkbloodpve"] = "Blut – PvE|cffffffff\nSpezialisiert auf Selbstheilung und Überleben im PvE.\nZweitspezialisierung ab Stufe 40 freigeschaltet.|r\n\n|cffff0000Linksklick: als Hauptspezialisierung festlegen|r\n|cffff0000Rechtsklick: als Zweitspezialisierung festlegen|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.spec.dkbloodpvp"] = "Blut – PvP|cffffffff\nIdeal für Flaggenträger und hohe Widerstandskraft im PvP.\nZweitspezialisierung ab Stufe 40 freigeschaltet.|r\n\n|cffff0000Linksklick: als Hauptspezialisierung festlegen|r\n|cffff0000Rechtsklick: als Zweitspezialisierung festlegen|r\n|cff999999(Ausführungsreihenfolge: Bot)|r",
["tips.spec.dkbfrostpve"] = "Frost – PvE|cffffffff\nOptimiert für Burst und Verlangsamungen im PvE.\nZweitspezialisierung ab Stufe 40 freigeschaltet.|r\n\n|cffff0000Linksklick: als Hauptspezialisierung festlegen|r\n|cffff0000Rechtsklick: als Zweitspezialisierung festlegen|r\n|cff999999(Ausführungsreihenfolge: Bot)|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 @@ -661,6 +661,33 @@ local enGBValues = {
["tips.every.talent"] = "Talent|cffffffff\nOpens or closes this Bot's Talents window.\nThere is a time delay as the system loads the Bot's Talents data before opening the Talents window.|r\n\n|cffff0000Left-click to activate|r\n|cff999999(Executed by: Bot)|r",
["tips.every.wipe"] = "Wipe|cffffffff\nFully resets a Bot by killing it and resurrecting it.\nUseful in clearing its state (position, health, mana, etc.).|r\n\n|cffff0000Left-click: sends the wipe command to the selected Bot|r\n|cff999999(Executed by: Bot)|r",
["tips.every.settalent"] = "Set Talents|cffffffff\nDisplays a menu of available specialisations (PvE/PvP) for the selected Bot.\nSecondary specialisation unlocks at level 40.|r\n\n|cffff0000Left-click to toggle the Bot's talent template selector|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combat"] = "Combat|cffffffff\nOpens combat strategy and timing commands for this Bot.|r\n|cffff0000Left-click to open or close|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatfocus"] = "Focus strategy|cffffffff\nToggles co +focus / co -focus for this Bot.|r\n|cffff0000Left-click to toggle|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combataoe"] = "AoE strategy|cffffffff\nToggles co +aoe / co -aoe for this Bot.|r\n|cffff0000Left-click to toggle|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatdpsassist"] = "DPS assist strategy|cffffffff\nToggles co +dps assist / co -dps assist for this Bot.|r\n|cffff0000Left-click to toggle|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combattankassist"] = "Tank assist strategy|cffffffff\nToggles co +tank assist / co -tank assist for this Bot.|r\n|cffff0000Left-click to toggle|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatwait0"] = "Wait for attack: 0 sec|cffffffff\nSends wait for attack time 0 to this Bot.|r\n|cffff0000Left-click to send|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatwait3"] = "Wait for attack: 3 sec|cffffffff\nSends wait for attack time 3 to this Bot.|r\n|cffff0000Left-click to send|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatwait5"] = "Wait for attack: 5 sec|cffffffff\nSends wait for attack time 5 to this Bot.|r\n|cffff0000Left-click to send|r\n|cff999999(Executed by: Bot)|r",
["tips.every.combatwait10"] = "Wait for attack: 10 sec|cffffffff\nSends wait for attack time 10 to this Bot.|r\n|cffff0000Left-click to send|r\n|cff999999(Executed by: Bot)|r",
["tips.main.pullcontrol"] = "Pull Control|cffffffff\nOpen bridge-based pull and combat controls.|r",
["tips.main.pullscopebot"] = "Scope: selected bot|cffffffff\nCommands are sent only to the currently selected bot.|r",
["tips.main.pullscopegroup"] = "Scope: group|cffffffff\nCommands are sent to grouped bots.|r",
["tips.main.pullscopeall"] = "Scope: raid/all|cffffffff\nCommands are sent to all available bots.|r",
["tips.main.pullwait"] = "Wait strategy|cffffffff\nToggles co +wait for attack / co -wait for attack and applies the selected wait time.|r",
["tips.main.pullfocus"] = "Focus strategy|cffffffff\nToggles co +focus / co -focus.|r",
["tips.main.pulldpsassist"] = "DPS Assist|cffffffff\nToggles co +dps assist / co -dps assist.|r",
["tips.main.pullaoe"] = "AoE|cffffffff\nToggles co +aoe / co -aoe.|r",
["tips.main.pullpresetsingle"] = "Single Target preset|cffffffff\nDisables AoE and enables DPS assist.|r",
["tips.main.pullpresetaoe"] = "AoE Pack preset|cffffffff\nEnables AoE and DPS assist.|r",
["tips.main.pullpresetsafe"] = "Safe Pull preset|cffffffff\nEnables focus, DPS assist and wait for attack.|r",
["tips.main.pullpresetreset"] = "Reset combat preset|cffffffff\nDisables focus, DPS assist, AoE, tank assist and wait for attack.|r",
["tips.main.pullrti"] = "Pull RTI Target|cffffffff\nSends pull rti target through the bridge.|r",
["tips.main.attackrti"] = "Attack RTI Target|cffffffff\nSends attack rti target through the bridge.|r",
["tips.main.pullwaittime"] = "Apply wait time|cffffffff\nSends wait for attack time using the slider value.|r",
["info.pullcontrol.no_selected_bot"] = "Select a bot first for Selected scope.",
["info.pullcontrol.bridge"] = "Combat bridge is not connected.",
["tips.every.combatbridge"] = "Bridge unavailable: combat command was not sent.",
["tips.spec.dkbloodpve"] = "Blood – PvE|cffffffff\nFocused on self-healing and survivability in PvE.\nSecondary spec unlocked at level 40.|r\n\n|cffff0000Left-click to set as primary spec|r\n|cffff0000Right-click to set as secondary spec|r\n|cff999999(Executed by: Bot)|r",
["tips.spec.dkbloodpvp"] = "Blood – PvP|cffffffff\nIdeal for flag control and durability in PvP.\nSecondary spec unlocked at level 40.|r\n\n|cffff0000Left-click to set as primary spec|r\n|cffff0000Right-click to set as secondary spec|r\n|cff999999(Executed by: Bot)|r",
["tips.spec.dkbfrostpve"] = "Frost – PvE|cffffffff\nOptimised for burst damage and slows in PvE.\nSecondary spec unlocked at level 40.|r\n\n|cffff0000Left-click to set as primary spec|r\n|cffff0000Right-click to set as secondary spec|r\n|cff999999(Executed by: Bot)|r",
Expand Down
Loading
Loading