March 19, 2024, 11:33:57 am
Welcome, Guest. Please login or register.
149124 Posts in 18156 Topics- by 34712 Members - Latest Member: kmbortns01
Pages: 1 [2]
  Print  
Author Topic: LootTracker  (Read 32611 times)
Full Member
***
Posts: 341
View Profile
« Reply #15 on: March 14, 2018, 12:42:12 pm »

There's a fork with minor tweaks:
LootTracker Fork by Road-Block

-Item Edit frame closable by Esc
-Better compatibility with shootyepgp
-More Compact Browser window


Also:
The Export Format is rather badly parseable. Anyone eager to fix that? Luise? Should I fix and pull-request?
Logged

https://i.imgur.com/0k94nIv.jpg
^Hi Chess, legit THC earned with the EPGP loot distribution system. Not by half-assed DKP with lootcounciled KT loot ;-)

Rogue CL of <Chaos>
chaosvg.shivtr.com
Tester
Jr. Member
*****
Posts: 124
View Profile
« Reply #16 on: August 04, 2018, 08:55:01 am »

There's a fork with minor tweaks:
LootTracker Fork by Road-Block

-Item Edit frame closable by Esc
-Better compatibility with shootyepgp
-More Compact Browser window


Also:
The Export Format is rather badly parseable. Anyone eager to fix that? Luise? Should I fix and pull-request?

*yawns* what would be a good parsable output? csv? json? yaml?
Logged

Discord: isitLoVe#4989
Full Member
***
Posts: 341
View Profile
« Reply #17 on: August 04, 2018, 09:45:33 am »

Some random plain text is fine to me  Cheesy

Quote
18-07-22 19:46:48 - Pauldrons of Elemental Fury: Oldshamy - 48

but my main concern is the use of field separators because it's unnecessarily hard to parse the 4 main fields: timestamp, item name, player, gp.
Everything except item name and player are separated by dashes, while again you find dashes in the date part of the timestamp.
E.g. parsing it requires multiple commands:

Quote
player = $(( cut -d'-' -f4 $line | cut -d':' -f2 ))
item = $(( cut -d'-' -f4 $line | cut -d':' -f2 ))

with a consistent field delimiter we could boil it down to:

Quote
player = $(( cut -d'-' -f5 $line ))
item = $(( cut -d'-' -f4 $line ))

OR

player = $(( awk '{ print $4 }' $line ))
player = $(( awk '{ print $5 }' $line ))

Quite noticeable when you parse alot of logs to create ratio graphs Smiley
Logged

https://i.imgur.com/0k94nIv.jpg
^Hi Chess, legit THC earned with the EPGP loot distribution system. Not by half-assed DKP with lootcounciled KT loot ;-)

Rogue CL of <Chaos>
chaosvg.shivtr.com
Tester
Jr. Member
*****
Posts: 124
View Profile
« Reply #18 on: August 06, 2018, 08:37:50 pm »

There you go: https://github.com/isitLoVe/LootTracker/releases/download/latest/LootTracker.zip

CTRL+Click the Export Button to get a csv output, should be easier to parse


« Last Edit: August 06, 2018, 08:39:25 pm by Luise » Logged

Discord: isitLoVe#4989
Full Member
***
Posts: 341
View Profile
« Reply #19 on: August 06, 2018, 09:24:31 pm »

Thank you very much and great function names! :-P
Logged

https://i.imgur.com/0k94nIv.jpg
^Hi Chess, legit THC earned with the EPGP loot distribution system. Not by half-assed DKP with lootcounciled KT loot ;-)

Rogue CL of <Chaos>
chaosvg.shivtr.com
Newbie
*
Posts: 27
View Profile Email
« Reply #20 on: June 08, 2019, 10:08:03 pm »

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:

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
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.
Xender Discord Omegle
« Last Edit: June 08, 2019, 10:13:12 pm by KENJY » Logged
Pages: 1 [2]
  Print  
 
Jump to: