So I am about to add item purchasing and did a simple implementation:

Code:
-- [...]
-- some code deciding I should buy the next item on the list

		local result = Bot:ActionImmediate_PurchaseItem(itemName);
		local bPurchased = (result == ItemPurchaseResults.PURCHASE_ITEM_SUCCESS);

		if (bPurchased == true) then
			table.remove(ItemList, 1);
		else
			DebugLog("couldn't purchase " .. itemName .. ": " .. result);
		end
Howver, result has a strange value after returning from ActionImmediate_PurchaseItem:
couldn't purchase item_clarity: 0
What is result 0?

As far as I know, these are the enum values:
Code:
ItemPurchaseResults =
{
	PURCHASE_ITEM_SUCCESS				= -1,
	PURCHASE_ITEM_OUT_OF_STOCK			= 82,
	PURCHASE_ITEM_DISALLOWED_ITEM		= 78,
	PURCHASE_ITEM_INSUFFICIENT_GOLD		= 63,
	PURCHASE_ITEM_NOT_AT_HOME_SHOP		= 67,
	PURCHASE_ITEM_NOT_AT_SIDE_SHOP		= 66,
	PURCHASE_ITEM_NOT_AT_SECRET_SHOP	= 62,
	PURCHASE_ITEM_INVALID_ITEM_NAME		= 33
}
Are there any other possible values Chris?