Feature Restore outfit before crafting

Bale

Minion
This is one of those requests which is half-bug and half-feature request. Let's say that KoLmafia is being sub-optimal in its actions and needs to be tuned up a bit.


As mentioned HERE...
Lord Bitchalot said:
If you put on spangly mariachi pants to regenerate mp from turns spent crafting, and you have mafia automatically buy, say, fruit for your ACs, it will equip the hippy outfit, and then craft before equipping your previous stuff, denying you that delicious mp.

I've also run into this problem when KoLmafia removes my Van der Graaf helmet. It would improve mafia notably if the outfit restoration step happened immediately before the crafting step.
 
Last edited:

Veracity

Developer
Staff member
Is it being suboptimal or is it saving server hits?

You might need the hippy outfit (or the frat or hippy war outfit, if the war is still on) or the bugbear outfit to get ingredients for crafting.
You propose, essentially, that we save and restore an outfit checkpoint around each ingredient purchased that requires an outfit change.
If we do that, we are guaranteed to be wearing our initial outfit when we actually use these ingredients to craft.
If we do that and you queue up several kinds of AC drinks, requiring different fruits from the hippy store - and possibly boozes from the hippy store, if you can distill them yourself from juniper berries or cob of corn or bowl of rye sprouts - we are also guaranteed to do multiple outfit swaps, rather than just one..
 

Veracity

Developer
Staff member
For reference, here is a set of checkpoint create/restore pairs that we have specifically because those NPC stores require outfits. As you can see there are a lot of specific places that could be replaced by a centralized save/restore outfit arounf NPC store purchasing.

./persistence/ConcoctionDatabase.java:927: SpecialOutfit.createImplicitCheckpoint();
./persistence/ConcoctionDatabase.java:958: SpecialOutfit.restoreImplicitCheckpoint();

This is handling the consumption queue: it saves the outfit, makes and perhaps consumes food and booze, and restores your outfit.

./swingui/panel/CreateItemPanel.java:130: SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateItemPanel.java:132: SpecialOutfit.restoreImplicitCheckpoint();

Item Manager "create" panel - "create item"

./swingui/panel/CreateItemPanel.java:172: SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateItemPanel.java:174: SpecialOutfit.restoreImplicitCheckpoint();

Item Manager "create" panel - "create & use"

./swingui/panel/CreateSpecialPanel.java:144: SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateSpecialPanel.java:146: SpecialOutfit.restoreImplicitCheckpoint();

Item Manager "create" panel - "create item"

./swingui/panel/CreateSpecialPanel.java:186: SpecialOutfit.createImplicitCheckpoint();
./swingui/panel/CreateSpecialPanel.java:188: SpecialOutfit.restoreImplicitCheckpoint();

Item Manager "create" panel - "create & use"

./textui/command/AcquireCommand.java:69: SpecialOutfit.createImplicitCheckpoint();
./textui/command/AcquireCommand.java:71: SpecialOutfit.restoreImplicitCheckpoint();

acquire command - just in case it had to go to the NPC store

./textui/command/BuyCommand.java:62: SpecialOutfit.createImplicitCheckpoint();
./textui/command/BuyCommand.java:64: SpecialOutfit.restoreImplicitCheckpoint();

buy command - just in case it had to go to the NPC store

./textui/command/CreateItemCommand.java:58: SpecialOutfit.createImplicitCheckpoint();
./textui/command/CreateItemCommand.java:60: SpecialOutfit.restoreImplicitCheckpoint();

create command - just in case it had to go to the NPC store

./textui/command/UseItemCommand.java:70: SpecialOutfit.createImplicitCheckpoint();
./textui/command/UseItemCommand.java:72: SpecialOutfit.restoreImplicitCheckpoint();

use command - just in case it had to go to the NPC store to buy or create
 

Bale

Minion
Is it being suboptimal or is it saving server hits?

It is doing both at the same time. Those are not mutually contradictory conditions.

You propose, essentially, that we save and restore an outfit checkpoint around each ingredient purchased that requires an outfit change.

Better idea: Checkpoint. Purchase all ingredients for everything queued. Restore checkpoint. Finally craft.

That way it is more optimal and server hits are conserved both.
 
Top