Quantcast WoWInterface - View Single Post - Detect mail from ah
View Single Post
09-23-14, 07:22 AM   #7
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Hm. Wowprogramming says
numItems, totalItems = GetInboxNumItems()
Returns:
•numItems - Number of mails in the player's inbox (number)
•totalItems - Total number of items both in the inbox and on the server. (number)
I'm not sure what the difference is as I never did something with the mail api.
Totally guessing: the first one is the number of mails the player had opened at least once, and the second one is the number of opened and unopened mails?

You could try:

Lua Code:
  1. local function Accountant_DetectAhMail()
  2.     local numItems, totalItems = GetInboxNumItems()
  3.     for x = 1, totalItems do   
  4.         local invoiceType = GetInboxInvoiceInfo(x)
  5.         print(x, invoiceType)
  6.         if string.find(string.lower(invoiceType), "seller") then
  7.             return true
  8.         end
  9.     end
  10. end

Does this change anything?
  Reply With Quote