Amount of a particular item left in Mall

dapanda

Member
Hi Everyone,

I had a question (that I included below) but then I took the time to work on the problem myself. I have been able to get the data I want in a format that I can work with BUT I am worried that it may have some issues with the definition of what a mallbot is/isn't.

I am trying to find a way to get the TOTAL amount of an item left in the Mall. I don't mean the price for them, just the total left. Like "a cute angel" only has 41 left in the Mall. This can be done manually but that is a lot of data to go through manually. This isn't a script that I will be running often, maybe once a month (if even that). It would do a search on about 100 items that I do not have but will decrease as I get more.

Below is my original question:
-------------------------------------------------------------------
I know this isn't a high importance variable (or script) to most people but as a collector I was wondering if there was:

Is it possible to tell the total amount of an item remaining in the Mall? If not maybe just the number of stores in the Mall that stock that item?

From kolmafia you can do *searchmall a cute angel* and it will give a total number.

REASON:
As time passes, IoTM/IoTY become rarer as their stocks are limited. I would like to see which items have the lowest inventory so I can make my purchases based off of the amount. I am trying to get the IoTM/IoTY with the least amount of real money

I didn't see anything on Coldfront that had that information and I didn't see anything in the wiki that involved the Mall for that (I could have missed it but it doesn't seem like it was something that would be in high demand).
-------------------------------------------------------------------

Again please note that I am looking for the total amount of items left in the Mall, not the price. Unfortunately the commands I saw all include the item price along with the amount.

Thanks to anyone that reads this!
 
Last edited:

fronobulax

Developer
Staff member
Interesting question. Not sure what an answer is yet. But one clarification - you use "store" but don't you really mean (the entire) mall?

The Coldfront volume data might be a proxy. CFStat will fetch the seven day volume. In the absence of comprehensive "supply" data the lower the seven day sales volume the more likely the item is to be "rare". But if I were converting real world money to meat I would definitely want to buy the rarest item and not the one with the least sales (under the assumption that price will rise as the supply declines).
 

dapanda

Member
I updated my previous post to be clearer (store was replaced with Mall). That is my thought also. I have the script I am just worried that it may get me in trouble
 

fronobulax

Developer
Staff member
I updated my previous post to be clearer (store was replaced with Mall). That is my thought also. I have the script I am just worried that it may get me in trouble

To answer your "trouble question" - I cannot speak for Jick and company. There have been reports of KoLmafia users getting an official reprimand and Jick commenting on KoLmafia on "the radio". As reported, both cases boiled down to server hits and your script seems unlikely to generate as many as some poorly written scripts in an infinite loop have done so you are probably safe there.

As for the devs and the KoLmafia community, the concern has been over a bot that would buy (and sell) items in the mall and thus take advantage of pricing errors and so on. There is the additional concern that whatever the MallBot does it will be able to do "more and faster" compared to a single person on one computer. Since this script merely gathers information and is not actually doing any buying and selling, I personally would have no problems with it (and as a DC obsessive might even use it occasionally). I can only speak for myself but I don't see a reason to be concerned.
 
I've got a 'mall.ash' relay script for this purpose.
It's a pretty blunt instrument, and for things stocked by more than the max number of stores shown I need to click the 'Show more stores' button to get all the results to show, then sum the numbers returned by the script (the visit_url() value for each click only contains the additional results, not the entire list).

Code:
void override() {
	buffer results = visit_url();
	matcher m = create_matcher('class="small stock">((\\d|,)+)<',results);
	int stock;
	while(m.find()) {
		stock += m.group(1).to_int();
	}
	print_html(stock + " items seen on this mall page.");
	results.write();
}

void main() {
	override();
}
 

dapanda

Member
I finally did it. The script was very simple and then it needed to be export to a spreadsheet program. I was able to get a total number of each IoTM/IoTY remaining I was missing. One nice side affect is that it told me at that exact moment how much real world money I would need to have to purchase my missing items. It was over 3k USD mainly because of items that are so low in stock, looking at you "orphan baby yeti". I am going to try and make it more user friendly through where it just searches for the IoTM/IoTY you are missing and not ones you manually have to enter. There will always be some user interaction through.
 
Your script could leverage work done by Cheesecookie in the snapshot script he maintains, specifically the data files and checking method. This would save mall searches for items you already have as well as server hits on things you don't care about.
 
Top