mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-02-02 19:12:07 +00:00
Send trades also when we didn't farm anything
Previously I avoided that because of !loot looting entire steam EQ, but now when we loot only cards and boosters, that shouldn't be as annoying as before
This commit is contained in:
@@ -295,8 +295,8 @@ namespace ArchiSteamFarm {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task OnFarmingFinished(bool farmedSomething) {
|
internal async Task OnFarmingFinished() {
|
||||||
if (farmedSomething && BotConfig.SendOnFarmingFinished) {
|
if (BotConfig.SendOnFarmingFinished) {
|
||||||
await ResponseSendTrade(BotConfig.SteamMasterID).ConfigureAwait(false);
|
await ResponseSendTrade(BotConfig.SteamMasterID).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ namespace ArchiSteamFarm {
|
|||||||
if (!await IsAnythingToFarm().ConfigureAwait(false)) {
|
if (!await IsAnythingToFarm().ConfigureAwait(false)) {
|
||||||
Semaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
Semaphore.Release(); // We have nothing to do, don't forget to release semaphore
|
||||||
Logging.LogGenericInfo("We don't have anything to farm on this account!", Bot.BotName);
|
Logging.LogGenericInfo("We don't have anything to farm on this account!", Bot.BotName);
|
||||||
await Bot.OnFarmingFinished(false).ConfigureAwait(false);
|
await Bot.OnFarmingFinished().ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,8 +102,6 @@ namespace ArchiSteamFarm {
|
|||||||
NowFarming = true;
|
NowFarming = true;
|
||||||
Semaphore.Release(); // From this point we allow other calls to shut us down
|
Semaphore.Release(); // From this point we allow other calls to shut us down
|
||||||
|
|
||||||
bool farmedSomething = false;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
// Now the algorithm used for farming depends on whether account is restricted or not
|
// Now the algorithm used for farming depends on whether account is restricted or not
|
||||||
if (Bot.BotConfig.CardDropsRestricted) { // If we have restricted card drops, we use complex algorithm
|
if (Bot.BotConfig.CardDropsRestricted) { // If we have restricted card drops, we use complex algorithm
|
||||||
@@ -114,7 +112,6 @@ namespace ArchiSteamFarm {
|
|||||||
while (gamesToFarmSolo.Count > 0) {
|
while (gamesToFarmSolo.Count > 0) {
|
||||||
uint appID = gamesToFarmSolo.First();
|
uint appID = gamesToFarmSolo.First();
|
||||||
if (await FarmSolo(appID).ConfigureAwait(false)) {
|
if (await FarmSolo(appID).ConfigureAwait(false)) {
|
||||||
farmedSomething = true;
|
|
||||||
gamesToFarmSolo.Remove(appID);
|
gamesToFarmSolo.Remove(appID);
|
||||||
gamesToFarmSolo.TrimExcess();
|
gamesToFarmSolo.TrimExcess();
|
||||||
} else {
|
} else {
|
||||||
@@ -135,9 +132,7 @@ namespace ArchiSteamFarm {
|
|||||||
Logging.LogGenericInfo("Chosen farming algorithm: Simple", Bot.BotName);
|
Logging.LogGenericInfo("Chosen farming algorithm: Simple", Bot.BotName);
|
||||||
while (GamesToFarm.Count > 0) {
|
while (GamesToFarm.Count > 0) {
|
||||||
uint appID = GamesToFarm.Keys.FirstOrDefault();
|
uint appID = GamesToFarm.Keys.FirstOrDefault();
|
||||||
if (await FarmSolo(appID).ConfigureAwait(false)) {
|
if (!await FarmSolo(appID).ConfigureAwait(false)) {
|
||||||
farmedSomething = true;
|
|
||||||
} else {
|
|
||||||
NowFarming = false;
|
NowFarming = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -150,7 +145,7 @@ namespace ArchiSteamFarm {
|
|||||||
NowFarming = false;
|
NowFarming = false;
|
||||||
|
|
||||||
Logging.LogGenericInfo("Farming finished!", Bot.BotName);
|
Logging.LogGenericInfo("Farming finished!", Bot.BotName);
|
||||||
await Bot.OnFarmingFinished(farmedSomething).ConfigureAwait(false);
|
await Bot.OnFarmingFinished().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal async Task StopFarming() {
|
internal async Task StopFarming() {
|
||||||
|
|||||||
Reference in New Issue
Block a user