Auto-use items

MCroft

Developer
Staff member
There are a number of places where I'd like to just have KoLmafia use an item if it acquires one. Otherwise, I end up with piles of things I should've taken care of and didn't.

Sometimes those have conditions, sometimes they're unconditional.

Examples of items that I would like to auto-use include:
  • straight-up cash things like black pension check and old leather wallet (etc).
  • things that are just containers for other things (astral six-pack)
Examples of items that I would like to conditionally auto-use include:
  • smut-orc keepsake boxes if the bridge is not complete
  • evil eyes if the Defiled Nook isn't clear

I have several approaches in mind for how to do this, and I'm not sure what's the best. Some are harder than others and may be less useful than others.
  • Find an existing script that someone else has already written to do this
  • create a custom daily deed and remember to run it.
  • write a post-adventure script (and turn on post-adventure scripts for the relay browser)
  • use some other type of timing, so that it doesn't waste cycles (pre-ascend, on King Freed, etc.)
  • add a new type of automation, which would be an acquisition script
  • enhance Item Manager's "Cleanup" so that it lets you decide what to do with an item
    • auto-sell
    • mallsell
    • closet
    • clan stash
    • put in trophy case
    • use
    • discard
    • run a script (this is how I'd handle conditionals)
    • send to user
On review, I have half-a-dozen approaches. Some are code, some are scripting. Some do more than others. I like the last one, but it's also the most work and the most change.

Does anyone have suggestions/ideas/feedback?
 

fronobulax

Developer
Staff member
Don't do it.

:)

Zarqon has a script that will use an item when it drops if that makes sense. Can't remember whether it is MercenaryMood or BestBetweenBattle. I know it handles evil eyes and smut orc boxes because I expressed my displeasure when trying to farm the latter. It is smarter now. Also uses rusty hedge trimmers which was (is?) actually a problem since it didn't verify that the "advance" conditions are met before using. That may have been addressed but I'm not sure. We also had some issues, since resolved, when pulling an item in softcore. The iteration of the script that used it immediately was soon replaced :)

I use BBS as a before and after script and it definitely runs when I am working in the relay browser but I don't know from which trigger. MercenaryMood is a mood and it works while in the relay browser as well.

Bale's OCD does pretty much everything you want for Item Manager's cleanup. I think it would be a bigger gift to the community to maintain OCD than to enhance Item Manager. I tend to run OCD once a month but others run it daily

The excavator framework lets an event trigger a script. If there was an event of interest already defined, you could trigger off of it. Not sure I'd recommend creating new event types, though.

Whatever you do needs to be opt in and configurable. There are people who collect old leather wallets and they, and their suppliers, would not be happy.
 

MCroft

Developer
Staff member
Yeah, I was thinking along the lines of “daily deeds”. And completely opt-in.

I have about 14 years of “not paying attention to community scripts” under my belt, and that’s why I asked before even looking at the code. :)
 

ckb

Minion
Staff member
As a point of reference - I wrote my own after-adventure script that uses (and sometimes autosells) such items. This works well for me and is easy to configure, especially when new paths make changes.
 

philmasterplus

Active member
Seconding the recommendation for OCD Inventory Control. It's a great hassle to set up the big list, but it works. Don't forget to back up data/OCDData_*.txt along with your KoLmafia settings.

Also, I believe from experience that the built-in cleanup routine automatically uses meat-producing items (e.g. Warm Subject Gift Certificates) if they are flagged as junk.
 

Magus_Prime

Well-known member
Don't do it.

:)
Seconded. :)

In all seriousness: both of Bale's scripts in question, UR and OCD, still work well. I've had to make a few, minor, path specific, changes to UR over the years but Bale did an amazing job with his scripts.

I use UR every day and OCD when the character ascends.

If someone with more scripting skills, than I, would be willing to take over development of UR and/or OCD that would be much appreciated.,
 
Top