Script modification request

Gadaree

New member
Hello, my good men (and women).

Having returned from a 2.5-year break, I realized that my inventory is a mess and there are quite a lot of items I want to smash on a regular basis rather than autosell them or forget about them like I always do.

The script I've been using so far wasn't made by me, I picked it up somewhere around these parts. It looks like this (long unnecessary lists cut out):

Code:
void npcsell(item itemtosell, int numbertokeep)
{
	if (item_amount(itemtosell) != 0)
	{
		if (item_amount(itemtosell) > numbertokeep)
		{
			print("Auto-Selling " + itemtosell + " (" + (item_amount(itemtosell) - numbertokeep) + ") (keep " + numbertokeep + ")");
			autosell(item_amount(itemtosell) - numbertokeep, itemtosell);	
		}
	}
}

void mallsell(item itemtosell, int numbertokeep)
{
	if (item_amount(itemtosell) != 0)
	{
		if (item_amount(itemtosell) > numbertokeep)
		{
			print("Mall-Selling " + itemtosell + " (" + (item_amount(itemtosell) - numbertokeep) + ") (keep " + numbertokeep + ")");
			put_closet(numbertokeep,itemtosell);
			put_shop(0,0,itemtosell);
			take_closet(numbertokeep, itemtosell);
		}
	}
}

void display(item itemtodisplay, int numbertokeep)
{
	if (item_amount(itemtodisplay) != 0)
	{
		if (item_amount(itemtodisplay) > numbertokeep)
		{
			print("Displaying " + itemtodisplay + " (" + (item_amount(itemtodisplay) - numbertokeep) + ") (keep " + numbertokeep + ")");
			put_display(item_amount(itemtodisplay)-numbertokeep,itemtodisplay);
		}
	}
}

void use_stuff()
{
	use(item_amount($item[ancient vinyl coin purse]), $item[ancient vinyl coin purse]);
	...
	use(item_amount($item[six pack of Mountain Stream]), $item[six pack of Mountain Stream]);
}

void autosell_stuff()
{
	npcsell($item[7-Foot Dwarven mattock],1);
	...
	npcsell($item[wussiness potion],1);
}

void mallsell_stuff()
{
	mallsell($item[beer lens],6);
	...
	mallsell($item[white picket fence],0);
}

void display_stuff()
{
	display($item[broken carburetor,0);
	...
	display($item[broken sword],0);
}

void main()
{
	use_stuff();
	autosell_stuff();
	mallsell_stuff();
	display_stuff();
}

I tried writing a block that would pulverize things if there are more than X of them in the inventory (by copying the way npcsell function works here), but KoLMafia didn't buy it.

I'd be very happy if someone posted the right way to modify this script so that it would also smash things similar to autoselling, mallselling, etc. I hope I'm not imposing too much.

Thanks in advance!
 

Theraze

Active member
Two things... one, talk and questions about scripts (as opposed to posting something that you want other people to use) is generally best done in Scripting Discussion. It just makes it easier to find things when you come back years later, since if you know you asked a question about it, it will be in the discussion section. :)

Two... if you did something and it didn't work right, it helps us to see what you actually did rather than just your description of it. Mind posting your pulverize change (or the whole script including that change) so that we can help you figure it out?
 

fronobulax

Developer
Staff member
You might want to investigate Bale's OCD Manager. While it is somewhat daunting to set up the first time and confirm that it will do what you want, once it is in place I have found it so much easier to run than to maintain something myself, unless there is some kind of niche case.
 

fewyn

Administrator
Staff member
I fully endorse Bale's OCD Manager. I use it manage all my inventories across all my multis and it's great.
 
Top