From f8c1582aeb0389fc1c13380f1ebaf75f5692acbe Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 10 Jan 2016 19:35:03 +0100 Subject: [PATCH] Misc enhancements --- ArchiSteamFarm/Bot.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index e8e472b77..692149eca 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -449,19 +449,23 @@ namespace ArchiSteamFarm { return "Couldn't find any bot named " + botName + "!"; } - if (bot.CardsFarmer.CurrentGamesFarming.Count > 0) { - return "Bot " + bot.BotName + " is currently farming appIDs: " + string.Join(", ", bot.CardsFarmer.CurrentGamesFarming) + " and has a total of " + bot.CardsFarmer.GamesToFarm.Count + " games left to farm."; - } else { - return "Bot " + bot.BotName + " is not farming."; + return bot.ResponseStatus(); + } + internal string ResponseStatus() { + if (CardsFarmer.CurrentGamesFarming.Count > 0) { + return "Bot " + BotName + " is currently farming appIDs: " + string.Join(", ", CardsFarmer.CurrentGamesFarming) + " and has a total of " + CardsFarmer.GamesToFarm.Count + " games left to farm."; + } else { + return "Bot " + BotName + " is not farming."; } } internal static string ResponseStatusAll() { StringBuilder result = new StringBuilder(Environment.NewLine); - foreach (var bot in Bots) { - result.Append(ResponseStatus(bot.Key) + Environment.NewLine); + foreach (Bot bot in Bots.Values) { + result.Append(bot.ResponseStatus() + Environment.NewLine); } + result.Append("Currently " + Bots.Count + " bots are running."); return result.ToString(); } @@ -589,7 +593,7 @@ namespace ArchiSteamFarm { await Program.Restart().ConfigureAwait(false); return "Done"; case "!status": - return ResponseStatus(BotName); + return ResponseStatus(); case "!statusall": return ResponseStatusAll(); case "!stop":