Fleemarket

blue

Member
I wanted to know if it is possible to make a script that is able to put things in the flea market. Something like instead of manually putting 1 item at a time You should be able to put a whole load of items at the same price and time...

BTW: I know I wrote the title wrong... I just noticed
 
Last edited:

jasonharper

Developer
Mafia has no current support for the flea market at all. You could generate the URL for putting an item in the market yourself (you'd need to look at the page source in your browser to determine the necessary fields), and use that with visit_url(), but note that this will leave Mafia's idea of your inventory incorrect since it won't realize that the item is gone.
 

blue

Member
Thanks a lot :D this helped... I never actually taught about that.
There shouldn't be any problems with the inventory since it can be refreshed
 

mredge73

Member
It would be interesting to see what you come up with. If you can build something that can put items into the flea market can you post it?
 
Last edited:

mredge73

Member
Selling in the Flea market can sometimes make you more meat than with auto selling the same items so a Flea market function can be useful.
I have been experimenting with the FleaMarket and this is what I have come up with so far.
I am still not happy with it so if anyone else has tried to experiment with it please post. Mafia does not remove the items from inventory when placing them in the flea market so you have to have mafia autosell the items with a function similar to Bale's OCD script to remove them from your inventory, cli_execute("refresh inv") does not work. I am currently in hardcore so I cannot really test these thoroughly right now since I cannot sell things in the flea market while in hardcore. The Improvements that I want to make is to get the current flea market price using some kind of string handling function and sell items at or below that price.

Here is an excerpt from my scripts, to use it you will need to rewrite it since I did not define everything below but it is a working example:


Code:
//FleaMarketSell function

void FleaMarketSell(item Flea, int price)
{
	int howmany=item_amount(Flea);
	if (howmany>0)
		for i from 1 upto howmany
		{
			visit_url("town_sellflea.php?pwd&whichitem="+to_int(Flea)+"&          sellprice="+price+"&selling=Yep");
			print("Placing "+ to_string(Flea) +" in Flea Market for "+price+" meat.","blue");
			price=price+50;
		}
}

//Using Bale's OCD function to autosell items, Aftercore is defined as not in hardcore, EndOfRun is defined as the last day of a run before ascending, you cannot ascend while items are in the fleamarket so i think user confirm box is necessary

if(AfterCore && !EndOfRun &&user_confirm("Do you want to try the Flea Market Experiment?"))
{
FleaMarketSell($item[dope wheels],autosell_price($item[dope wheels])+100);
FleaMarketSell($item[antique helmet],autosell_price($item[antique helmet])+100);
FleaMarketSell($item[antique spear],autosell_price($item[antique spear])+100);
FleaMarketSell($item[antique shield],autosell_price($item[antique shield])+100);
FleaMarketSell($item[antique greaves],autosell_price($item[antique greaves])+100);
FleaMarketSell(($item[antique hand mirror]),autosell_price($item[antique hand mirror])+100);

//remove the items from inventory by autoselling, mafia does not handle them correctly
Auto_Sell[$item[dope wheels]]=0;
Auto_Sell[$item[antique helmet]]=0;
Auto_Sell[$item[antique spear]]=0;
Auto_Sell[$item[antique shield]]=0;
Auto_Sell[$item[antique greaves]]=0;
Auto_Sell[$item[antique hand mirror]]=0;
}
 
Last edited:
Top