WoW:API GetInboxItem: Difference between revisions
Jump to navigation
Jump to search
(GetInboxItem(index) - Gets a text description of the item attached to inbox message at [index]) |
mNo edit summary |
||
| Line 27: | Line 27: | ||
end | end | ||
</code></pre> | </code></pre> | ||
[[Category:API Functions|GetInboxItem]] | |||
[[Category:API Mail Functions|GetInboxItem]] | |||
Revision as of 18:57, 29 August 2005
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>