The preference
The list is automatically populated when an attempt to purchase from the store fails as you were ignored.
However, other functions such as checking the mall price will return the price of the stores we're not going to buy from. Which can be an issue when you're scripting this and didn't account for that.
An easy example is when you expected to consume 3 mojo filters, mall price shows that there are 6 under 10k. But both stores are in your forbiddenStores.
Garbo will throw an error as it expected to buy 3 mojo filters, but failed. And mojo filters are still being reported as under 10k, but the next cheapest is beyond your price point.
This is good behavior by garbo, but bad behavior by mafia as garbo has no way to tell that it was due to the forbiddenStores without black magic.
Another scenario I've encountered is when trying to figure out if its cheaper to craft an item, or buy the item. My script will recursive itself when it doesn't have enough items, so it's always flip flopping between crafting item or buying item.
So obviously, when it can't even tell which store is cheaper because the 1-5th cheapest were all in my forbidden stores.. It couldn't resolve. It was always trying to buy the item, but was refused as its in the forbiddenStores. So it recursed then tried to buy again because it's still reported as the cheapest.
The solution I believe should be to hide the forbiddenStores from the price checks, then to provide expected behavior for how many items should be available. We should probably exclude forbiddenStores from the anti-bot measure which skips the first 5 items. So the first 5 items will always be a store not in your forbiddenStores.
forbiddenStores
is a list of player IDs which tells mafia to avoid buying from their stores.The list is automatically populated when an attempt to purchase from the store fails as you were ignored.
However, other functions such as checking the mall price will return the price of the stores we're not going to buy from. Which can be an issue when you're scripting this and didn't account for that.
An easy example is when you expected to consume 3 mojo filters, mall price shows that there are 6 under 10k. But both stores are in your forbiddenStores.
Garbo will throw an error as it expected to buy 3 mojo filters, but failed. And mojo filters are still being reported as under 10k, but the next cheapest is beyond your price point.
This is good behavior by garbo, but bad behavior by mafia as garbo has no way to tell that it was due to the forbiddenStores without black magic.
Another scenario I've encountered is when trying to figure out if its cheaper to craft an item, or buy the item. My script will recursive itself when it doesn't have enough items, so it's always flip flopping between crafting item or buying item.
So obviously, when it can't even tell which store is cheaper because the 1-5th cheapest were all in my forbidden stores.. It couldn't resolve. It was always trying to buy the item, but was refused as its in the forbiddenStores. So it recursed then tried to buy again because it's still reported as the cheapest.
The solution I believe should be to hide the forbiddenStores from the price checks, then to provide expected behavior for how many items should be available. We should probably exclude forbiddenStores from the anti-bot measure which skips the first 5 items. So the first 5 items will always be a store not in your forbiddenStores.