Enhance !statusall

This commit is contained in:
JustArchi 2016-10-04 22:02:34 +02:00
parent a261dc44fd
commit 3c5bea6850

View file

@ -852,18 +852,12 @@ namespace ArchiSteamFarm {
return null; return null;
} }
StringBuilder result = new StringBuilder(Environment.NewLine); HashSet<Bot> botsRunning = new HashSet<Bot>(Bots.Where(bot => bot.Value.KeepRunning).OrderBy(bot => bot.Key).Select(bot => bot.Value));
IEnumerable<string> statuses = botsRunning.Select(bot => bot.ResponseStatus(steamID));
byte runningBotsCount = 0; return Environment.NewLine +
foreach (Bot bot in Bots.OrderBy(bot => bot.Key).Select(bot => bot.Value)) { string.Join(Environment.NewLine, statuses) + Environment.NewLine +
result.Append(bot.ResponseStatus(steamID) + Environment.NewLine); "There are " + botsRunning.Count + "/" + Bots.Count + " bots running, with total of " + botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Count) + " games (" + botsRunning.Sum(bot => bot.CardsFarmer.GamesToFarm.Sum(game => game.CardsRemaining)) + " cards) left to farm.";
if (bot.KeepRunning) {
runningBotsCount++;
}
}
result.Append("There are " + runningBotsCount + "/" + Bots.Count + " bots running.");
return result.ToString();
} }
private async Task<string> ResponseLoot(ulong steamID) { private async Task<string> ResponseLoot(ulong steamID) {