View Single Post
08/06/19, 07:52 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
About adding attachments to the emails, maybe check my addon DoItAll in the folder src/AttachAll.
Mailer.lua is the mail stuff and attach.lua the attachments.
It recursively attaches items from the current filtered/shown inventory list (all inventory rows shown on the right side of the mail sent panel, having applied filters from search by text, other addons like FCOItemSaver, AdvancedFilters + plugins,...) until the mail is full, sends it then (if setting is enabled to do so) and redoes this until no items to attach are left.
You probably need something which works the same for your task then, except you won't send all items in the inventory list "filtered/shown currently" but only saved bagIds and slotIindices (except Craftbag bagId I guess if you use it, as it's account wide).

I hope it helps.
I think email sending "with attachments" is only available if you have opened the email scene if I remember correctly. But maybe It does work without opening the scene as well, but don't think so.
I think emails can be send with plain text only if you do not open the mail scene before (some collection addons like Lorebooks did this, maybe check it's code as well).

Oh and about the 2nd step:
If I remember correctly there is some global function within Dolgubons Lazy Writ Crafter which returns true if the box looting is currently in process. I've used this in my event_inventory_single_slot_update callback at the WishList addon.

Edit: After checking this have a look at WishList addon, function "WL.Inv_Single_Slot_Update" in file WishLis.lua, and there in lines 130ff.
There is no global function but an itemLink's flavorText shows if the containers are looted currently. I'm checking this, starting a RegisterForUpdate task to check every x milliseconds again and if the results say "nothing looted anymore from a container" the loot has been finished.

Maybe Dolgubon could provide a global function for this within DLWC addon, which would be very cool. Ask him I'd say and tell him there is at least 1 other addon which would benefit from it (WishList) :-)

Last edited by Baertram : 08/06/19 at 08:03 AM.
  Reply With Quote