From c3d14dbdb0d93efefbc1d3b581beb50ce828d2c4 Mon Sep 17 00:00:00 2001 From: Xruptor Date: Wed, 26 Oct 2016 08:58:32 -0400 Subject: [PATCH] Updated Mail Grab System -Grabbing mail should now work properly regardless of whatever addon you have installed. -Added a helpful info text on previous email that caused an error. To help folks identify which mail item they need to look at. -Toc update for Legion 7.1 --- xanAutoMail.lua | 10 ++++++++-- xanAutoMail.toc | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/xanAutoMail.lua b/xanAutoMail.lua index dfcb8ac..bbde871 100644 --- a/xanAutoMail.lua +++ b/xanAutoMail.lua @@ -212,6 +212,7 @@ end local delayCount = {} local moneyCount = 0 local skipCount = 0 +local currMailName = "" local errorCheckCount = 0 local currentStatus = "STOP" @@ -345,7 +346,8 @@ function xanAutoMail:UI_ERROR_MESSAGE(event, num, msg) stopMailGrab = true elseif msg == ERR_ITEM_MAX_COUNT then DEFAULT_CHAT_FRAME:AddMessage("xanAutoMail: (ERROR) Cannot loot anymore unique items from Mailbox.") - DEFAULT_CHAT_FRAME:AddMessage("xanAutoMail: Please the delete item(s) from the Mailbox before trying again.") + DEFAULT_CHAT_FRAME:AddMessage("Please the delete item(s) from the Mailbox before trying again.") + DEFAULT_CHAT_FRAME:AddMessage("[SUBJECT:] "..tostring(currMailName)) stopMailGrab = true end @@ -402,9 +404,12 @@ function xanAutoMail:GrabNextMailItem() end skipCount = 0 --reset + currMailName = "" --reset for mIndex = nItem, 1, -1 do - local _, _, _, _, money, COD, _, numItems, wasRead, _, _, _, isGM = GetInboxHeaderInfo(mIndex) + local _, _, _, subject, money, COD, _, numItems, wasRead, _, _, _, isGM = GetInboxHeaderInfo(mIndex) + + currMailName = subject if money > 0 or (numItems and numItems > 0) and COD <= 0 and not isGM then if money > 0 then moneyCount = moneyCount + money end @@ -433,6 +438,7 @@ function xanAutoMail:StartMailGrab() currentStatus = "START" inboxAllButton:Disable() moneyCount = 0 + currMailName = "" skipCount = 0 errorCheckCount = 0 xanAutoMail:Delay("mailGrabNextItem", 0.2, xanAutoMail.GrabNextMailItem) diff --git a/xanAutoMail.toc b/xanAutoMail.toc index 4533f07..245363d 100644 --- a/xanAutoMail.toc +++ b/xanAutoMail.toc @@ -1,8 +1,8 @@ -## Interface: 60000 +## Interface: 70100 ## Title: xanAutoMail ## Notes: Expands blizzards automatic name generation for sending Mail to include people outside the guild. ## Author: Xruptor -## Version: 2.4 +## Version: 2.5 ## SavedVariables: xanAutoMailDB xanAutoMail.lua -- 1.7.9.5