Skip to content

Commit 33e0675

Browse files
committed
Skip first shutdown in ShutdownOnFarmingFinished, #229
1 parent f840f28 commit 33e0675

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ArchiSteamFarm/Bot.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ internal sealed class Bot {
6868

6969
internal bool KeepRunning { get; private set; }
7070

71-
private bool InvalidPassword, LoggedInElsewhere, FirstTradeSent;
71+
private bool InvalidPassword, LoggedInElsewhere, FirstTradeSent, SkipFirstShutdown;
7272
private string AuthCode, TwoFactorCode;
7373

7474
internal static async Task RefreshCMs(uint cellID) {
@@ -320,7 +320,11 @@ internal async Task OnFarmingFinished(bool farmedSomething) {
320320
}
321321

322322
if (BotConfig.ShutdownOnFarmingFinished) {
323-
Stop();
323+
if (SkipFirstShutdown) {
324+
SkipFirstShutdown = false;
325+
} else {
326+
Stop();
327+
}
324328
}
325329
}
326330

@@ -1130,6 +1134,7 @@ private async Task<string> ResponseStart(ulong steamID) {
11301134
return "That bot instance is already running!";
11311135
}
11321136

1137+
SkipFirstShutdown = true;
11331138
await Start().ConfigureAwait(false);
11341139
return "Done!";
11351140
}

0 commit comments

Comments
 (0)