Originally Posted by Kakjens
You might want to set a variable to your character name via UnitName("player") during login and checking it during event.
About string:match I am suspicious that it will record the item even if you didn't obtain it but simply rolled during greed/need/pass. So additional check might be needed.
You have slightly wrong idea about LootLog = {} . It prepares LootLog for the first recording. Actual saving is due to LootLog being in toc file.
Local function is supposedly faster, and has limited scope where it can be accessed/modified. In posts 1 and 6 you were already using them: keyword local before function.
In my scripts for event handling I usually use ellipsis(...) as the last argument, and assign it to local variable but how did you write should also work.
|
Thanks for the tip for getting the player name (instead of checking with a manually generated array), much better.
I tested and I can confirm that my addon does not store items in these cases:
- If I pass on an item, which writes in the chat:
[Loot]: You passed on: [Item Name]
- If I select Greed on an item, but don't win it:
[Loot]: You have selected Greed for: [Item Name]
- If another player rolls Need or Greed, or wins and receives the loot.
Player-Realm receives loot: [Item Name]
In short, it stores only items I win/receive after a roll in the group, which is exactly what it should do. This part of my addon is now complete. Thank you very much again.