Quantcast WoWInterface - View Single Post - Detect mail from ah
View Single Post
09-23-14, 02:19 PM   #19
Tntdruid
Premium Member
 
Tntdruid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 54
Originally Posted by Duugu View Post
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
This code works 100%, only problem if i send gold to an alt its gonna show up as AH and not in the MAIL section
  Reply With Quote