A recent bug report pointed out that taking multiple things out of the closet is in the form of "You acquire <b><x> <plural name></b>" and if we don't recognize the name, we can get confused. As it turns out, the full page is more informative:
The item is in an HTML table of class "item" with a "rel" string. There is a clickable image with a DESCID. And then there is the message, with the number of items removed and the name of the item - or the plural, if there are more than one.
Note that the "rel" string has the itemId ("id") and the number moved ("n"), as well as all sorts of other attributes about the item - including multi-usability.
We already have code to look up an item given a "rel" string - ItemDatabase.itemFromRelString(). And when we read your closet at login, we register unknown items that we find there (since you can use api.php?what=item to get info about items that are in "accessible" places - including your closet).
Seems to me that for transfers from the closet - or anywhere that includes a "rel" string - we should use the "id" and "n" fields to unambiguously identify it - and we could use the "m" field to check our understanding of multi-usability and the plural. In the ideal world, those things would be in api.php?what=item.
In any case, there is no reason to be confused by plurals and closet transfers.
Code:
<script type="text/javascript">if (window.updateInv) updateInv({"3440":3})</script><center><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>You take some things out of your closet.<center><table class="item" style="float: none" rel="id=3440&s=90&q=0&d=1&g=0&t=1&n=3&m=1&p=0&u=u"><tr><td><img src="http://images.kingdomofloathing.com/itemimages/prismwad.gif" alt="prismatic wad" title="prismatic wad" class=hand onClick='descitem(267408834)'></td><td valign=center class=effect>You acquire <b>3 prismatic wads</b></td></tr></table></center></td></tr></table></center></td></tr><tr><td height=4></td></tr></table></center>
Note that the "rel" string has the itemId ("id") and the number moved ("n"), as well as all sorts of other attributes about the item - including multi-usability.
We already have code to look up an item given a "rel" string - ItemDatabase.itemFromRelString(). And when we read your closet at login, we register unknown items that we find there (since you can use api.php?what=item to get info about items that are in "accessible" places - including your closet).
Seems to me that for transfers from the closet - or anywhere that includes a "rel" string - we should use the "id" and "n" fields to unambiguously identify it - and we could use the "m" field to check our understanding of multi-usability and the plural. In the ideal world, those things would be in api.php?what=item.
In any case, there is no reason to be confused by plurals and closet transfers.