I looked at that and wondered how it knew that had to get make an NPC purchase from the fireworks shop.doRetrieveItem has...
Java:if (shouldUseNPCStore || scriptSaysBuy) { if (sim) { return shouldUseNPCStore ? "buy from NPC" : "buy"; } // If buying from the mall will leave the item in storage, use only NPCs AdventureResult instance = item.getInstance(missingCount); boolean onlyNPC = forceNoMall || !InventoryManager.canUseMall(); List<PurchaseRequest> results = onlyNPC ? MallPriceManager.searchNPCs(item) : MallPriceManager.searchMall(instance); KoLmafia.makePurchases( results, results.toArray(new PurchaseRequest[0]), InventoryManager.getPurchaseCount(itemId, missingCount), isAutomated, 0);
I'm not sure whether `instanceof NPCPurchaseRequest` is adequate, especially for items that you've already purchased up to the limit.
public static boolean canUseMall(final int itemId) {
return ItemDatabase.isTradeable(itemId) && InventoryManager.canUseMall();
}
> acquire fedora-mounted fountain
Purchasing fedora-mounted fountain (1 @ 475)...
You spent 475 Meat
You acquire an item: fedora-mounted fountain
Purchases complete.
visitUrl("clan_viplounge.php?action=fwshop&whichfloor=2");
buy(1, Item.get("sombrero-mounted sparkler"));
But no successful purchase actually occurs.Visiting Underground Fireworks Shop in clan VIP lounge
/shop.php?whichshop=fwshop
> set _fireworksShop=false
_fireworksShop => false
> set _fireworksShopEquipmentBought=false
> set _fireworksShopHatBought=false
_fireworksShopHatBought => false
> ashq visit_url("clan_viplounge.php?action=fwshop&whichfloor=2")
Visiting Underground Fireworks Shop in clan VIP lounge
> get _fireworksShop
true
> get _fireworksShopEquipmentBought
false
> get _fireworksShopHatBought
true
> ash buy($item[sombrero-mounted sparkler])
Searching for "sombrero-mounted sparkler"...
Search complete.
Returned: false
> ash buy($item[rocket boots])
Purchasing rocket boots (1 @ 950)...
You spent 950 Meat
You acquire an item: rocket boots
Purchases complete.
Returned: true
> ash buy($item[sombrero-mounted sparkler])
Searching for "sombrero-mounted sparkler"...
Search complete.
Returned: false
> ash buy($item[rocket boots])
Purchasing rocket boots (1 @ 950)...
You spent 950 Meat
You acquire an item: rocket boots
Purchases complete.
Returned: true