Mall data gathering

Malthan

New member
I'm doing an adaptive buisiness intelligence project based on kol item prices and I need to gather my own data, since mallbot seems to have been broken by the mall update.

So far I've worked out something like this:
Code:
boolean main()
{

cli_execute("mirror "+today_to_string()+".txt");
   for i from 1 to 5 {
      item it = to_item(i);
      if (is_tradeable(it) ) {
        
         cli_execute("echo "+i+" "+to_string(it));
         cli_execute("searchmall " + to_string(it) + " with limit 8");
	 cli_execute("wait 4");
      }
   }
}

But then the end result looks like this:
1 seal-clubbing club
Searching for "seal-clubbing club"...
10 @ 100 meat
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.

Is there any way of removing the "Searching for "seal-clubbing club"..." and the "Countdown...waiting completed" lines from being sent to the file?
 

Bale

Minion
Sorry, but mafia is incapable of doing anything for you with that data, or even printing it to a file. That's by design, specifically to keep anyone from making mallbots with it. If you have the time and can spare the tedium, you can copy/paste it into a file yourself, but that's all mafia can do.
 

Malthan

New member
But it is saving to a file - that's what mirror command does. I'm just wondering if there's a way for it to not give the "Countdown.." statments - can I somehow modify the code of how the wait command works?

I can just parse the file with a diffrent program that will cut all the trash lines, but it would be more elegant to just have it written in that form in the first place.

So far the only way I see is to modify the mafia sourcefiles and build my own version.
 
Last edited:

Malthan

New member
I use the wait not to hit the server with requests too often, since I believe that can get you banned, and I don't know how long mafia pauses before the requests in loop.

I got a lot of help from items of loathing admin, but I need to gather my own data to use diffrent kind of analysis on it - data like amount of items etc. - the items of loathing get the avarage from 3 lowest items and that's not enough for my needs. For example it shows seal tooth at 499 when it reality it's closer to 100 etc.

Since it looks like scripts cannot help me much more I compiled my own mafia version with changes to how the wait and mallsearch work, but I still think it would be nice to get it to work in official version.
 
http://kolmafia.us/showpost.php?p=12179&postcount=4

here's one that does that. how much data do you want? there's 3000 items in the mall, so figure 4.5 hours with the wait. I kmailed multi czar about searching the mall, and he told me to wait 30 seconds between searches. He also told me to fuck off and not bother him unless it's important, which means never, so I wouldn't worry about a single iteration at all.
 

Malthan

New member
forgot my password - either I'm not reading correctly, or the scripts you link don't gather any data, they just used data that's stored in the files? I will be gathering how much of every item is in mall and how it's priced. Also they seem to be based only on 5th cheapest items price, which is even worse precision than that of items of loathing.

And it's not a single iteration - I will need to do it daily.
 

Malthan

New member
Yes, that's what I'll be doing. My script gathers data for all items, limited by the with limit setting - I believe data about 8 cheapest stores should be fine, but I may need ot increase it.
 

mredge73

Member
so you want the price from 8 different stores for one item, and you need the amount of items each store has.

So what exactly is the purpose of this?
I can think of a few but they are not postable here (mallbot territory).

I would love to have this info for this purpose (I think I can post this one):
A single iteration of this (one day) can give great information on who has a monopoly on every item in the game and at what price he makes his best profits. This would be helpful in undercutting that store by one meat for your items, this will ensure that you make the maximum amount of meat for your items no matter if the guy who has the monopoly buys your stuff or regular customers buy your stuff.

Now I am not sure if that is mall bot or not but I am interested if you can make it work.



Oh, and to answer your question
After running your script and getting your log file, you can move it to your script file.
After that you should be able to:
load it into a string,
create a matcher to match the info that you want
map each entry that the matcher finds,
and build a new file based off of that map.

It will be a very short script but it won't be easy to make, matchers are tough so good luck.
 
Last edited:

Malthan

New member
The data has many purposes, the ones I'm interested in most are

a) being able to get the best diet for farming based on current and hystorical prices of items and expected gains. Something like houeland / Eleron's KoL diet lists, except that it will update itself everyday automatically.

b) selecting best place to farm based on available items and skills, and prices at the mall

c) gathering data of prices fluctuation that will help with making investments - for example, how does feast of boris affect prices of food items?


As for working on the log file - I will do that in a completely diffrent programm, not by mafia script. I just wanted to check if I can get the log to look cleaner, and it turned out the easiest way is to recode mafia.

Currently my log file looks like this:
1 seal-clubbing club
Searching for "seal-clubbing club"...
15 @ 100 meat
Waiting completed.
2 seal tooth
Searching for "seal tooth"...
7 @ 100 meat
3 @ 190 meat
26 @ 195 meat
1 @ 199 meat
10 @ 200 meat
Waiting completed.

Which is pretty much what I was hoping for, I only need to eliminate the "waiting completed" and "seaching for" lines.

EDIT - with a bit more mafia changes I was able to cut those statements, so everything now is working as I imagined. The bad part is having to do those changes again when new mafia release comes out.
 
Last edited:

dj_d

Member
malthan - check out eatdrink.ash for your first point. It does pretty much exactly what you're asking for - prepares a daily diet for you based on mall prices and adventures, fullness, and stat gains.
 

mredge73

Member
Does anyone know a way to get the current mall prices for an item?
Mall_price gets the 5th
value.ash gets the average of the 3 lowest from loathing.com

The one I am most interested in is the monopoly price, the price in which someone has control of the market. For example, lets say I have about 20 of IT and need to price it to sell in the market. If I use mall_price to price it and the guy who has 2000 of IT is at the 4th highest price then my stuff will never get sold. If I use value.ash then I run the chance of low-balling the price and giving the items away to some mall bot. I made an attempt to use visit_url to parce the market searches but failed because the url could not be visited for some reason. Does anyone has a better solution or is this disabled in mafia?

Malthan do you have the info that you are gathering posted publicly?
 

Bale

Minion
Part of the design philosophy for kolMafia is to make it bad for creating mallbots. For that reason all publicly available sources of mall pricing are lacking in information. Some features that might help are purposefully hobbled.
 

Malthan

New member
mredge73 - just look at the script I posted, it does a bit of what you are looking for.

Specifically you need to do :

Code:
cli_execute("searchmall " + to_string(it) + " with limit 8");

Where 'it' is the item you want to search for. You can change the search limit of course.

Naturally you will need to do a few things with the result, which may require some writing and I'm not sure if it all can be done using the official mafia distribution. What I'm doing is taking results of such searches, done in a bit modified way so I only get the item id, name, prices and quantities, save them all to a .txt file and then load the data and work on it using a Java application and PostgreSQL database.

I don't know if it's possible to make a script that will by itself get the prices, find the lowest price below monopoly price and put your item in mall using that price. Becouse that's very close to a buybot - the only diffrence is putting the item in mall instead of buying it. I uderstand that's what you are trying to do? In my opinion it either requires changing mafia code a lot, writing a second application or a human who does a few things every time the script is run.

As for my data - currently it's not posted anywhere, I'm still trying to work out how large search limit should I put, or weather it's better to not use the limit option at all and limit the search results myself in the other application.
 

mredge73

Member
Alright
So I am out of luck in solving this problem with a script. I guess I have to do pricing manually or find a solution out of mafia. I am not interested in changing mafia source code.

The cli_execute is useless for scripting since it doesn't return anything back that can be used.

Thanks
 
Top