Feature - Rejected Store Inventory caching

fredg1

Member
Something that always bugged me out with the KoL store, is the impacts of having an item run out.

Once it happens, your store just "forgets" about the item: there's no notification that an item has been bought out, and it's price/limit is forgotten and has to be entered all over again (not the end of the world, but still...).



The only way to "counter" that is either restock before you're bought out (not like it's easy...), analyze your sales activity to check which item bought is no longer in the store (not trivial, and only fixes 1/2 problems), remember which item is in it by heart (...pass, please?), or note down your store's content.

Could mafia have a way to do that last one? A way for it to cache which items are in the store at what price, and inform us when one is bought out (maybe trigger only when you manually visit it)?
...Or is that already a thing somehow, and I'm just dumb?
 

lostcalpolydude

Developer
Staff member
It seems weird to want this, since I thought the point of a store was to get rid of things you don't want. Or maybe for regularly crafting something to sell at a profit, but then it seems like current mall prices are relevant to that.

Regardless, you can use get_shop(), and shop_price() (iterating over the items from the first function), then save that with map_to_file(), and then regularly compare the results of get_shop() to see if any items are missing.
 

fronobulax

Developer
Staff member
Would you restate the "problem"? I'm not getting it which means you and I play KoL very differently.

My hypothesis is that you stock your store with items and you always use the same prices regardless of the market. When you add to the store mafia will add to the existing stock at the same price if there is any there. But if you sell out then you have to remember what your preferred price is, correct?

So this might be a feature request for mafia to store a price and use it when an item is added to the store?
 

fredg1

Member
Remembering what price I set them at is mostly secondary. I'd mostly appreciate if it only remembered "which" items were there.

I'm not asking this for automation (as it would be if I were to use map_to_file() ), I manage my store by hand.

Remembering the price would be to give me an "idea" of what i should do next (i'd compare that to the existing lowest price; did the item run out because it's been a while (price is the same, maybe went down), or because the demand suddenly increased?(price went up) )
I don't undercut by, like, 1 meat. I undercut by a fair amount, but with a limit, so others don't immediately undercut me, as they see they'll still get sales even with me "in the way" of their profit. I prefer not leaving the "how much" to a script.
 

lostcalpolydude

Developer
Staff member
I was suggesting that you manually run such a script once per week or something, to manually make relevant decisions with the information.

Among other things, I'm not sure how mafia would store the past information without overwriting it when you view your store, which seems like it would completely defeat the purpose of tracking it in the first place as far as this feature is concerned.

Remembering the price would be to give me an "idea" of what i should do next
This confuses me, because wanting to sell something while also having enough volume in your inventory to make any meaningful decision about selling more later seems irrational.
 

fredg1

Member
Among other things, I'm not sure how mafia would store the past information without overwriting it when you view your store, which seems like it would completely defeat the purpose of tracking it in the first place as far as this feature is concerned.

could be like preferences, in that it tells you when there's a change at all, and what the change is.

Besides, since the only important thing is items that go missing, if you don't visit your store with vanilla or visit backoffice.php?action=removeitem , any item that was there last time you checked but isn't on the next visit must mean it was bought out, right?

This confuses me, because wanting to sell something while also having enough volume in your inventory to make any meaningful decision about selling more later seems irrational.

By "what to do next", I meant "should I put a different price, and if so, different by how much?", not "should I wait later?"
 

fronobulax

Developer
Staff member
"The Mall is not the Game" - Jick, a long, long time ago.

I'm thinking you could script what you need. On the first day, call get_shop and save the results in a file. On the next day, call get_shop and walk through yesterday's and today's results. If you get end of day results when you log out then differences would just be the items that were sold out in the past day. (You only care about the item (key) and not the quantity). You can then do whatever research you want including restocking. Get today's inventory when you log out, save it and repeat.

There are several examples out there of how to do a "diff" on two maps, although they usually deal with inventory.

You might also consider parsing the store log - if it isn't in the log then it didn't sell and you don't have to do anything about it.

CFStat may be of interest because it gets price and volume information from ColdFront. ManageStore may be of interest although it deals with a different problem - decluttering your store by autoselling things that are unlikely to sell,
 
Top