Bug - Fixed Nuns tracking in Sneaky pete, with the seat upgrade

death star

New member
The meat dropping from the seat (that you definitely get, not the nuns) is counted for the quest completion.
I was told to post the html of the page, so here it is:
(i apologize for including too much stuff etc)


Code:
<html><head>
<script language="Javascript">
<!--
if (parent.frames.length == -1) location.href="game.php";
top.charpane.location.href="charpane.php";
//-->
</script>
<script language="Javascript" src="/images/scripts/keybinds.min.2.js"></script>
<script language="Javascript" src="/images/scripts/window.20111231.js"></script>
<script language="javascript">function chatFocus(){if(top.chatpane.document.chatform.graf) top.chatpane.document.chatform.graf.focus();}
if (typeof defaultBind != 'undefined') { defaultBind(47, 2, chatFocus); defaultBind(190, 2, chatFocus);defaultBind(191, 2, chatFocus); defaultBind(47, 8, chatFocus);defaultBind(190, 8, chatFocus); defaultBind(191, 8, chatFocus); }</script><script language="Javascript" src="/images/scripts/jquery-1.3.1.min.js"></script>
<script type="text/javascript">
jQuery(function ($) {
	$(document).ready(function() {
		throb_out();
	});
});
function throb_out() {
	jQuery(function ($) {
		$('.throbtext').fadeTo(Math.random()*400,.5);
	})
	setTimeout(throb_in,400+Math.random()*200);	
}
function throb_in() {
	jQuery(function ($) {
		$('.throbtext').fadeTo(Math.random()*400,Math.min(.95,Math.random()+.5));
		setTimeout(throb_out,400+Math.random()*200);	
		//setTimeout(throb_out,1200);	
	})
}
</script><script language="javascript" src="/images/scripts/core.js"></script><script>
var onturn = 10;
function newpic(pic, name, width, height)
{
   var h = height || 100;
   var w = width || 100;
   mpic = getObj('monpic');
   mnam = getObj('monname');
   mpic.src=pic;
   mpic.width=w;
   mpic.height=h;
   mnam.innerHTML=name;
}

var waking = false;

function killforms(sub) {
	sub.disabled = true;
	var is = document.getElementsByTagName("input");
	for (i=0; i < is.length; i++) {
		if (is[i].getAttribute('type') == 'submit') { is[i].disabled = true; }
	}

	if (waking) { clearTimeout(waking); }
	waking = setTimeout(function () {
		for (i=0; i < is.length; i++) {
			if (is[i].getAttribute('type') == 'submit') { is[i].disabled = false; }
		}
	}, 3000);

	sub.form.submit();

	return true;
}


</script>
<link rel="stylesheet" type="text/css" href="/images/styles.20130904.css">
<style type="text/css">
.faded {
	zoom: 1;
	filter: alpha(opacity=35);
	opacity: 0.35;
}
</style>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script><script src="/stationarybuttons.1.js"></script><link rel="stylesheet" type="text/css" href="/stationarybuttons.1.css"><script src="/hotkeys.js"></script><script language="Javascript" src="/basics.js"></script><link rel="stylesheet" href="/basics.1.css"></head>

<body onkeyup="handleCombatHotkey(event,false);" onkeydown="handleCombatHotkey(event,true);"><div id="page"><div id="mafiabuttons"><center><table width="95%"><tbody><tr><td align="left"><div id="btnwrap"><input onclick="document.location.href='adventure.php?snarfblat=126';void(0);" value="again" id="defaultButton" type="button"> </div></td><td align="right" valign="top"><select id="hotkeyViewer" onchange="updateCombatHotkey();"><option>- update hotkeys -</option><option>0: item spices</option><option>1: skill spring raindrop attack</option><option>2: attack with weapon</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></tbody></table></center></div><div style="top: 30px;" class="content" id="content_"><div id="effdiv" style="display: none;"></div><div>
<center><table cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td style="color: white;" align="center" bgcolor="blue"><b>Combat: Round 10!</b></td></tr><tr><td style="padding: 5px; border: 1px solid blue;"><center><table><tbody><tr><td><center><table><tbody><tr><td><img id="monpic" src="/images/adventureimages/bandit.gif" height="100" width="100"></td><td valign="center">You're fighting <span id="monname">a dirty thieving brigand</span><font color="gray" size="2"><br>HP: 315, Atk: 299, Def: 283, Type: dude<br>Drops: brigand brittle (0 cond)</font></td><td width="30"></td><td><table><tbody><tr><td width="30"><img src="/images/itemimages/nicesword.gif" alt="Enemy's Attack Power" title="Enemy's Attack Power" height="30" width="30"></td><td align="left" valign="center" width="50"><b><font size="+2">246</font></b></td><td><img src="/images/itemimages/happy.gif" alt="This monster is a Dude" title="This monster is a Dude"></td></tr><tr><td width="30"><img src="/images/itemimages/whiteshield.gif" alt="Enemy's Defense" title="Enemy's Defense" height="30" width="30"></td><td align="left" valign="center" width="50"><b><font size="+2">233</font></b></td><td><img src="/images/itemimages/circle.gif" alt="This monster has no particular elemental alignment." title="This monster has no particular elemental alignment." height="30" width="30"></td></tr><tr><td width="30"><img src="/images/itemimages/hp.gif" alt="Enemy's Hit Points" title="Enemy's Hit Points" height="30" width="30"></td><td align="left" valign="center" width="50"><b><font size="+2">0</font></b></td><td><img src="/images/itemimages/watch.gif" alt="Initiative +50%" title="Initiative +50%"></td></tr></tbody></table></td><td width="50"></td><td valign="center"><img src="/images/otherimages/friarplants/plant1.gif" alt="Rabid Dogwood (+30 Monster Level)" title="Rabid Dogwood (+30 Monster Level)"></td><td valign="center"><img src="/images/otherimages/friarplants/plant4.gif" alt="Artichoker (Delevels enemies before combat)" title="Artichoker (Delevels enemies before combat)"></td><td valign="center"><img src="/images/otherimages/friarplants/plant5.gif" alt="Smoke-ra (Prevents enemies from attacking)" title="Smoke-ra (Prevents enemies from attacking)"></td></tr></tbody></table><br><script type="text/javascript">var monsterstats = {"hp":"0","def":"233","off":"246"};</script><p>You pull a straight razor out of the basket and slice him for 50 (<font color="red"><b>+11</b></font>) (<font color="green"><b>+40</b></font>) damage.<b><font color="blue"> BOINK! BARF! BONK! WHAM! BAM! BIFF! WHAMMO! WHAMMO!</font></b></p><p></p><center>You win the fight!<p></p><center>67,324 meat recovered, 32,676 left (4-6 turns).<br><!--WINWINWIN--><p></p><center><table><tbody><tr><td align="center" valign="center"><img src="/images/itemimages/meat.gif" height="30" width="30"></td><td valign="center">You gain 6682 Meat</td></tr></tbody></table></center><table><tbody><tr><td><img src="/images/otherimages/bigisland/nun.gif" height="100" width="60"></td><td>Sister Colliculi approaches you and takes the Meat.  "Thank you for recovering this Meat!" she says. "You've recovered more than half of what was stolen, Adventurer!  It won't be long now!"</td></tr></tbody></table><center><table class="item" style="float: none" rel="id=5833&s=5&q=0&d=1&g=0&t=1&n=1&m=1&p=0&u=u"><tbody><tr><td><img src="/images/itemimages/pepperbark.gif" alt="brigand brittle" title="brigand brittle" class="hand" onclick="descitem(364101514)"></td><td class="effect" valign="center">You acquire an item: <b>brigand brittle</b> <font size="1">[<a href="javascript:multiUse('multiuse.php',5833,9);void(0);"><span style="position: relative;" onmouseover="document.getElementById('whatif7').style.visibility='visible';" onmouseout="document.getElementById('whatif7').style.visibility='hidden';"><table id="whatif7" style="background-color: white; visibility: hidden; position: absolute; right: 0px; top: 1.2em;" border="2"><tbody><tr><td>Effect Duration</td><td>50.00 (-40.00)</td></tr><tr><td>Effect</td><td>Bandananit</td></tr></tbody></table>use multiple</span></a>]</font></td></tr></tbody></table></center><p>You search your cushions for extra Meat, then search the seat's cushions and actually find some.</p><center><table><tbody><tr><td><img src="/images/itemimages/meat.gif" alt="Meat" height="30" width="30"></td><td valign="center">You gain 26 Meat.</td></tr></tbody></table></center><p>You gain 23 Strongness.<br>You gain 25 Mysteriousness.<br>You gain 49 Sarcasm.<br><b>You gain a Moxie point!</b><br></p><p><a name="end"></a></p><p><a href="adventure.php?snarfblat=126">Adventure Again (The Themthar Hills)</a></p><p><a href="bigisland.php?place=nunnery">Go back to The Mysterious Island of Mystery</a></p></center><script>parent.charpane.location.href="charpane.php";</script><script language="javascript">
	function updateParseItem(iid, field, info) {
		var tbl = $('#ic'+iid);
		var data = parseItem(tbl);
		if (!data) return;
		data[field] = info;
		var out = [];
		for (i in data) {
			if (!data.hasOwnProperty(i)) continue;
			out.push(i+'='+data[i]);
		}
		tbl.attr('rel', out.join('&'));
	}
	function parseItem(tbl) {
		tbl = $(tbl);
		var rel = tbl.attr('rel');
		var data = {};
		if (!rel) return data;
		var parts = rel.split('&');
		for (i in parts) {
			if (!parts.hasOwnProperty(i)) continue;
			var kv = parts[i].split('=');
			tbl.data(kv[0], kv[1]);
			data[kv[0]] = kv[1];
		}
		return data;
	}
</script><script type="text/javascript" src="/images/scripts/pop_query.20130705.js"></script>
<script type="text/javascript" src="/images/scripts/ircm.20120523.js"></script>
<script type="text/javascript">
function pop_ircm_contents(i, some) {
	var contents = '',
		shown = 0,
		da = ' <a href="#" rel="?" class="small dojaxy">[some]</a> <a href="#" rel="',
		db = '" class="small dojaxy">[all]</a>',
		dc = '<div style="width:100%; padding-bottom: 3px;" rel="',
		dd = '<a href="#" rel="1" class="small dojaxy">[';
	one = 'one'; ss=some;
if (i.q==0) { shown++; 
contents += dc + 'inventory.php?action=closetpush&ajax=1&whichitem=IID&qty=NUM&pwd=12345" id="pircm_'+i.id+'"><b>Closet:</b> '+dd+one+']</a>';
if (ss) { contents += da + i.n + db;}
contents += '</div>';
}

	return [contents, shown];
}
var todo = [];
function nextAction() {
	var next_todo = todo.shift();
	if (next_todo) {
		eval(next_todo);
	}
}
function dojax(dourl, afterFunc, hoverCaller, failureFunc, method, params) {
	$.ajax({
		type: method || 'GET', url: dourl, cache: false,
		data: params || null,
		global: false,
		success: function (out) {
			nextAction();
			if (out.match(/no\|/)) {
				var parts = out.split(/\|/);
				if (failureFunc) failureFunc(parts[1]);
				else $('#ChatWindow').append('<font color="green">Oops!  Sorry, Dave, you appear to be ' + parts[1] + '.</font><br />' + "\n");
				return;
			}

			if (hoverCaller)  {
				float_results(hoverCaller, out);
				if (afterFunc) { afterFunc(out); }
				return;
			}
$(top.mainpane.document).find("#effdiv").remove(); if(!window.dontscroll || (window.dontscroll && dontscroll==0)) { window.scroll(0,0);}
			var $eff = $(top.mainpane.document).find('#effdiv');
			if ($eff.length == 0) {
				var d = top.mainpane.document.createElement('DIV');
				d.id = 'effdiv';
				var b = top.mainpane.document.body;
				if ($('#content_').length > 0) {
					b = $('#content_ div:first')[0];
				}
				b.insertBefore(d, b.firstChild);
				$eff = $(d);
			}
			$eff.find('a[name="effdivtop"]').remove().end()
				.prepend('<a name="effdivtop"></a><center>' + out + '</center>').css('display','block');
			if (!window.dontscroll || (window.dontscroll && dontscroll==0)) {
				top.mainpane.document.location = top.mainpane.document.location + "#effdivtop";
			}
			if (afterFunc) { afterFunc(out); }
		}
	});
}
</script></center></center></td></tr></tbody></table></center></td></tr><tr><td height="4"></td></tr></tbody></table><table><tbody><tr><td>[<a href="/account_combatmacros.php">edit macros</a>]</td></tr></tbody></table></center></div></div></div><script src="/onfocus.1.js"></script><script src="/combatfilter.1.js"></script></body></html>


i figure this log excerpt might help too

[330] The Themthar Hills
Encounter: dirty thieving brigand
Round 0: Kakaroth79 loses initiative!
Round 0: Kakaroth79 casts SNAP FINGERS!
Round 1: Kakaroth79 uses the Rain-Doh blue balls!
Round 2: Kakaroth79 uses the rock band flyers!
Round 3: Kakaroth79 casts THROW SHIELD!
Round 4: Kakaroth79 uses the Rain-Doh indigo cup!
Round 5: Kakaroth79 casts POP WHEELIE!
You gain 42 hit points
Round 6: Kakaroth79 attacks!
Round 7: Kakaroth79 attacks!
Round 8: unspecified macro action?
Round 8: Kakaroth79 attacks!
KoLmafia thinks it is round 9 but KoL thinks it is round 10
Round 9: Kakaroth79 wins the fight!
The nuns take 8,245 Meat; 60,587 recovered, 39,413 left to recover.
You acquire an item: brigand brittle
The nuns take 29 Meat; 60,616 recovered, 39,384 left to recover.
You gain 20 Beefiness
You gain a Muscle point!
You gain 16 Enchantedness
You gain 62 Roguishness

[331] The Themthar Hills
Encounter: dirty thieving brigand
Round 0: Kakaroth79 loses initiative!
Round 0: Kakaroth79 casts SNAP FINGERS!
Round 1: Kakaroth79 uses the Rain-Doh blue balls!
Round 2: Kakaroth79 uses the rock band flyers!
Round 3: Kakaroth79 casts THROW SHIELD!
Round 4: Kakaroth79 uses the Rain-Doh indigo cup!
Round 5: Kakaroth79 casts POP WHEELIE!
You gain 42 hit points
Round 6: Kakaroth79 attacks!
Round 7: Kakaroth79 attacks!
Round 8: unspecified macro action?
Round 8: Kakaroth79 attacks!
KoLmafia thinks it is round 9 but KoL thinks it is round 10
Round 9: Kakaroth79 wins the fight!
The nuns take 6,682 Meat; 67,298 recovered, 32,702 left to recover.
You acquire an item: brigand brittle
The nuns take 26 Meat; 67,324 recovered, 32,676 left to recover.
You gain 23 Strongness
You gain 25 Mysteriousness
You gain 49 Sarcasm
You gain a Moxie point!
 
Last edited:

Darzil

Developer
The way meat is currently processed, separating the tables and parsing them separately, means that we cannot easily distinguish the two meat gains. I can see two options, but am not sure which would be best :

1) After ResultProcessor.processMeat( str, status.won, status.nunnery ); in FightRequest add status.nunnery = false; This should mean I think that it'll only send the first meat gain after fight wins to the Nuns.
2) Don't pass to Nuns if value is 30 or below (and you have that Bike upgrade?)

Thoughts?
 

Veracity

Developer
Staff member
I don't see how you'll have the Bike upgrade in WotSF.

Looking at FightRequest.

Code:
		if ( image.equals( "meat.gif" ) )
		{
			// Adjust for Can Has Cyborger
			str = StringUtilities.singleStringReplace( str, "gets", "gain" );
			str = StringUtilities.singleStringReplace( str, "Meets", "Meat" );

			// Adjust for The Sea
			str = StringUtilities.singleStringReplace( str, "manage to grab", "gain" );

			// If we are in The Themthar Hills and we have
			// seen the "you won" comment, the nuns take
			// the meat.

			status.shouldRefresh |= ResultProcessor.processMeat( str, status.won, status.nunnery );
			return false;
		}
From the log in the original post we can extract the HTML tree for the fight. I expect we can figure out how to recognize the node with the motorcycle's extra Meat and process that with ResultProcessor.processMeat( str, false, false ) - even though it occurs at the end of the battle, we want "won" to be false, since it is not a monster drop, and we want nunnery to be false, since the nuns did not take it.
 

Veracity

Developer
Staff member
For reference, I saved the debug log in data/nunfight.html and did the following from the gCLI, not even logged in:

> test load nunfight.html

Read 11,633 bytes into a 11,633 character string

> debug on

> test fight
From the resulting DEBUG log:

PHP:
    <center>
      You win the fight!
      <p>
      <center>
        67,324 meat recovered, 32,676 left (4-6 turns).
        <br>
        <!--WINWINWIN-->
        <p>
        <center>
          <table>
            <tbody>
              <tr>
                <td align="center" valign="center">
                  <img src="/images/itemimages/meat.gif" height="30" width="30">
                <td valign="center">
                  You gain 6682 Meat
        <table>
          <tbody>
            <tr>
              <td>
                <img src="/images/otherimages/bigisland/nun.gif" height="100" width="60">
              <td>
                Sister Colliculi approaches you and takes the Meat.  "Thank you for recovering this Meat!" she says. "You've recovered more than half of what was stolen, Adventurer!  It won't be long now!"
        <center>
          <table class="item" style="float: none" rel="id=5833&s=5&q=0&d=1&g=0&t=1&n=1&m=1&p=0&u=u">
            <tbody>
              <tr>
                <td>
                  <img src="/images/itemimages/pepperbark.gif" alt="brigand brittle" title="brigand brittle" class="hand" onclick="descitem(364101514)">
                <td class="effect" valign="center">
                  You acquire an item:
                  <b>
                    brigand brittle
                  <font size="1">
                    [
                    ]
        <p>
          You search your cushions for extra Meat, then search the seat's cushions and actually find some.
        <center>
          <table>
            <tbody>
              <tr>
                <td>
                  <img src="/images/itemimages/meat.gif" alt="Meat" height="30" width="30">
                <td valign="center">
                  You gain 26 Meat.
        <p>
          You gain 23 Strongness.
          <br>
          You gain 25 Mysteriousness.
          <br>
          You gain 49 Sarcasm.
          <br>
          <b>
            You gain a Moxie point!
          <br>
I am sure we can recognize the node with the seat cushion Meat and process it more appropriately.
 

Darzil

Developer
Looking at that the simplest is probably to set status.nunnery to false when we read the cushion message.
 

Darzil

Developer
r13898 does that. Unverified, I don't think I'll break Nuns meat reporting, though I'll be very unpopular if I do!
 

Veracity

Developer
Staff member
Well... I direct your attention to ResultProcessor.processMeat( text, won, nunnery):

Code:
	public static boolean processMeat( String text, boolean won, boolean nunnery )
	{
		AdventureResult result = ResultProcessor.parseResult( text );
		if ( result == null )
		{
			return true;
		}

		if ( won && nunnery )
		{
			IslandManager.addNunneryMeat( result );
			return false;
		}

		if ( won && Preferences.getBoolean( "meatDropSpading" ) )
		{
			int drop = result.getCount();
			if ( !ResultProcessor.possibleMeatDrop( drop, 0 ) )
			{
				...
			}
		}

		return ResultProcessor.processMeat( text, result, null );
	}
I don't know if anybody uses meatDropSpading, but we will treat seat cushion Meat as a monster drop, since "won" is true. That's actually not a nunnery-specific thing. I think your change will fix treating it as Meat given to the nuns, though, which is a good thing.
 

death star

New member
As far as i can tell the fix didn't produce changes, mafia is still counting the seat's meat towards quest completion.

That was with build r13907, so post bug fix.
 

Darzil

Developer
Can confirm this isn't fixed, unfortunately didn't have time this ascension to work out why and address. Hopefully next time.
 

Theraze

Active member
I don't know if anybody uses meatDropSpading,

I've had it on for the last several years since I ran across that in the code. It randomly pops up information, usually related to ant tools or other such unexpected meat bounties.
 

Veracity

Developer
Staff member
Heh. I'd already worked out - and tested, adding 2 turns to my run - a solution myself and discovered that there was a conflict when I tried to commit it.

I like mine better. Rather than checking if we are in Sneaky Pete and looking for words from the seat cushion message, if we see nuns.gif, that is a nun announcing that she's taken the Meat. When we see that, turn off status.nunnery (so subsequent Meat gains from any source are not given to the nuns) and status.won (so that subsequent Meat gains are not erroneously applied to the monster, if you have meatDropSpading).

I did not apply the same fix if you have Haiku or Anapests active. In you have one of those effects and are doing the nunnery sidequest in a Sneaky Pete run, sucks to be you.

Revision 13922.
 

Bale

Minion
That's nice. A general solution is usually better than the specific.

Uneffecting Anapests is always in my mood. Just in case. So that won't trouble me.
 

lostcalpolydude

Developer
Staff member
I completely forgot about meatDropSpading. It looks like status.won still needs to be unset outside of the nuns quest then? Perhaps after processMeat() in the meat.gif check... between the hobo monkey and Buddy Bjorn, that probably doesn't work either.
 

Veracity

Developer
Staff member
status.won gets set when we parse the WINWINWIN comment. Any Meat found in the last round of the fight before that - Hobo Monkey, etc - will have that flag not set, and will therefore not count as a monster's Meat drop.

Any Meat that happens AFTER that comment is seen is deemed to be a monster drop. So, yeah, the Seat Meat would be counted as such. Perhaps we should unset status.nunnery when we see the nun.gif image - as I did - and unset status.won when we see meat.gif, more or less as you propose. That will do the meatDropSpading thing only for the first meat.gif seen after the win message. That seems likely to be the monster's Meat drop.
 

Veracity

Developer
Staff member
OK, revision 13924 decouples things like that:

- when we see nun.gif, cear status.nunnery, since no subsequent Meat drop is taken by the nuns
- when we see meat.gif, after processing the Meat, clear status.won, since no subsequent Meat drop is from a monster

I did this for Haiku and Anapests, too, so meatDropSpading should work for all cases.
 

lostcalpolydude

Developer
Staff member
Strangely, status.won was never false before today (except when FightRequest was first initialized), and no one ever mentioned hobo monkey meat triggering a meatDropSpading message (or other random sources, like the bittycar meatcar). I don't know whether that means not many people are using that setting or that I don't understand how things are being parsed.
 

Veracity

Developer
Staff member
"status" is a TagStatus, which is created for each parsing of the fight results. The "won" field is is initialized to false when it is created.
 
Top