From 5a44c8a96cb88f1e5c2863edf5704dadcc2560c8 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Tue, 23 May 2017 05:33:39 +0200 Subject: [PATCH] Improve ShutdownOnFarmingFinished #557 Previously we always skipped first shutdown event, which is appropriate but only if we actually don't have anything to farm, so owner of account can execute command and redeem keys when given bot is !started without a trouble of bot instantly turning off. Add proper routine for stopping bot immediately if either we farmed something already, or if IdleFarmingPeriod is 0 --- ArchiSteamFarm/Bot.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 71ce27b8a..5104f55f8 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -501,6 +501,11 @@ namespace ArchiSteamFarm { } if (BotConfig.ShutdownOnFarmingFinished) { + if (farmedSomething || (Program.GlobalConfig.IdleFarmingPeriod == 0)) { + Stop(); + return; + } + if (SkipFirstShutdown) { SkipFirstShutdown = false; } else {