Stop cooking/cocktailcrafting after chef or bartender explodes?

rlbond86

Member
I could have sworn mafia has this feature, but I can't seem to find it. If I type "create 10 hot and sour sauce" in the CLI, and the chef-in-the-box explodes, it keeps making stuff anyway, using up my adventures. I think it might be that the "You are about to spend adventures crafting" dialog box pops up once PER DAY. So if I spent an adventure that day creating a Crimbojito in-run for example, then the setting persists. Is there a way to make mafia ask every time, or at least stop everything when a chef- or bartender-in-the-box explodes?
 

Winterbay

Active member
Item manager -> crafting -> require boxes at the top (there's also a setting to rebuild your box if it explodes.
 

rlbond86

Member
Ok another question! If I check that box, is there a way to tell the create command to override for a particular item? Or do I have to go in, uncheck the box, make my item and recheck the box? Thanks
 

Bale

Minion
I cannot imagine why you'd need a specific override, but it doesn't exist. What is the problem you want to solve with a specific item override?
 

rlbond86

Member
Well I was trying to make peppermint drinks when I got some booze on day 1. Had to open the food dialog and uncheck the box that way. No big deal I guess but I wondered if there was something like "create! 2 crimbojito".
 

Winterbay

Active member
You can aloways design your own alias:
Code:
alias force_create => ash string input = $string[%%]; string[int] split = split_string(input, ","); int amount = to_int(split[0]); item thing = to_item(split[1]); if(get_property("requireBoxServants") == "true") {set_property("requireBoxServants", "false"); create(amount, thing); set_property("requireBoxServants", "true");} else {create(amount, thing);}

This would then be called with the following command:
force_create 2, crimbojito
 

Veracity

Developer
Staff member
For the record, set_property is a NOOP if the property already has the requested value. You could do something like this:

Code:
boolean old = get_property( "requireBoxServants" );
try {
    set_property( "requireBoxServants", false );
    craft( amount, thing );
}
finally {
    set_property( "requireBoxServants", old );
}
Onelineified for use in an alias, of course. :)
 

Winterbay

Active member
Granted this is a very short scriptlet so it probably doesn't matter but in your code you always do 3 calls (1 get_property and 2 set_property) while my code does one call (get_property) if it's set to false and 3 otherwise meaning a potential for less calls. Would this matter in any way?
 

rlbond86

Member
Great idea for an alias, guys, it works perfectly! Thanks. Aliases are one feature of KoLmafia I always seem to forget about.
 
Top