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):
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!
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!