What Items Do I Have That (Might) Sell In The Mall?

Lxndr

Member
Okay! There's got to be a simple way to do this. But I've never done scripting with mafia before (and apparently my search-fu is weak, as I can't find any scripts that already do this). What I'm attempting to do is:

print a list of all items in my inventory that fit the following criteria:

(a) I have more than one
(b) They are tradeable
(b) Their lowest selling price in the mall is more than max(2*autosell,100)

Can anyone help?
 

lostcalpolydude

Developer
Staff member
Code:
int [item] mystuff = get_inventory();

foreach thing in mystuff
{
	if( is_tradeable( thing ) && item_amount( thing ) > 1 && historical_price( thing ) > 100 && historical_price( thing ) > ( 2*autosell_price( thing ) ) )
	{
		print( thing + " (" + item_amount( thing ) + "): " + historical_price( thing );
	}
}

Untested, but something like that should do.
 

Lxndr

Member
Code:
int [item] mystuff = get_inventory();

foreach thing in mystuff
{
	if( is_tradeable( thing ) && item_amount( thing ) > 1 && historical_price( thing ) > 100 && historical_price( thing ) > ( 2*autosell_price( thing ) ) )
	{
		print( thing + " (" + item_amount( thing ) + "): " + historical_price( thing );
	}
}

Untested, but something like that should do.

Nifty! You left off a parenthesis in line 7, but otherwise it seems to be working.

But there seems to be some sort of odd bug: it's claiming that, for instance, the tenderizing hammer's "historical price" is 1000 meat, when it's in the mall at 500 right now. I suspect this is because the last time I purchased said item it was in Hardcore, when 1000 was the price - but that purchase was not from the mall...
 

Winterbay

Active member
Mafia will only give you the 5th cheapest price (well, the price of the fifth item in the mall) which may or may nto give you odd results depending on the current market situation.
 

Lxndr

Member
Mafia will only give you the 5th cheapest price (well, the price of the fifth item in the mall) which may or may nto give you odd results depending on the current market situation.

Good to know, but since there seems to be at least twenty stores that have the tenderizing hammer at 500... I suspect this is not the case.
 

Veracity

Developer
Staff member
I think it always goes for the NPC store price for items available from such.
It should probably consider mall vendors as well, if you can use the mall.
 

roippi

Developer
I think it always goes for the NPC store price for items available from such.
It should probably consider mall vendors as well, if you can use the mall.

There's an open bug report/feature request along those lines that I've been procrastinating thinking about. Our options are to always buy from NPC (current behavior, most server-friendly) and to buy from whichever's cheaper (slightly more wallet-friendly, mostly due to the existence of travoltan trousers).
 

Veracity

Developer
Staff member
There are actually very few items that you can get cheaper in the mall, I think. The three items you can get in Bad Moon for 500 that normally cost 1000 might be all of them.
 

xKiv

Active member
Other things where autosell*2 < NPC price: big stirring stick, the inventory of armory and leggery
if you have travoltian and also consider autosell*2 == NPC price, there's much more (76 items in total, acording to my parsing of mafia's datafiles - this includes some of KG dispensary inventory, galaktik's balm and elixir, some general's store stuff, some armorcrafting stuff, some black market stuff, some organic produce, some guild stores things).
There seem to be 17 items that actually *do* sell in the mall for less than from NPCs:
Code:
[table]
[tr][td]iname[/td][td]autosell [/td][td] NPC  [/td][td] suse [/td][td] MALL [/td][td][/tr]
[tr][td] Knob Goblin nasal spray              [/td][td]        75 [/td][td]  150 [/td][td] t,d  [/td][td]  142 [/td][/tr]
[tr][td] can of black paint                   [/td][td]         0 [/td][td] 1000 [/td][td] t    [/td][td]  999 [/td][/tr]
[tr][td] chewing gum on a string              [/td][td]        25 [/td][td]   50 [/td][td] t,d  [/td][td]   47 [/td][/tr]
[tr][td] party hat                            [/td][td]        50 [/td][td]  300 [/td][td] t,d  [/td][td]  170 [/td][/tr]
[tr][td] foam noodle                          [/td][td]        50 [/td][td]  300 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] sweet rims                           [/td][td]        45 [/td][td]  300 [/td][td] t,d  [/td][td]  199 [/td][/tr]
[tr][td] jabañero-flavored chewing gum [/td][td]        20 [/td][td]  200 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] lime-and-chile-flavored chewing gum  [/td][td]        20 [/td][td]  200 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] pickle-flavored chewing gum          [/td][td]        20 [/td][td]  200 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] tamarind-flavored chewing gum        [/td][td]        20 [/td][td]  200 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] handsomeness potion                  [/td][td]        50 [/td][td]  300 [/td][td] t,d  [/td][td]  150 [/td][/tr]
[tr][td] marzipan skull                       [/td][td]        40 [/td][td]  300 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] Meleegra™ pills                [/td][td]        50 [/td][td]  300 [/td][td] t,d  [/td][td]  100 [/td][/tr]
[tr][td] shirt kit                            [/td][td]        50 [/td][td]  100 [/td][td] t,d  [/td][td]   95 [/td][/tr]
[tr][td] football helmet                      [/td][td]       150 [/td][td] 1125 [/td][td] t,d  [/td][td]  520 [/td][/tr]
[tr][td] Doc Galaktik's Restorative Balm      [/td][td]        60 [/td][td]  120 [/td][td] t,d  [/td][td]  114 [/td][/tr]
[tr][td] Doc Galaktik's Homeopathic Elixir    [/td][td]       120 [/td][td]  240 [/td][td] t,d  [/td][td]  228 [/td][/tr]
[/table]

Considering that two of those have "mall" price lower than 100, I might have some corruption in my source data ...
 
Top