mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 22:20:52 +00:00
statusall
This commit is contained in:
@@ -444,20 +444,10 @@ namespace ArchiSteamFarm {
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
return null;
|
||||
}
|
||||
if (botName.Equals("all")) {
|
||||
foreach (var curbot in Bots) {
|
||||
if (curbot.Value.CardsFarmer.CurrentGamesFarming.Count == 0)
|
||||
result+="Bot " + curbot.Key + " is not farming.\n";
|
||||
else
|
||||
result+="Bot " + curbot.Key + " is currently farming appIDs: " + string.Join(", ", curbot.Value.CardsFarmer.CurrentGamesFarming) + " and has a total of " + curbot.Value.CardsFarmer.GamesToFarm.Count + " games left to farm.\n";
|
||||
}
|
||||
result+="Currently " + Bots.Count + " bots are running.";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!Bots.TryGetValue(botName, out bot)) {
|
||||
result+="Couldn't find any bot named " + botName + "!";
|
||||
return result;
|
||||
result+="Couldn't find any bot named " + botName + "!";
|
||||
return result;
|
||||
}
|
||||
|
||||
if (bot.CardsFarmer.CurrentGamesFarming.Count > 0) {
|
||||
@@ -467,6 +457,18 @@ namespace ArchiSteamFarm {
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string ResponseStatusAll() {
|
||||
string result = "";
|
||||
foreach (var curbot in Bots) {
|
||||
if (curbot.Value.CardsFarmer.CurrentGamesFarming.Count == 0)
|
||||
result += "Bot " + curbot.Key + " is not farming.\n";
|
||||
else
|
||||
result += "Bot " + curbot.Key + " is currently farming appIDs: " + string.Join(", ", curbot.Value.CardsFarmer.CurrentGamesFarming) + " and has a total of " + curbot.Value.CardsFarmer.GamesToFarm.Count + " games left to farm.\n";
|
||||
}
|
||||
result += "Currently " + Bots.Count + " bots are running.";
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string Response2FA(string botName) {
|
||||
if (string.IsNullOrEmpty(botName)) {
|
||||
return null;
|
||||
@@ -591,6 +593,8 @@ namespace ArchiSteamFarm {
|
||||
return "Done";
|
||||
case "!status":
|
||||
return ResponseStatus(BotName);
|
||||
case "!statusall":
|
||||
return ResponseStatusAll();
|
||||
case "!stop":
|
||||
return await ResponseStop(BotName).ConfigureAwait(false);
|
||||
default:
|
||||
|
||||
@@ -84,7 +84,6 @@ namespace ArchiSteamFarm {
|
||||
Logging.LogGenericInfo("WCF", "Received command: \"" + input + "\"");
|
||||
|
||||
string command = '!' + input;
|
||||
if (command.Equals("!status")) command+=" all"; //show status off all bots if no bot specified
|
||||
string output = bot.HandleMessage(command).Result; // TODO: This should be asynchronous
|
||||
|
||||
Logging.LogGenericInfo("WCF", "Answered to command: \"" + input + "\" with: \"" + output + "\"");
|
||||
|
||||
Reference in New Issue
Block a user