Philter, the inventory cleanup script

Thanks Mandy, this helped! I found my data file location and deleted it, so that all items became uncategorised again. Then I chose "Keep all uncategorised items". This let me still be able to see new uncategorised items as I acquire new things. Am running the script now - going letter by letter to properly categorise things, then running it as and when, it's amazing to see my inventory finally clean itself up! Appreciate your help, you don't know how long I've been wanting to use this script!
It should be at ~/Library/Application Support/KoLmafia
You might not be able to see Library, but you can get to it from the 'Go' menu in the Finder if you hold down Option, or you can use shift-command-G to use the 'Go to Folder…' command to get there.

Edit: I've put a copy of my data file at https://controlc.com/7491ad33 with everything changed to KEEP. You're welcome to use it, with the proviso that I *believe* I've changed everything to keep, but I'd suggest running it in simulate mode just to make sure. Also, part of the fun for me was running the script and seeing what new items I'd picked up from various places; having everything already listed means that won't happen.
 

philmasterplus

Active member
Can you add back the searh when you do edits??

Philter Manager has learned how to filter items by name:

philter-manager-item-filter.png

This is available in the r800 update. Enter svn update in the gCLI to get it right now.

Philter Manager doesn't support a "full item DB search" yet. For now, you'll have to use Philter Manager classic for this.
 

Irrat

Member
Was setting up my rules and I noticed a few things.

1. It'd be cool if the top menu (Count, Price, Name, etc) were clickable to sort the rows. This was especially because I wanted to find the expensive stuff to sell myself, instead of sellbot it.

2. When switching tabs, I lost progress. Which I believe is because it effectively switched html pages. A warning box could possibly be implemented?

3. Displaying the item type can also be handy if you don't know all the items by heart. Food/Spleen/Pants/Drink/Combat Item/etc. Wasn't a common problem, but would be cool for filtering items.

That said, those are all minor things and the only thing I actually suggest is the 2nd suggestion. The other two are only time saving when initially setting up.

Love the script, especially the rework Phil!
 

philmasterplus

Active member
1. It'd be cool if the top menu (Count, Price, Name, etc) were clickable to sort the rows. This was especially because I wanted to find the expensive stuff to sell myself, instead of sellbot it.
Gausie submitted a PR for this a while ago, but I didn't have time to look into this. Since the demand is >1 I'll try to prioritize this over the others.

2. When switching tabs, I lost progress. Which I believe is because it effectively switched html pages. A warning box could possibly be implemented?
I assume you're referring to switching between top-level tabs (Add ItemsEdit Rules)? The app currently remembers edit state when you switch between subtabs (e.g. PulverizeUse). Added to the todo list.

3. Displaying the item type can also be handy if you don't know all the items by heart. Food/Spleen/Pants/Drink/Combat Item/etc. Wasn't a common problem, but would be cool for filtering items.
Good idea. I made a list of potential keywords in the tracking issue. I'm open to more keyword suggestions as long as they're short (4-8 characters).
 

judy_patootie

New member
I just ran philter on a pretty limited set of rules (adding some stuffed things to my DC) and it unequipped a few items (but not all of them) when running. Is it supposed to do that? Is this configurable somehow?

Code:
Waiting completed.
Updating inventory...
autoSatisfyWithStorage => false
Taking off fudgecycle...
Equipment changed.
Taking off Cloak of Dire Shadows...
Equipment changed.
Taking off Hairpiece On Fire...
Equipment changed.
Taking off shoe ad T-shirt...
Equipment changed.
 

philmasterplus

Active member
I just ran philter on a pretty limited set of rules (adding some stuffed things to my DC) and it unequipped a few items (but not all of them) when running. Is it supposed to do that? Is this configurable somehow?

If you have item X equipped and in your inventory, Philter will unequip it (by calling retrieveItem()) and cleanse them together.
If you have item X equipped but don't have any in your inventory, Philter will ignore it.

This is confusing and inconsistent.

I'd like to be more consistent: (1) always cleanup what you are wearing, or (2) always ignore what you are wearing.
We could add a new ZLib setting to control this, but I'm hesitant on adding a new config when we already have many. Will look into this anyway.

In the meantime, I suggest setting the "Keep amount" field in Philter Manager to avoid cleansing items you might want to wear later.

Edit: I created an issue on GitHub to track this.
 
Last edited:

judy_patootie

New member
It might be worth asking around, but I imagine most people would rather Philter ignore any items that are currently equipped. Equipping something is a definitive choice and it is highly unlikely that any of those items should be closeted/sold/moved to DC.
 

fronobulax

Developer
Staff member
I have not switched to Philter yet but I would prefer it ignored what is equipped. If that is not the right choice then I can always put on the Birthday Suit and then run Philter. I see no need for a preference to control this.
 

philmasterplus

Active member
Thanks for the advice! I think I'll aim for preserving items by default. I was planning to add a ZLib variable, but you convinced me otherwise.

That said, things are still going to be slightly tricky with Keep Amount. For example, suppose the player wants to autosell all but 1 of item X. If the player has one of X equipped and 2 of X in inventory, should Philter autosell one X or two Xs? My gut says "two X".
 

fronobulax

Developer
Staff member
My expectation with the predecessor script was that if something was being worn or in the closet or in the DC (not that any released version actually managed the DC) , the script pretended it did not exist. So if the expectation is to keep one of something that would be there would be one of that thing in inventory after running (assuming there was at least one to begin with). There is a certain type of "fiddly" that IMO is better handled in user documentation than with special cases and parameters.

Come back with me to a simpler time when any script that managed inventory ignored the closet, the display case and what was being worn. Hagnk's was similarly ignored because items had to be pulled (or Hangk's emptied) to be available in any meaningful sense.

Conceptually the ideal script for me and my style would only look at inventory and a manual process would be needed to move items from elsewhere if the script was expected to do something with them.
 

philmasterplus

Active member
My expectation with the predecessor script was that if something was being worn or in the closet or in the DC (not that any released version actually managed the DC) , the script pretended it did not exist. [...] Come back with me to a simpler time when any script that managed inventory ignored the closet, the display case and what was being worn. Hagnk's was similarly ignored because items had to be pulled (or Hangk's emptied) to be available in any meaningful sense.

Au contraire, OCD Inventory Control has been counting items in closet and Hagnks since 2013:
Code:
// available_amount varies depending on whether the character can satisfy requests with the closet etc. This doesn't
int full_amount(item it) {
    return available_amount(it)
        + (get_property("autoSatisfyWithCloset") == "false"? closet_amount(it): 0)    // Include Closet
        + ((get_property("autoSatisfyWithStorage") == "false" || !can_interact())? storage_amount(it): 0)    // Include Hangk's Storage
        - (get_property("autoSatisfyWithStash") == "true"? stash_amount(it): 0);    // Don't include Clan Stash
}

When I inherited this code 8 years later, I did not dare touch something I didn't fully comprehend. This discussion helped me wrap my head around it and I am grateful for that, frono.

Perhaps @Bale went for "convention over configuration". Perhaps some user requested this feature. In any case, this code affects what decisions I make, and I don't feel that I "own" this code...yet. Should I change it?
 

fronobulax

Developer
Staff member
Au contraire, OCD Inventory Control has been counting items in closet and Hagnks since 2013:

You misunderstood my comment. Perhaps if I had said in 2013 I immediately configured the script to ignore those places when the features were released and haven't looked at or changed them since it would have been clearer I was expressing a preference and not stating a fact.

For the record, I could argue that the KoLmafia closet preference is sufficient for this script and rather than have any special configuration in the script it should just use and honor that preference if that is not already the way things are.

Hagnk's has evolved. When there was a time when everything had to be pulled to be "available" to KoLmafia, my routine was to end a run and pull everything from Hagnk's. The driver was other scripts in my universe that acted on items but did not know about Hagnk's. And 33% of my characters have never ascended so have nothing in Hagnk's :)

But I was expressing preferences in response to questions about features and how they might be enabled, or not.
 
I want to add this to the end of my automated day routine, but sometimes I end up with items that I haven't categorized yet. Is there a way to tell it to ignore uncategorized items without having to manually click to skip uncategorized items every time?
Thanks for continuing to maintain this great script. :)
 

elysecat

New member
Hi - I'm running into an issue with the script where it tells me to create the stocking information, but when I make the default list and click save, it just reloads without saving the list, which is also stopping me from running the script successfully. Anyone have any ideas what might be happening here?
 
Amazing script, but I would like to second this request. It would be great if I could toggle an "Always ignore uncategorized items" setting, or, alternatively, if this msg box auto expired after a couple of minutes if there was no user input.
For players looking for inventory management that won't require them to manually configure thousands of items upfront, check out Rever's keeping-tabs script here: https://kolmafia.us/threads/keepingtabs-a-simple-inventory-management-script.27519/

It uses KoL's native custom inventory tabs to categorize items for processing, and it only tries to manage the items that you've specifically categorized. It's not quite as powerful as Philter, but it's much easier to set up and maintain, and it can be 100% configured via vanilla KoL without kolmafia (kolmafia IS required to actually run the script and process the items, though.).
 

Hison

New member
This is probably an amateur hour question but I spent a few hours making a profile, saved it and I backed up my entire KOL mafia folder. Since then I have used a new version and lost all my previous work. Where is the profile saved to so I can pull it over from my previous backup?

If that makes sense let me know Ive been using KOL mafia for awhile but its still magic to me.
 

matt.chugg

Moderator
This script was previously called OCD Inventory Control, my install uses data files named by the original script, so maybe look for:

data/OCDdata_{IGN}.txt
data/OCDstock_{IGN}.txt
 
Top