Thingamabobs and Ingots

fronobulax

Developer
Staff member
Two kinds of Brickos. Profit opportunities. Advisory script here.

The similarities with the thingamabobs and ingots were obvious. I tweaked ManageBrickos so that it worked for the Crimbo2013 items. What it tells me is which items are cheaper to buy than make. If more that three people run this and act accordingly then I'm sure that will change.

Output doesn't paste well but includes:

The Name of the item.
The number of thingamabobs needed to make it.
The number of Ingots needed to make it.
The cost to make it if the components are purchased in the mall.
The cost to buy the item outright in the mall.
The difference between the make and buy cost.
The "profit" per thingamabob and ingot
The sales volume over the last five days according to Coldfront.

Requires CFStat.

I doubt that I will maintain it long term but feel free to ask for or just post fixes.

Happy Crimbo.
 

Attachments

  • ManageCrimbo2013.ash
    6 KB · Views: 124
Last edited:

Theraze

Active member
Thingamabobs and Ingots are reversed in the display... otherwise, nice. Almost got tempted to try to monetize soul cars, until I actually checked the mall and noticed the 1.2 million swing between cheapest (5th lowest) and the actual lowest. :)
 

fronobulax

Developer
Staff member
Thingamabobs and Ingots are reversed in the display... otherwise, nice. Almost got tempted to try to monetize soul cars, until I actually checked the mall and noticed the 1.2 million swing between cheapest (5th lowest) and the actual lowest. :)

Thanks. I swapped the data columns but missed the headers. Fixed in the original. Because of mafia's mall data conventions this definitely needs to be used with a grain of salt but I find it useful.
 

slyz

Developer
To take Kain's idea further, here is some code I use in most of my price-checking scripts. It allows me to load the pricegun price list instead of hitting the mall for the price of a large quantity of items:
PHP:
int [ int ] get_pricegun_map()
{
	int [ int ] pricegun_map;
	if ( !get_property( "_pricegunUpdate" ).to_boolean() )
	{
		string URL = "http://hogsofdestiny.com/kol/pricegun/dailyprice.log";
		if ( !file_to_map( URL, pricegun_map ) )
			abort( "Problem occured while loading dailyprice.log" );

		map_to_file( pricegun_map, "pricegun_prices.txt" );
		set_property( "_pricegunUpdate", "true" );
	}
	else
	{
		file_to_map( "pricegun_prices.txt", pricegun_map );
	}
	return pricegun_map;
}
int [ int ] pricegun_price = get_pricegun_map();

int get_pricegun_price( item itm )
{
	int [ item ] forms = itm.get_related( "fold" );
	if ( forms.count() == 0 ) return pricegun_price[ itm.to_int() ];
	int [ int ] prices;
	foreach f in forms
		prices[ prices.count() ] = pricegun_price[ itm.to_int() ];
	sort prices by value; return prices[ 0 ];
}

int get_price( item itm )
{
	if ( !itm.is_tradeable() ) return max( 0, itm.autosell_price() );
	return max( 0, itm.get_pricegun_price() );
}
More work can go into get_price() depending on what you want exactly, sometimes you might want to skip the "forms" check in get_pricegun_price(). This should give you a good enough basis to get what you need though :)
 

fronobulax

Developer
Staff member
Interesting. Thanks. It now looks as if there are four sources of price data, Mafia's historical and mall prices, pricegun as above and Coldfront (which is fetched and cached for those who use CFStat). Not that I need another project but it sounds like it might be useful to convert CFStat to use a "shared" data file and then make a wrapper that makes it easy and transparent to use the various sources.

As for ManageCrimbo2013, I thank everyone for not telling me it is still 2012. I won't fix, but the output column label "per Thingamabob" is not correct.

Is there way, in ash, to get a list of things than can be created from an ingredient? If so, it wouldn't be too hard to generalize so one script worked for brickos, skeletons, stars and perhaps one or two other items, plus anything new that gets added in the future and uses a similar mechanic. I suspect PriceAdvisor may have already solved the problem, if not.
 

slyz

Developer
PriceAdvisor goes through all the concoctions and builds the ingredients map from ingredients to concoctions and coconction type.

That part should probably go into a static{} block now, but apart from this slight performance tweak, aqualectrix's approach is still valid.
 

slyz

Developer
Instead of going through all of items[], PriceAdvisor loads concoctions.txt and goes through that instead.
 
Top