New Content - Implemented Madness Bakery

Bale

Minion
Adding new location: Madness Bakery - adventure.php?snarfblat=440
Ah, Madness Bakery! I have a number of species that thrive in outdoor environments!

I'm not even slightly surprised that we got a new zone the day immediately after Veracity spun a new release.
 

lostcalpolydude

Developer
Staff member
I added a bunch of stuff in 15976. The choice adventure still needs handling, there's a shop that's gated by finishing the quest, there's actual quest progress to track, there's still monster drops to add, and I'm probably forgetting something else.
 

heeheehee

Developer
Staff member
[2925] Madness Bakery
Encounter: Heart of Madness
Learned recipe: Adventure Again: (-1)
Hm.

HTML:
<div id="results"><!--faaaaaaart--><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Results:</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><span class='guts'>You flip through the cookbooks until you find an interesting recipe.<p>It says here that if you cook <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/spraycan.gif' onclick='descitem(204936339)' alt="magicalness-in-a-can" title="magicalness-in-a-can"></td><td valign=center><b>magicalness-in-a-can</b></td></tr></table> with <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/dough.gif' onclick='descitem(288162100)' alt="wad of dough" title="wad of dough"></td><td valign=center><b>wad of dough</b></td></tr></table> that you'll get <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/baguette.gif' onclick='descitem(218899360)' alt="magical baguette" title="magical baguette"></td><td valign=center><b>magical baguette</b></td></tr></table>Huh.  You'll have to try that one sometime.<p>Congratulations!  You just <a href="craft.php?mode=discoveries&what=cook">discovered</a> a new recipe!</p></span></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></div>
 

Bale

Minion
choiceAdventure1082 should have a default value of 1. Because that is the only option.
choiceAdventure1083 should have a default value of 1. For the same reason.
 

Theraze

Active member
I've noticed with the relearning jewelry that new recipe logging is apparently off. I haven't managed to grab a debug log showing it though, so thanks for the html hee^3.

I think I have one character still without their bezoar ring yet. If the devs want a debug log for that, let me know and I'll make the proper bug report.
 

Veracity

Developer
Staff member
Revision 15983 attempts to match recipes learned in the Madness Bakery format - the ingredient are listed, then the result, then the "You learned a new recipe" message. Madness Bakery has an additional message in between the item and the "You learn" message, which is probably not there for recipes you learn via other means. And, I had already learned 3 recipes before I coded this, and another 150 turns in Madness Bakery did not net me another, so it's not really tested.

I'd like to see the debug log for the bezoar ring, please. How are you going to learn it? Untinker the ring, or simply try to craft it? I can easily imagine that the messages are different for those methods. Whichever, I'd like a debug log. Thanks.
 

Theraze

Active member
> debug on

> untinker bezoar ring

Untinkering bezoar ring...
untinker * bezoar ring
You acquire an item: extra-fancy ring setting
You acquire an item: flytrap bezoar
Learned recipe: Results: (-1)
Successfully untinkered bezoar ring

> create bezoar ring

Verifying ingredients for bezoar ring (1)...
Creating bezoar ring (1)...
You acquire an item: bezoar ring
Successfully created bezoar ring (1)

> debug off
 

Attachments

  • DEBUG_20150625.txt
    28.1 KB · Views: 31

lostcalpolydude

Developer
Staff member
Parsing all of those messages is going to result in a lot of extra unknownRecipeXXXX settings being created. That won't hurt anything, just something that occurred to me.
 

Ezandora

Member
Revision 15983 attempts to match recipes learned in the Madness Bakery format - the ingredient are listed, then the result, then the "You learned a new recipe" message. Madness Bakery has an additional message in between the item and the "You learn" message, which is probably not there for recipes you learn via other means. And, I had already learned 3 recipes before I coded this, and another 150 turns in Madness Bakery did not net me another, so it's not really tested.

I think this change may have an infinite loop bug related to it.

Tested in r15987 on Ubuntu and OS X.

To reproduce: click "older trivial updates" in the right pane of the relay browser. Alternatively, load "http://127.0.0.1:60080/static.php?id=trivial" in the browser.

After which, the page does not finish loading, and kolmafia is reported as using up 100% CPU in a process viewer:

View attachment 8617

Loading it multiple times increases CPU load, once per load attempt:

View attachment 8618

View attachment 8619


In ResponseTextPasers.java:
Code:
	private static final Pattern [] RECIPE_PATTERNS =
	{
		Pattern.compile( "You learn to .*?craft.*? a new item:.*?<b>(.*?)</b>" ),
		Pattern.compile( "<b>(.*?)</b>.*?You'll have to try that one sometime.*?You (?:have|just) .*?discovered.*? a new recipe" ),
		Pattern.compile( "You (?:have|just) .*?discovered.*? a new recipe.*?<b>(.*?)</b>" )
	};

If I comment out the new (second) pattern from r15983, the bug disappears:
Code:
	private static final Pattern [] RECIPE_PATTERNS =
	{
		Pattern.compile( "You learn to .*?craft.*? a new item:.*?<b>(.*?)</b>" ),
		//Pattern.compile( "<b>(.*?)</b>.*?You'll have to try that one sometime.*?You (?:have|just) .*?discovered.*? a new recipe" ),
		Pattern.compile( "You (?:have|just) .*?discovered.*? a new recipe.*?<b>(.*?)</b>" )
	};

Probably something about the pattern causing the regex matcher to loop?
 

Veracity

Developer
Staff member
Revision 15991 removes the bad pattern. And revision 15992 removes the logging if recipe discovery pattern matches but the item name is unknown - as in "Adventure Again".

(For real recipes, the item name should never be unknown, since we should have registered unknown items before checking for the discovery.)
 

Veracity

Developer
Staff member
I added a bunch of stuff in 15976. The choice adventure still needs handling, there's a shop that's gated by finishing the quest, there's actual quest progress to track, there's still monster drops to add, and I'm probably forgetting something else.
 

Darzil

Developer
Recipe tracking just didn't work for me:
[212394] Madness Bakery
Encounter: Heart of Madness

Code:
<body onkeyup="handleCombatHotkey(event,false);" onkeydown="handleCombatHotkey(event,true);" ><div id="page"><div id="mafiabuttons"><center><table width="95%"><tr><td align=left><div id="btnwrap"><input type="button" onClick="document.location.href='craft.php?mode=discoveries&what=cook';void(0);" value="again" id="defaultButton"> </div></td><td align=right valign=top><select id="hotkeyViewer" onchange="updateCombatHotkey();"><option>- update hotkeys -</option><option>0: </option><option>1: </option><option>2: </option><option>3: </option><option>4: </option><option>5: </option><option>6: </option><option>7: </option><option>8: </option><option>9: </option></select></td></tr></table></center></div><div class='content' id='content_'><div id='effdiv' style='display: none;'></div><div>
<Center><div id="results"><!--faaaaaaart--><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Results:</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><span class='guts'>You flip through the cookbooks until you find an interesting recipe.<p>It says here that if you cook <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/dough.gif' onclick='descitem(288162100)' alt="wad of dough" title="wad of dough"></td><td valign=center><b>wad of dough</b></td></tr></table> with <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/sodawater.gif' onclick='descitem(64228878)' alt="soda water" title="soda water"></td><td valign=center><b>soda water</b></td></tr></table> that you'll get <table><tr><td><img style='vertical-align: middle' class=hand src='/images/itemimages/sodabread.gif' onclick='descitem(995601519)' alt="loaf of soda bread" title="loaf of soda bread"></td><td valign=center><b>loaf of soda bread</b></td></tr></table>Huh.  You'll have to try that one sometime.<p>Congratulations!  You just <a href="craft.php?mode=discoveries&what=cook">discovered</a> a new recipe!</p></span></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></div><table  width=95%  cellspacing=0 cellpadding=0><tr><td style="color: white;" align=center bgcolor=blue><b>Adventure Again:</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tr><td><center><p><a href="adventure.php?snarfblat=440">Adventure Again (Madness Bakery)</a><p><a href="place.php?whichplace=town_right">Go back to The Right Side of the Tracks</a></center></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center><!--faaaaaaart--><script>top.charpane.location.href="charpane.php";</script>
</div></div></div></body>

Edit - because that was removed, of course! Looking at an alternative.
 
Last edited:

Darzil

Developer
I hate regex.

Trying to work out one that'll match the last thing in bold before "</b></td></tr></table>Huh. You'll have to try that one sometime." At the moment it matches everything from the first <b> to the end. Veracity's one matches the first bold thing in the response. I'm sure there should be a way to find the shortest match, but nothing I try is working so far.
 

lostcalpolydude

Developer
Staff member
I don't see any reason to worry about matching this, since I'm pretty sure you don't need to learn the recipe there to craft these things.
 
Since the thread hasn't been closed yet, I'll put this kol change here: Madness Bakery is now an indoor location
The Florist Friar said:
Ah, Madness Bakery! Nothing brightens up an indoor space like some plants, I always say.
 
Top