Is there a way to auto stop when picking up a brand new item?

I'm doing the Crimbo 2022 content, and there are a lot of new, rare drops. Every zone has at least two. I already know you can input a custom condition to get Mafia to auto stop when you pick up a specific item or quantity of items, but what I can't figure out is if there's a way to get it to stop when you acquire a brand new item, period. If I get ANY of the drops that I don't already have at least one of, I want it to stop.
 

MCroft

Developer
Staff member
This is the wiki entry on triggers: https://wiki.kolmafia.us/index.php/Trigger

Here's a related trigger from that page. You just need to work out exactly what conditions you need on which to abort.

Example of an unconditional trigger to abort adventuring when a hunter brain has been found that you can eat:
trigger unconditional, , ashq if(item_amount($item[hunter brain]) > 0 && my_fullness() < fullness_limit()) {abort();}

So what you want to do is create something that you can check, like populating a "date first found" in the notes field, and if the notes is blank, abort...
 
Whoof, that's definitely above my skill level. I'll have to decide whether it'll be worth it to me to spend the time to do some reading up on it, or if it'll be less hassle to just keep a close eye on the items acquired in the session results. But at least there does seem to be a way to do it, so thanks!
 

MCroft

Developer
Staff member
I'm not sure if it's the best way (and honestly, I haven't tried writing to the notes field), but if not there, a similar data file could be made.

Also, I am not sure what inventory management scripts are out there that already may have similar functions.

If you'd like to get into scripting, the wiki has some great starting places. https://wiki.kolmafia.us
 

ckb

Minion
Staff member
You might start y checking out https://wiki.kolmafia.us/index.php/ASH_For_Beginners

You can then write an .ash script that runs after every adventures and set it as your Post-Adventure script (In the Mafia menu, choose General - > Preferences, then 'Automation')

The script can be simple like this:
Code:
if (available_amount($item[deactivated mini-Trainbot])>0) {
    abort();
}

a more involved script might be this:
Code:
void main() {
    foreach it in $items[
    Trainbot radar monocle,
    Trainbot harness,
    portable ping-pong table,
    trainbot autoassembly module,
    Trainbot luggage hook,
    white arm towel,
    automatic wine thief,
    silver table-scraper,
    deactivated mini-Trainbot,
    portable steam unit,
    ] {
        if (available_amount(it)>0) {
            abort("you found "+it);
        }
    }
}
 
Top