Feature - Implemented Muffin Tin reminder for Valhalla

3BH

New member
I was thinking it would be a cool idea to have a reminder in ValhallaDecorator to remember to request your muffin so you get your tin in your next life. I tried making a patch here but I have run into some issues.

View attachment muffin.patch

My first issue was that upon requesting the muffin ItemPool.EARTHENWARE_MUFFIN_TIN didnt automatically decrement. I just added that to ItemPool, so maybe I was supposed to do something else in the choice adventure handler? I'm not sure how that is supposed to work, should that be a thing where you manually update the item pool upon requesting the muffin as part of the choice adventure? It works properly after a refresh inv.

Secondly, I don't know how to tell for a account that has multiple muffin tins whether they already have a muffin queued up at Lyle's yet, and therefore am unable to determine if the earthenware tin in their inventory could actually still be used for a muffin. I am a lot less concerned about that, I think, because then you could just ignore the reminder, but I also don't want people getting bug reports about it. I imagined that a preference could be stored, but I think that again probably falls in line with some handling of the choice adventure.

I wouldn't feel bad at all if someone wanted to implement this better, I just think that this definitely qualifies as being worth a reminder before jumping the gash.
 

Veracity

Developer
Staff member
It’s a worthy idea. Lyle is a pain to handle, since there is a long chain of choices you gave to take to do anything - and they are all the same choice with different options. I saved it, and have it on my list to make VMF handle muffins as your food of the day, rather than spaghetti breakfast. That would be well assisted by KoLmafia having a good set of properties to track state. As always, we want to behave correctly if you have done some actions that Kolmafia didn’t observe.

I support this feature. It’s not straightforward, unfortunately.
 

Veracity

Developer
Staff member
I should probably buy a second muffin tin just so I can see how it behaves when you try to order breakfast with a bun already in the oven, so to speak.
 
Lyle doesn't give you the choice option to order another, but I haven't tried to url-manipulate myself into trying to do so anyway.
As you noticed, it's all the same choice and the option numbers keep shifting, so it's quite possible url manipulating can't do it, since the choice option might not exist at all, rather than just being hidden.
I tried to get some automation going in my choiceAdventure script, but I gave it like 5 minutes, then realized it was all the same choice with shifting options/optionvalues, and put it on the pile of 'look at this again, later'.
 

Veracity

Developer
Staff member
Bumping to top since I will focusing on my own scripts - including adding muffin support to VMF - for the next several weeks, now that the Cargo Cultist Shorts are done.
I expect to add SOME sort of support to KoLmafia to track muffining, so we'll see what happens.
 

3BH

New member
I'm going to post my thoughts here about how a KoLMafia supported property and implementation could look like in the hope of learning something or another either through your implementation in VMF or through an actual KoLMafia patch.

The first thing I am thinking is that we would need a property to know the state of the muffin "quest" as it were. This can be done for the cost of no turns by simply visiting the downtown monorail station through choice option 7. Doing it would allow us to set the state of where the muffin request is.
We can then know if a muffin is:
-Already ordered (and for bonus points what type of muffin it is) through parsing the text looking for "Looks like your order for a <requested> muffin is not yet ready."
-Ordered on a previous ascension parsing for "Sorry, you placed your order a lifetime ago, so we had to throw out the actual baked good. Here's your earthenware cookware." Item pool should then hopefully update showing you have the cookware.
-Have a muffin tin but haven't ordered parsing for whether the choice options exist for ordering the three types of muffins. This actually solves for the having multiple earthenware muffin tins.

I think those are the three states worth tracking. I don't actually have time today to try and learn how the choice adventure parsing stuff actually works to submit a patch but am absolutely going to try to do so as a learning exercise. This also sort of makes sense to me to try and implement as a breakfast option, for both flavor and logical reasons.We just need to visit downtown monorail -> breakfast counter and I think it tells us everything we might need to know? I don't think there is a downside to checking the breakfast counter for a muffin, and it falls in line with other breakfast tasks I can think of. It would allow us to not fall over ourselves if someone did something outside of mafia as well.
 

Veracity

Developer
Staff member
I was thinking about this a lot before I came to my computer just now, since I was planning on putting support into VMF today. Yesterday I spaded the muffin consumption data, using session logs. Unsurprisingly, it is 150/150/150 modified by Experience modifiers per stat - sign, stat day, That’s Just Cloud Talk, etc.

I think the inputs you need are:

1) Do I have a muffin in inventory?
2) Do I have a muffin tin in inventory?
3) Do I have a muffin on order? (Optionally, what kind?)

#3 is a boolean modifier. That’s the only “state” you need a property for; your inventory is also “state”.

#3 is also the only state that might be unknown, due to having changed while KoLmafia wasn’t watching. But as you said, visiting the muffin counter will tell you the state - telling you about your pending order, or by delivering you a muffin.

Th daily routine is:

1) Acquire and eat a muffin, if possibly.
2) Make sure you have a muffin on order for tomorrow.

You cannot always achieve #1; if you have a muffin tin and no order in, you have to place an order and wait until tomorrow.
You cannot always achieve #2; if you have a muffin and no muffin tin but are too full to eat it, you cannot place an order.

This is suitable for a breakfast option. I will not use it, since VMF handles my consumption and actually runs breakfast at the end of the day. But I will need to use properties tracking the muffin on order.

I may add that and then start working on VMF, leaving breakfast for you. I will interested in seeing your logic. :)
 

Veracity

Developer
Staff member
Thinking a bit more, just one property can tell us what we need.

muffinOnOrder

none
blueberry muffin
bran muffin
chocolate chip muffin
 

Veracity

Developer
Staff member
Revision 20431 sets that property when you visit the breakfast counter (or when you are still there after ordering a muffin).
I tested ordering a muffin. It worked fine.

Only my main has not consumed or run turns yet today. I probably won't have time to finish muffin support in VMF today, but I'll start it and will have 5 characters to test with tomorrow; 3 have a muffin in inventory and two (will have) a muffin on order.
 

3BH

New member
To me, the most logical way to approach breakfast is using a similar tactic to what we currently do for boxing daycare. The reason I think this is because both are accomplished through a series of choice adventures. In boxing daycare we use GenericRequest to accomplish this as seen in the snippet below:

Code:
		if ( Preferences.getBoolean( "haveBoxingDaydream" + ( KoLCharacter.canInteract() ? "Softcore" : "Hardcore" ) ) )
		{
			RequestThread.postRequest( new GenericRequest( "place.php?whichplace=town_wrong&action=townwrong_boxingdaycare" ) );
			RequestThread.postRequest( new GenericRequest( "choice.php?whichchoice=1334&option=1" ) );
		}

I think I can do something similar, just going through the choice to get into and out of the downtown adventure and letting choice manager do the heavy lifting setting the muffinOnOrder. That property can then be referenced in the Valhalla manager as well. I will need to check this though.

Thanks Veracity!
 

Veracity

Developer
Staff member
You are welcome! Go wild.

I had one of my characters use a distention pill and eat a muffin and NOT order another.
I had another use a distention pill, eat a muffin, order a muffin - and set the muffinOnOrder property to "none"
I now have:

1 character with 1 muffin, no muffin tin, no muffin on order
1 character with no muffin, 1 muffin tin, no muffin on order
1 character with no muffin, no muffin tin, and (supposedly) no muffin on order, although there really is one
2 characters with no muffin, no muffin tin, a muffin on order (property set correctly)

These are all the expected cases for a character who owns one muffin tin.
I want my VMF muffin logic to support all of those, so this is good.

I also notice that ordering a muffin does not deduct your earthenware muffin tin from KoLmafia's inventory.
I'll fix that bug, by and by. Perhaps in ChoiceManager.postChoice1 when "Buy an XXX muffin" is in the PREVIOUS text and you submitted an option to buy a muffin.
 

Veracity

Developer
Staff member
I also notice that ordering a muffin does not deduct your earthenware muffin tin from KoLmafia's inventory.
I'll fix that bug, by and by. Perhaps in ChoiceManager.postChoice1 when "Buy an XXX muffin" is in the PREVIOUS text and you submitted an option to buy a muffin.
Revision 20432 does that.
 

Veracity

Developer
Staff member
Revision 20434 adds a pre-gash nag to suggest that you might wish to order a muffin, if you have an earthenware muffin tin in inventory and the muffinOnOrder property is "none".

I have also tested my VMF support for muffins and it worked well in all the situations I described earlier. I have not tested with "multiple muffin tin" cases, but I coded it with that in mind and expect it will work. I expect that use case to be vanishingly rare. I committed the code and will announce it on the VMF thread, by and by. After dinner.

I'm marking this "Finished", since it fulfils the original request. But if you eventually want to submit a patch for breakfast, I will look at it. Thinking about it, I think it probably needs a dropdown to configure which muffin to order, on the options page of breakfast. Have fun!
 

Veracity

Developer
Staff member
(Note that I did not include your "eat your muffin and request a new one" case, since I wrote and submitted my code before looking at your patch. :) It does make sense, since you will want to get the earthenware muffin tin back in your next life. I'll submit that too, by and by.)
 

Veracity

Developer
Staff member
Revision 20437 handles the fact that the choice options for buying a particular muffin are not constant.
VMF version 288 also handles that.
 

King Dave

New member
Apologies for the bump - I was wondering if you were still planning on adding this to breakfast? Even just a "visit the breakfast counter" option so that if I've ordered a muffin it collects it first thing, as I always keep forgetting!
 

fredg1

Member
You may not want to do that if you don't plan to eat the muffin and want to carry the tin over to the next ascension, though...
 
Top