WoW:API GetInboxItem

Revision as of 02:23, 27 March 2005 by WoWWiki>WoWWiki-Mosen (GetInboxItem(index) - Gets a text description of the item attached to inbox message at [index])
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GetInboxItem(index)

Where index is the index of the message you want to get the attached item information about. Index starts at 1, unlike an array subscript.

Returns a text description of the item.

Example Lua Script:

inbox_items = GetInboxNumItems();
	
if (inbox_items > 0) then
	for inbox_item_index = 1, inbox_items do
		-- Get the Message Text
            inbox_text = GetInboxText(inbox_item_index);
            -- Get the Attachment Description Text
		inbox_item = GetInboxItem(inbox_item_index); 
            if (inbox_text ~= nil) then
			DEFAULT_CHAT_FRAME:AddMessage("Inbox Text: "..GetInboxText(inbox_item_index), 1, 1, 1); -- Print the message text
		end
		
		if (inbox_item ~= nil) then
			DEFAULT_CHAT_FRAME:AddMessage("Inbox Item: "..GetInboxItem(inbox_item_index), 1, 1, 1); -- Print the attachment description
		end
	end
end
</code>