@@ -1472,6 +1472,90 @@ MultiBot.addFrame = function(pName, pX, pY, pSize)
14721472 return tFrame
14731473end
14741474
1475+ -- MULTIBOT: SELL ALL BOTS --
1476+ -- Envoie une commande de vente à tous les bots listés dans l’onglet "Units".
1477+ -- pCommand : "s *" (tout le gris) ou "s vendor" (tout ce qui est vendable).
1478+ MultiBot .SellAllBots = function (pCommand )
1479+ -- Par défaut : vendre tous les objets gris (safe)
1480+ pCommand = pCommand or " s *"
1481+
1482+ if not MultiBot .isTarget or not MultiBot .isTarget () then
1483+ return 0
1484+ end
1485+
1486+ local frames = MultiBot .frames
1487+ if not frames then return 0 end
1488+
1489+ local multiBar = frames [" MultiBar" ]
1490+ if not multiBar or not multiBar .frames or not multiBar .frames [" Units" ] then
1491+ return 0
1492+ end
1493+
1494+ local units = multiBar .frames [" Units" ]
1495+ if not units .buttons then
1496+ return 0
1497+ end
1498+
1499+ CancelTrade ()
1500+
1501+ local count = 0
1502+
1503+ for key , btn in pairs (units .buttons ) do
1504+ if type (btn ) == " table" then
1505+ local botName = btn .name or (btn .getName and btn .getName ()) or key
1506+ if botName and botName ~= " " then
1507+ SendChatMessage (pCommand , " WHISPER" , nil , botName )
1508+ count = count + 1
1509+ end
1510+ end
1511+ end
1512+
1513+ -- Si une fenêtre d’inventaire est ouverte, on la rafraîchit pour le bot affiché
1514+ if MultiBot .inventory and MultiBot .inventory :IsVisible () and MultiBot .RefreshInventory then
1515+ MultiBot .RefreshInventory (0.5 )
1516+ end
1517+
1518+ return count
1519+ end
1520+
1521+ -- MULTIBOT: MAINTENANCE ALL BOTS --
1522+ -- Envoie la commande "maintenance" à tous les bots listés dans l’onglet "Units".
1523+ MultiBot .MaintenanceAllBots = function ()
1524+ local frames = MultiBot .frames
1525+ if not frames then return 0 end
1526+
1527+ local multiBar = frames [" MultiBar" ]
1528+ if not multiBar or not multiBar .frames or not multiBar .frames [" Units" ] then
1529+ return 0
1530+ end
1531+
1532+ local units = multiBar .frames [" Units" ]
1533+ if not units .buttons then
1534+ return 0
1535+ end
1536+
1537+ CancelTrade ()
1538+
1539+ local count = 0
1540+
1541+ for key , btn in pairs (units .buttons ) do
1542+ if type (btn ) == " table" then
1543+ local botName = btn .name or (btn .getName and btn .getName ()) or key
1544+ if botName and botName ~= " " then
1545+ SendChatMessage (" maintenance" , " WHISPER" , nil , botName )
1546+ count = count + 1
1547+ end
1548+ end
1549+ end
1550+
1551+ -- Si une fenêtre d’inventaire est ouverte, on peut la rafraîchir pour refléter d’éventuels changements
1552+ if MultiBot .inventory and MultiBot .inventory :IsVisible () and MultiBot .RefreshInventory then
1553+ MultiBot .RefreshInventory (0.5 )
1554+ end
1555+
1556+ return count
1557+ end
1558+
14751559--[[ MultiBot.addSelf = function(pClass, pName)
14761560MultiBot.dprint("addSelf", pName, pClass) -- DEBUG
14771561 if(MultiBot.frames["MultiBar"].frames["Units"].buttons[pName] ~= nil) then return MultiBot.frames["MultiBar"].frames["Units"].buttons[pName] end
0 commit comments