View Single Post
01/10/24, 02:35 PM   #3
Solution_Lop
AddOn Author - Click to view addons
Join Date: Jan 2024
Posts: 5
Originally Posted by Dolgubon View Post
Unfortunately, this is a question with a very annoying answer. Which is 'no, but kind of yes, and also the yes is a pain in the ass'
Eso has a 'new item' event, but it does not differentiate between a new item from say a chest or from a writ container.It doesn't even tell you that it was from a chest.
Then there's the actual containers. Well, there's no way to determine if a container is a writ container programmatically, you need to just say 'oh yeah the name is the same as a writ container.' Which is a pain for localization. And needing a string comparison is annoying. The string comparison is made even more annoying because it uses Roman numerals to signify the level of the reward. So you need to deal with that Roman numeral, unless you just don't care. Then, did you already open the container and just didn't loot it (or were unable to loot it because your inventory was full?)
Well screw you there's no indication of that. Which means you can't just save the contents when you view them, that would be too easy.
So you need to setup a system where you have a buffer table. And in that table you save items you see in a viewed container. And then when the new item event fires you need to check the buffer table first.
But oh wait because there's no indication of where that new item came from, it could come from crafting, from a mail, from another writes reward box, space, who knows. So you've don't aaaaaaall this work and in the end you're only pretty sure it was looted from a writ container.




Yeah. Not. A. Fan.


Iirc, the code relating to this is in LootHandler.lua in writ crafter. There's definitely holes and bugs in it, every so often I get mails of miscounting in the writ crafter Stats.
Thank you very much for the answer, I also ran into this problem.. I searched through almost all the APIs in order to somehow catch the very event at which the item is obtained. I spent a lot of time and most likely I will have to tinker with the tables
  Reply With Quote