There are now two Holy MacGuffins: the original, and Ed's. When we find one, the UseLink decorator uses the following pattern to detect it:
It then uses
to translate between the name and the item.
That fails, since there are two Holy MacGuffins, and it finds the second one - Ed's.
I saved the HTML. Unsurprisingly, the acquisition is wrapped in a table with a "rel" string:
We should use that to pick up the item id and count, much as we do when parsing results.
Use Links have the wrinkle that we want to detect bounty items - which I bet do not have rel strings.
Code:
private static final Pattern ACQUIRE_PATTERN =
Pattern.compile( "(You acquire|O hai, I made dis)([^<]*?)<b>(.*?)</b>(.*?)</td>", Pattern.DOTALL );
Code:
int itemId = ItemDatabase.getItemId( itemName, itemCount, false );
That fails, since there are two Holy MacGuffins, and it finds the second one - Ed's.
I saved the HTML. Unsurprisingly, the acquisition is wrapped in a table with a "rel" string:
Code:
<table class="item" style="float: none" rel="id=2334&s=0&q=1&d=0&g=0&t=0&n=1&m=0&p=0&u=."><tr><td><img src="http://images.kingdomofloathing.com/itemimages/macguffin.gif" alt="Holy MacGuffin" title="Holy MacGuffin" class=hand onClick='descitem(302128482)'></td><td valign=center class=effect>You acquire an item: <b>Holy MacGuffin</b></td></tr></table>
Use Links have the wrinkle that we want to detect bounty items - which I bet do not have rel strings.