May 25, 2020, 08:19:19 pm
Welcome, Guest. Please login or register.
147799 Posts in 17967 Topics- by 33402 Members - Latest Member: essaycola
Pages: [1] 2
  Print  
Author Topic: LootTracker  (Read 19121 times)
Tester
Jr. Member
*****
Posts: 122
View Profile
« on: December 23, 2016, 02:00:18 am »

Hello everyone,
since i have not found any loot tracker addon i made one myself. Feel free to share ideas, features and bugs you may encounter.

If enabled it tracks items + player who lootet it. You can enable / disable common / uncommon / rare / epic and legendary loot.


Like every other addon, if the server or client crashes the database is lost. For saving (eg. writing the database from wow memory to disk) you have to /reloadui or /logout or /exit.

Download Version 1.3.2 here: https://github.com/isitLoVe/LootTracker/releases/download/latest/LootTracker.zip


« Last Edit: August 06, 2018, 08:40:17 pm by Luise » Logged

Discord: isitLoVe#4989
Sr. Member
****
Posts: 632
View Profile Email
« Reply #1 on: December 23, 2016, 01:04:40 pm »

Really nice addon.
I got one suggestion about the addtodb function.

You could input the values like this in order to sort them easily later if you so wanted to by either name, item or date.

 Example
LootTrackerDB[looter] = { loot = timestamp }

And then use a sort function to print and sort as you wish.

Or similar, oh and make loot links hyperlinks so you can click them aswell ^^
« Last Edit: December 23, 2016, 01:37:57 pm by Atreyyo » Logged

Full Member
***
Posts: 369
<Chaos>
View Profile Email
« Reply #2 on: December 23, 2016, 01:41:59 pm »

Hey Luise ! Nice idea I'm going to give it a try and give feedback if any Smiley

Sorry if it sounds dumb but does ALT F4 works aswell to save the file ? I assume it's the most common way to exit the game ..
Also, does the previous file gets overwritten or does it just keeps writing on the same one ?

Cheers
Logged

Join the Chaos journey !

Hi Cohle - https://prnt.sc/js35ys
Full Member
***
Posts: 443
The Queen of <Unique>
View Profile
« Reply #3 on: December 23, 2016, 02:06:24 pm »

Sorry if it sounds dumb but does ALT F4 works aswell to save the file ? I assume it's the most common way to exit the game ..
For saving (eg. writing the database from wow memory to disk) you have to /reloadui or /logout or /exit.
I guess that alt+f4 should be fine as it just works in a faster way than common logout
Logged

Crafting center
Collection of hunters bug reports
"I still see entire server as one community" - Mimma 2015
Sr. Member
****
Posts: 632
View Profile Email
« Reply #4 on: December 24, 2016, 01:30:54 am »

Since I really liked the idea of this addon I went on and tried some stuff, I hope you don't mind.

I changed the way it saved the loot so now it saves loot as hyperlink.

Code:
--extract the loot
local loot = string.sub(arg1, string.find(arg1, "|cff", 1, true), string.find(arg1, "|h|r", 1, true)+1).."|r"

I changed the way the data was being saved in the database.

Code:
if LootTrackerDB == nil then
LootTrackerDB = { }
end
if LootTrackerDB[looter] == nil then
LootTrackerDB[looter] = { }
end
LootTrackerDB[looter][timestamp] = loot

With this way of storing the data, you can easily use a sort function to sort between the data, or just print it all like this.

Code:
function LootTracker_Database(arg)
DEFAULT_CHAT_FRAME:AddMessage("Dumping Database:")
if arg == "name" then
LootTrackerDB_sorted = LootTracker_SortDB("name")
for _, key in pairs(LootTrackerDB_sorted) do
for name,_ in pairs(LootTrackerDB) do
if key == name then
for tstamp, loot in pairs(LootTrackerDB[name]) do
DEFAULT_CHAT_FRAME:AddMessage(name.." --> "..loot.." "..tstamp)
end
end
end
end
elseif arg == "loot" then
LootTrackerDB_sorted = LootTracker_SortDB("loot")
for _, key in pairs(LootTrackerDB_sorted) do
for name,_ in pairs(LootTrackerDB) do
for tstamp, loot in pairs(LootTrackerDB[name]) do
if key == loot then
DEFAULT_CHAT_FRAME:AddMessage(loot.." --> "..name.." "..tstamp)
end
end
end
end
elseif arg == "date" then
LootTrackerDB_sorted = LootTracker_SortDB("date")
for _, key in ipairs(LootTrackerDB_sorted) do
for name,_ in pairs(LootTrackerDB) do
for tstamp, loot in pairs(LootTrackerDB[name]) do
if key == tstamp then
DEFAULT_CHAT_FRAME:AddMessage(tstamp.." "..name.." --> "..loot)
end
end
end
end
else
for name,_ in pairs(LootTrackerDB) do
for tstamp, loot in pairs(LootTrackerDB[name]) do
DEFAULT_CHAT_FRAME:AddMessage(name.." --> "..loot.." "..tstamp)
end
end
end
end

function LootTracker_SortDB(arg)
local sortedKeys = { }
if arg == "name" then
for k, _ in pairs(LootTrackerDB) do
table.insert(sortedKeys, k)
end
elseif arg == "loot" then
for k, _ in pairs(LootTrackerDB) do
for l, _ in pairs(LootTrackerDB[k]) do
table.insert(sortedKeys, LootTrackerDB[k][l])
end
end
elseif arg == "date" then
for k, _ in pairs(LootTrackerDB) do
for l, _ in pairs(LootTrackerDB[k]) do
table.insert(sortedKeys, l)
end
end
end
table.sort(sortedKeys, function(a,b) return a<b end)
return sortedKeys
end

Use LootTracker_Database("name") / LootTracker_Database("loot") / LootTracker_Database("date") to print a sorted list of the database or leave empty to just print it as it is.

Would be cool to have a nice gui with a scroll list to put the db in later  Grin
« Last Edit: December 24, 2016, 01:32:30 am by Atreyyo » Logged

Tester
Jr. Member
*****
Posts: 122
View Profile
« Reply #5 on: December 24, 2016, 01:29:25 pm »

Nice idea a gui would be nice but i slack know how yet. Do you have a github account, you can send me pull requests instead of forum posts.

My idea of the Loot DB would be something like this:

LootTrackerDB[raidid][looter][loot] or LootTrackerDB[raidid][looter][timestamp]

since VG does not have unique raid ids we could use Zone - Timestamp yy-mm-dd
« Last Edit: December 24, 2016, 01:33:26 pm by Luise » Logged

Discord: isitLoVe#4989
Tester
Full Member
*****
Posts: 283
View Profile
« Reply #6 on: December 24, 2016, 02:35:32 pm »

I have been dreaming of this!
Would be really nice if it could be saved or imported to excel or similar software so that you can add even more data like this:

Would it would be possible to integrate this into the DKP addon that some guilds use to make it record dkp automatically?
Logged
Sr. Member
****
Posts: 632
View Profile Email
« Reply #7 on: December 24, 2016, 03:25:43 pm »

Sorry I don't have github yet, might have to get one though, seems neat.
I also noticed it was not adding items "won" to the database but only "receive" items.
Made a fix for that if you want it, oh and also added classcolors to the names stored in the db, aswell as a search function.

Edit:

Sorry if I kinda hijacked your addon but iike I said earlier, I really liked the idea of this addon you made and I just could not leave it alone ^^


« Last Edit: December 24, 2016, 04:35:35 pm by Atreyyo » Logged

Tester
Jr. Member
*****
Posts: 122
View Profile
« Reply #8 on: December 25, 2016, 01:36:14 pm »

current state of my db:
LootTrackerDB = {
   ["16-12-25 Durotar"] = {
      ["Tranq"] = {
         ["117"] = "Tough Jerky",
      },
      ["Corrheal"] = {
         ["769"] = "Chunk of Boar Meat",
         ["818"] = "Tigerseye",
      },
   },
}

      LootTrackerDB[raidid][playername][itemid] =   itemname

   timestamp = date("%y-%m-%d")
   zonename = GetRealZoneText();
   raidid = timestamp .. " " .. zonename

can you make a sort function for this?

Logged

Discord: isitLoVe#4989
Sr. Member
****
Posts: 632
View Profile Email
« Reply #9 on: December 25, 2016, 02:27:54 pm »

current state of my db:
LootTrackerDB = {
   ["16-12-25 Durotar"] = {
      ["Tranq"] = {
         ["117"] = "Tough Jerky",
      },
      ["Corrheal"] = {
         ["769"] = "Chunk of Boar Meat",
         ["818"] = "Tigerseye",
      },
   },
}

      LootTrackerDB[raidid][playername][itemid] =   itemname

   timestamp = date("%y-%m-%d")
   zonename = GetRealZoneText();
   raidid = timestamp .. " " .. zonename

can you make a sort function for this?



Sure, but won't there be an issue when you loot the same item and it gets replaced in the db instead of added?

Let's say you want to track all them Bijous that drops in Zul'Gurub, if you do it like this, you will just get one entry per itemid won't you?

Perhaps the best solution would be to store the data like this.

Code:
LootTrackerDB = {
 [1] = {
     [name] = "RandomvgGuy",
     [item] = "Band of Accuria",
     [rarity] = "epic",
     [timestamp] = "16-12-25 17:55:56",
     [zone] = "Molten Core"
 }
 [2] = {
     [name] = "AnothervgRandom",
     [item] = "Eye of Ragnaros",
     [rarity] = "legendary",
     [timestamp] = "16-12-25 17:56:31",
     [zone] = "Molten Core"
 }
}

This way you can store whatever data you want and easily collect any specific data you might need.
« Last Edit: December 25, 2016, 02:48:36 pm by Atreyyo » Logged

Tester
Jr. Member
*****
Posts: 122
View Profile
« Reply #10 on: December 25, 2016, 05:20:24 pm »

ah you are right that would be a problem, i only thought of epics in normal raids.
Logged

Discord: isitLoVe#4989
Tester
Jr. Member
*****
Posts: 122
View Profile
« Reply #11 on: December 30, 2016, 03:58:05 am »

quick update to the gui:

Logged

Discord: isitLoVe#4989
Tester
Jr. Member
*****
Posts: 122
View Profile
« Reply #12 on: January 15, 2017, 12:59:20 am »

Releasing v1 soon:

check out the readme at https://github.com/isitLoVe/LootTracker

« Last Edit: January 15, 2017, 01:33:00 am by Luise » Logged

Discord: isitLoVe#4989
Sr. Member
****
Posts: 632
View Profile Email
« Reply #13 on: January 15, 2017, 01:07:58 am »

Looks awesome, well done man!
Logged

Sr. Member
****
Posts: 500
Goldshire Cheese and Fetish Club
View Profile
« Reply #14 on: January 15, 2017, 03:21:42 am »

I do recall CTRaidTracker having a similar but it was unreliable at best! This looks far superior!
Logged

Pages: [1] 2
  Print  
 
Jump to: