Quantcast
Logging the item my character acquired - Page 2 - WoWInterface
Thread Tools Display Modes
05-20-17, 02:33 PM   #21
Kakjens
A Cliff Giant
Join Date: Apr 2017
Posts: 75
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.
  Reply With Quote
05-23-17, 01:31 AM   #22
Eommus
A Fallenroot Satyr
Join Date: Apr 2017
Posts: 28
Originally Posted by Kakjens View Post
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.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Logging the item my character acquired

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off