WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Logging the item my character acquired (https://www.wowinterface.com/forums/showthread.php?t=55406)

Kakjens 05-20-17 02:33 PM

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.

Eommus 05-23-17 01:31 AM

Quote:

Originally Posted by Kakjens (Post 323499)
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.


All times are GMT -6. The time now is 01:08 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI