//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;
}