Skip to content

Commit

Permalink
Fix item purchase logic to ensure correct quantity calculation in Cor…
Browse files Browse the repository at this point in the history
…eFarms.cs
  • Loading branch information
PUNK3DAF committed Feb 14, 2025
1 parent 82858af commit 3250e40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CoreFarms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,7 @@ public void Voucher(string? Voucher, int quant, string? shopName = null)


// Ensure the correct shop is loaded
Core.Join(map);
Bot.Shops.Load(shopID);
Core.Sleep(1000);
Bot.Wait.ForActionCooldown(GameActions.LoadShop);
Expand All @@ -1460,7 +1461,7 @@ public void Voucher(string? Voucher, int quant, string? shopName = null)
// Get current quantity
int currentQuantity = Bot.Inventory.GetQuantity(Voucher);
// Calculate the amount to buy
int AmountToBuy = Math.Min(quant - Bot.Inventory.GetQuantity(item.Name), item.MaxStack - currentQuantity);
int AmountToBuy = Math.Min(quant, item.MaxStack);
// Farm gold for the required amount and buy the item
Gold(AmountToBuy * v);
// Buy Item
Expand Down

0 comments on commit 3250e40

Please sign in to comment.