Historical price data

Bale

Minion
So Z - how about rolling auto-price-uploads in to zlib, so we can all distribute it to the mafia masses in our new scripts?

It's too darn simple to need inclusion in zlib.

Once a day just do
cli_execute("spade prices http://zachbardon.com/mafiatools/updateprices.php");


Edit: On second thought, zlib is exactly where it needs to be! That way all scripts have access to information about whether its been updated yet.
 
Last edited:

dj_d

Member
Right. So we have a massive distributed pricing database that's updated continuously and in realtime.
 

Bale

Minion
There's just one problem I have... I know how to make the database update at first run, but I'd much rather update the collective database after the player has run 200 adventures that day...

I just don't want to make adding a logoff script to be an essential part of my script to ensure pricing data is being shared.

Meh. It's still pretty awesome.
 

dj_d

Member
You could just have it run when there's 2 adventures left - likely that that occurs at or near the end of the day. Otherwise I'll include it in the overdrink section of eatdrink.ash, but it won't get quite the audience that way.

By the way, I'm assuming it does nothing if you've already uploaded once a day so we don't have to worry if multiple scripts call it - is that right?
 

Bale

Minion
You could just have it run when there's 2 adventures left - likely that that occurs at or near the end of the day.
Probably the best method... That shouldn't happen often in a day... At least for normal sorts of adventuring.

By the way, I'm assuming it does nothing if you've already uploaded once a day so we don't have to worry if multiple scripts call it - is that right?
Somewhere (in this thread or the commit log), Jason did say that it will only work once per session. I can tell you from experience, that if you log out and log in with a different character that means it won't update. However if you quit mafia completely, when you start up again it will update even for a character previously updated.
 

Bale

Minion
To submit your prices, perhaps in your logoutScript, use:
spade prices http://zachbardon.com/mafiatools/updateprices.php
zarqon, could you offer us any usage stats on how many times a day your pricelist gets updated? How many items are updated in a day? I find myself being curious.

I just know that I'm getting my pricelist updated quite a bit whenever I update from you so I suspect things are going well.
 
Last edited:

dj_d

Member
Suggestion: right now, if you run historical_prices on something like Mt. Noob Pale Ale, it returns 0. Instead, return -1. That way we can tell if it's 0 because there's no historical data (and we should call mall_price) or if it's 0 because it's un-mall-able.

On a related note, you might want mall_price for nontradables to NOP instead of using a server hit.
 

zarqon

Well-known member
I don't think I'll be adding this to ZLib. I don't care much for a wrapper function for a single command, and if it's outside a function (run when calling ZLib) many scripts will have a user-confusing "Already submitted this session" message any time they run a ZLib-empowered script. Further, as Bale mentioned, it's better to submit updated prices at the end of a session.

I normally oppose adding preferences, but I would support a mafia preference "share/update my mall prices with/from Zarqon's server," unchecked by default, which would perform the whole login-fetch, logout-submit thing automagically.

As for usage statistics, that would be interesting. I'll see about dumping stats somewhere when updating and then making a browser visit to the script display that info rather than the sim/debugging thing.
 

Bale

Minion
I'm glad to hear you like the idea of statistics for the service.

I normally oppose adding preferences, but I would support a mafia preference "share/update my mall prices with/from Zarqon's server," unchecked by default, which would perform the whole login-fetch, logout-submit thing automagically.
This. Me too. It would be advantageous to the whole community.
 

dj_d

Member
It's now built in to the latest version of eatdrink.ash (and, consequently, ascend.ash). Which I should mention is WAY faster now as a result! It'll get even faster, btw, if the suggestions I mentioned about nonbuyables becoming NOPs are implemented. ;)
 

jasonharper

Developer
There's already an is_tradeable() function, you don't have to wait on me to determine whether there's any point in trying to look up prices for a certain item...
 

Spiny

Member
Well... I have a question or more :) Surprise surprise lol.

I've recently downloaded the newly (improved?) updated GM script called Logikol Pricegun. It uses Coldfront, Items of Loathing and Kolmafia as sources for price data and the user can select which source to cull data from.

I checked out my values with all three sources and kolmafia thinks my overall value is 200mil and Coldfront things my value is 33mil. Wow, how hugely different those two values are! So I started looking at different reported prices and the first thing that caught my eye was a pixel boomerang is valued at 987,654,321 by mafia. This happens to be the highest priced boomerang currently in the mall.

Comparatively:
Coldfront reports 6392 and Items of Loathing reports 4667.

I don't think any source is going to be 100% accurate, but I would hope that Kolmafia's would be on account of the fact that it is so new and it was my impression that all prices are set when an item is searched or a purchase is made and would otherwise be set to 0 due to being unknown yet? Does this ridiculous value of the pixel boomerang imply that a mafia user actually bought one at that high price and submitted the data to zarqon's site? Or does it imply that there is some logic in the Logikol Pricegun script that isn't right?

I'm just trying to understand it.

Thanks,
Spiny
 

lostcalpolydude

Developer
Staff member
Does this ridiculous value of the pixel boomerang imply that a mafia user actually bought one at that high price and submitted the data to zarqon's site?

It means that someone searched for it, not that someone bought it. Also, perhaps because of your post, there are several stores with pixel boomerangs now. A single search updates local mall price files, and any one of those people sending updated price data fixes the data file. That greasemonkey script led to me searching for the current IotM and submitting data to update that value (from 0).
 

Spiny

Member
It means that someone searched for it, not that someone bought it. Also, perhaps because of your post, there are several stores with pixel boomerangs now. A single search updates local mall price files, and any one of those people sending updated price data fixes the data file. That greasemonkey script led to me searching for the current IotM and submitting data to update that value (from 0).

I guess I had a brain fart. I was expecting my personal searches that updated my local copy of mallprices.txt to immediately affect the GM script's data. Of course it doesn't work that way because the data is fed from Zarqon's hosted site to Adiamante's local data that is then converted in a way that the GM script understands, but that only happens once a day. I am used to my pricing data in Kolmafia to be updated each time I switch to another character to play. So all is well, I just had a brain fart.... I'll just have to wait till his data updates tomorrow.

-Spiny
 

lostcalpolydude

Developer
Staff member
What are the conditions for being able to upload mall prices? If I log on with mafia, then do a mall search (with mafia's interface) specifically to correct a bad price (in this case, meat golems at 987,654,321 meat, which could be fixed by me and another person having added them to our store just for this purpose), then try to upload, I get "You have no updated price data to submit."
 

Bale

Minion
The condition is that you need to search for the price in CLI with some sort of command like...

cheapest meat golem

I cannot remember if a search in the purchase tab will do the job. However, I can tell you that if you searched for prices before items were added to a store, then it will not update the info, since it will only do that once per day. However, you can get around that restriction by actually purchasing one of your meat golems from the CLI, like...

buy meat golem
 

zarqon

Well-known member
Of course it doesn't work that way because the data is fed from Zarqon's hosted site to Adiamante's local data that is then converted in a way that the GM script understands, but that only happens once a day.

Actually, when Adiamante asked me in a very gentlemanly fashion about accessing this data, I gave him permission to re-cache the data as often as every 30 minutes. I don't know what interval he finally decided to use, but I doubt he went with once a day, since I suspect (haven't yet written the stats-dumping thing) that prices are updated quite frequently.
 
Top