Quantcast WoWInterface - View Single Post - Detect mail from ah
View Single Post
09-23-14, 10:51 AM   #17
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
Well, then let's talk about what you're trying to accomplish.

Are you looking for something like this?

Lua Code:
  1. ...
  2. elseif event == "MAIL_INBOX_UPDATE" then
  3.     if Accountant_DetectAhMail() then
  4.         Accountant_Mode = "AH"
  5.     end
  6. ...

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