# save as anything.ash, then run it for a sorted list of things # to zap, sorted by profitability # Since mafia uses the 5th cheapest price for items, scarce # items will have results that aren't sensible, so make sure # to manually check prices before committing to an item # Change threshold below to see more (or fewer) options int threshold = 10000; boolean only_use_inv = true; record my_type { item itm; int price; }; my_type[int] prices; int get_price( item it ) { if ( historical_age( it ) < 3 ) { return historical_price( it ); } return mall_price( it ); } foreach it in $items[] { if ( only_use_inv && item_amount( it ) == 0 ) continue; int[item] stuff = get_related( it, "zap" ); if ( count( stuff ) != 0 & it.tradeable ) { int total = 0; foreach x in stuff { total += get_price( x ); } total /= count( stuff ); total -= get_price( it ); int priceindex = count(prices); prices[priceindex].itm = it; prices[priceindex].price = total; } } sort prices by value.price; foreach j in prices { if ( prices[j].price > threshold ) { print_html( prices[j].itm + ": " + prices[j].price ); } }