Download
(223 Kb)
Download
Updated: 03/03/15 04:06 PM
Pictures
File Info
Compatibility:
Update 6 (1.6.5)
Updated:03/03/15 04:06 PM
Created:12/09/14 08:36 PM
Monthly downloads:60
Total downloads:17,314
Favorites:18
MD5:
Shopkeeper (Improved, Fixed and Updated)  Popular! (More than 5000 hits)
Version: 1.0 (dOpiate Fix).7b
by: dopiate, Garkin
I've found people are avoiding this addon thinking it's the OLDER version when in truth it's as current as can be. Plus, it is THE more stable option and if you read the forums you will see NO ERRORS OR ISSUES. So that's why I dropped the "Classic" name because ....


THIS IS SHOPKEEPER

While this addon will still exist it's development has halted.

I suggest you migrate to Master Merchant

That truly is the New Shopkeeper Continued!



New Version? Always check the Change Log

--------------------News-----------------------

The tool tip value.

After quite a bit of investigating I was able to determine that the PPU (“Price Per Unit”) shown in the tool tip is not wrong. In fact, I believe it’s the most accurate representation of the true PPU that I am aware of in the game!

How does it work?

What Khaibit did was implement a formula that took into account the time in which each sale took place. So, if there were two sales, one ten days ago and one yesterday, his formula gave more weight (“importance”) to the more recent sale. Therefore the PPU is generated by using the value of gold over time and its relevance is based on sale date.

In his code were these comments:

If all sales data covers less than a day, we'll just do a plain average, nothing to weight.

For a weighted average, the latest data gets a weighting of X, where X is the number of days the data covers, thus making newest data worth more.


My guess is that his formula is based on “The Time Value of Money” – which took me by surprise.
I don’t even remember him saying that he was doing that. It’s really an impressive way to look at generating a more accurate PPU. If you look in the forums you can see I first tried to generate his tool tip PPU using multiple basic methods and every time I could not match his number. When I looked at the code I realized why. If you read that post and then see his value v. all the equations I tried you will see his is MUCH more accurate than mine were. More realistic to NOW. The game is not static and so the PPU would not be either and he addressed that issues.

This puts to rest the idea that Shopkeeper 1.0 tool tips were wrong or broken. They were neither. They were more advanced then he let us know.

-d
12.10.2014 - I changed the errors into not errors
12.11.2014 - I found and fixed an error with the font replacement
------------- please note this error was not reported but found by me reviewing my changes
------------- I am at work and can not test this fix but it should be fine
12.12.2014 - A conflict was discovered between Shopkeeper and CraftCompare
------------- Garkin was kind enough to just PM the code fix so I didn't have to wait until after work before I could
------------- test/fix it. If you don't use CraftCompare then this isn't an essential update.
12.17.2014 - Two actual bugs were fixed. The tool tip not showing in inventory or bank was fixed.
------------- dragging items to sell or mail was also fixed (all credit to Garkin for that one)
12.18.2014 - Garkin found what spoqster had suspected. There was a stack size issue.
------------- This issue only happened for items with sales in a 24 hour window.
------------- That issue was fixed and the missing font code was updated.
12.21.2014 - Somehow (I used the wrong version to zip up I guess) the Shopkeeper and CraftCompare
------------- bug fix was GONE! 100% my screw up! I hang my head in shame.
------------- Garkin provided me the code the first time he pointed it out again today.
------------- it was fixed - unfixed - now re-fixed - sorry :-(
01.24.2015 - small fixes in the offline file report
02.06.2015 - fixed issue with regular items going BOA (bind on account) but still in your sales history.
03.03.2015 - Update 6 version
03.03.2015 - Updated to correct LibAddonMenu-2.0
Archived Files (9)
File Name
Version
Size
Uploader
Date
1.0 (dOpiate Fi
222kB
dopiate
03/03/15 12:59 PM
1.0 (dOpiate Fi
219kB
dopiate
02/06/15 02:12 PM
1.0 (dOpiate Fi
219kB
dopiate
01/24/15 01:48 PM
1.0 (dOpiate Fi
219kB
dopiate
12/21/14 01:10 PM
1.0 (dOpiate Fi
219kB
dopiate
12/18/14 10:40 AM
1.0 (dOpiate Fi
218kB
dopiate
12/17/14 08:46 AM
1.0 (dOpiate Fi
218kB
dopiate
12/12/14 09:21 AM
1.0 (dOpiate Fi
218kB
dopiate
12/10/14 09:13 AM
1.0 (dOpiate Fi
218kB
dopiate
12/09/14 08:36 PM


Post A Reply Comment Options
Unread 12/21/14, 12:35 AM  
FreakyFreak

Forum posts: 1
File comments: 41
Uploads: 0
Originally Posted by dopiate
Ok so you have set the slider to 10 days but you are seeing more than 10 days of data?

Did you just change the slider? Are you set to "AccountWide" ? if not you have to set it per char.

I'm making a total guess here since I haven't heard of this before but maybe it take the 30 days data to expire.

You can delete the Shopkeeper.lua file in SavedVariables and let it rebuild the 10 days.

I think the game limit (how far back you can request detail on old sales) is now 10 anyway - the only way you got 30 days was > 10 days was kept in the savedvariable up until 30 days.

Again, thats just a guess -- let me know what you find, give me a little more information if that was a but report (I'm not clear if it was) and I'll test tonight after work.

-d

ps just curious you said "I have my memory turned up." - turned up to what value?

Again, I am NOT experiencing any major issues as other people are reporting.
  • I have set my slider to 10 days of data. I am getting 11 days of info. It looks like that extra day is partial (current/rounding/whatever).
  • I am set for account wide.
  • I extended my LUA memory limit up to 256 per Khaibit's instructions here http://www.esoui.com/portal.php?id=134&a=faq&faqid=68
I am willing to use more days worth of data and/or adjust my LUA memory limit up/down if that kind of help is needed. Just ask. I'd be glad to help keep this valuable tool alive


As to issues;
My guess is some people are having conflicts with other addons or memory limit. I know the whole multiple-shopkeepers-not-all-being-supported-thing causes confusion with several people i talk to about it in my guild. Many of them report issues to me and say they will never use it "until it is updated" after i just sent them here the day of an update. Frustrating for us all.


I know there are other apps out there not being shared. Thanks for the work, Dopiate & Garkin. You guys rock!
Report comment to moderator  
Reply With Quote
Unread 12/19/14, 03:29 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
Re: Re: 2 rather big bugs fixed

Originally Posted by groovergabe
TY think my using old unsupported version might have locked and crashed me a couple times will make final transition now and wait for final fixes.
Omg I hope there are no more fixes

So many people using it now, Garkin and I have re-viewed and re-viewed the code so I'm hoping that we are finished.

If anything comes up it's going to be MINOR.

-d
Report comment to moderator  
Reply With Quote
Unread 12/19/14, 03:26 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
clarification

Originally Posted by FreakyFreak
Some input - I have not been experiencing any major issues. I am running my saved data setting at 10 days. I have my memory turned up. Those may have some affect.

(I have no desire for more than 10 days worth of data.)
Ok so you have set the slider to 10 days but you are seeing more than 10 days of data?

Did you just change the slider? Are you set to "AccountWide" ? if not you have to set it per char.

I'm making a total guess here since I haven't heard of this before but maybe it take the 30 days data to expire.

You can delete the Shopkeeper.lua file in SavedVariables and let it rebuild the 10 days.

I think the game limit (how far back you can request detail on old sales) is now 10 anyway - the only way you got 30 days was > 10 days was kept in the savedvariable up until 30 days.

Again, thats just a guess -- let me know what you find, give me a little more information if that was a but report (I'm not clear if it was) and I'll test tonight after work.

-d

ps just curious you said "I have my memory turned up." - turned up to what value?
Last edited by dopiate : 12/19/14 at 03:50 AM.
Report comment to moderator  
Reply With Quote
Unread 12/19/14, 12:49 AM  
FreakyFreak

Forum posts: 1
File comments: 41
Uploads: 0
Some input - I have not been experiencing any major issues. I am running my saved data setting at 10 days. I have my memory turned up. Those may have some affect.

(I have no desire for more than 10 days worth of data.)
Report comment to moderator  
Reply With Quote
Unread 12/18/14, 09:50 PM  
groovergabe

Forum posts: 0
File comments: 8
Uploads: 0
Re: 2 rather big bugs fixed

Originally Posted by dopiate
spoqster and groovergabe pointed out that while the tool tip mysetery had been solved there were still issues with it.

1- no tool tips at all in the bank or inventory
2- once #1 was fixed you could not drag any inventory into mail or guild store to sell

I was able to fix #1 which created #2 -- I was a bit stuck on #2 and Garkin graciously provided me the code I was missing.

So (as far as I know) Shopkeeper 1.0 is back to being error free.

As stated in my "mission statement" I will fix any and all bugs and keep the addon up to date but will not be adding features to it. Having said that, these tool tip fixes may have been intended to work but just using the original code this "feature" was commented out and even un-commented was not working. So this grays the line between fixing bugs and adding features. ... but I was very happy to help get working what you could obviously see he was trying to make work.

-d
TY think my using old unsupported version might have locked and crashed me a couple times will make final transition now and wait for final fixes.
Report comment to moderator  
Reply With Quote
Unread 12/18/14, 09:43 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
Another unexpected fix.

Originally Posted by spoqster

"I found one possible issue: It looks like there are inconsistencies in handling stacks.

I have confirmed the following:
- Voidstone Ore is listed at 20 in the tooltip. The value is derived from 9 stacks of 100 at 2000g each. So here the value listed is for one unit.
- Iron Ore is listed at 900 in the tooltip. The value is derived from one stack of 100 at 900g. So here the stack value is shown, not the unit value.
- Calcinium Ore is listed at 156g in the tooltip. The value is derived from two sales. One stack of 6 at 36g and another stack of 46 at 276. So here the addon does not take the stack size into account at all and only averages individual sales.
- Topgrain Hide Scraps: listed at 7.78 in the tooltip. Derived from three sales. Stack of 19 at 114g, stack of 22 at 132 gold, stack of 100 at 2000g. I don't know how you got the 7.78, but I think the average should be weighted by the number of units sold for a given price. In this case 100 units were sold at a price of 22 and 41 units were sold at a price of 6 each. So the unit price should be (100 x 22 + 41 x 6)/141 = 17.34752."

I will test and let you know if I find any remaining issues.
I turns out you were right about the stack size issue BUT only if all sales were within a 24 hour period!

Amazing stuff. Garkin was checking out the code and he picked up what I didn't. I was concentrating on the multiple day PPU code and missed a bug in the code I just assumed was right.

Well Shopkeeper keeps getting all the little fixes it needed.

Now the stack size issue on sales that only happen in 24 hours is fixed.

What a long strange trip this has been.


-d
Last edited by dopiate : 12/18/14 at 11:21 AM.
Report comment to moderator  
Reply With Quote
Unread 12/18/14, 07:22 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
Happy to Help

Originally Posted by Migoda
Thanks for fixing the tooltip bug! SK runs perfect for me now.
You are very welcome.

As long as I am playing the game I will keep it up and running and bug free.

Garkin deserves credit also for helping me anytime I got stuck. It would be wrong for me to take all the credit.

He helps so much that he must get overwhelmed with "thank you's" but, too bad, when you are that helpful you better get used to it

-d
Report comment to moderator  
Reply With Quote
Unread 12/17/14, 01:59 PM  
Migoda
AddOn Author - Click to view AddOns

Forum posts: 18
File comments: 79
Uploads: 1
Thanks for fixing the tooltip bug! SK runs perfect for me now.
Report comment to moderator  
Reply With Quote
Unread 12/17/14, 08:52 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
2 rather big bugs fixed

spoqster and groovergabe pointed out that while the tool tip mysetery had been solved there were still issues with it.

1- no tool tips at all in the bank or inventory
2- once #1 was fixed you could not drag any inventory into mail or guild store to sell

I was able to fix #1 which created #2 -- I was a bit stuck on #2 and Garkin graciously provided me the code I was missing.

So (as far as I know) Shopkeeper 1.0 is back to being error free.

As stated in my "mission statement" I will fix any and all bugs and keep the addon up to date but will not be adding features to it. Having said that, these tool tip fixes may have been intended to work but just using the original code this "feature" was commented out and even un-commented was not working. So this grays the line between fixing bugs and adding features. ... but I was very happy to help get working what you could obviously see he was trying to make work.

-d
Last edited by dopiate : 12/17/14 at 02:28 PM.
Report comment to moderator  
Reply With Quote
Unread 12/17/14, 04:20 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
Re: Re: Thanks ...

Originally Posted by spoqster
I have the same. I am guessing it is because of interference with other addons, but I am using so many that I haven't been able to pinpoint it yet.
Actually i might be able to fix that. I'll keep you updated.

so far I've gotten every other error fixed - let look into this one. This isn't as much as an error but missing features.

This is what was missing right? (this is from inventory)



Edit - i found the code to get it working - but it errors out on drag

I'm digging for a fix.
-d
Last edited by dopiate : 12/17/14 at 05:55 AM.
Report comment to moderator  
Reply With Quote
Unread 12/17/14, 01:08 AM  
spoqster

Forum posts: 8
File comments: 129
Uploads: 0
Re: Thanks ...

Originally Posted by groovergabe
For putting out a updated version that will hopefully stay updated etc. but i am not getting my Price Checks while hovering over items in my bank inventory or inventory while in other menus (mail, store listing etc) i get them when attached to a mail (inbox or even when i attach to a mail not yet sent), links, on listing featured item and more, but not in the standard right oriented menus, bank, inventory etc. is a little frustrating
I have the same. I am guessing it is because of interference with other addons, but I am using so many that I haven't been able to pinpoint it yet.
Report comment to moderator  
Reply With Quote
Unread 12/16/14, 09:08 PM  
groovergabe

Forum posts: 0
File comments: 8
Uploads: 0
Thanks ...

For putting out a updated version that will hopefully stay updated etc. but i am not getting my Price Checks while hovering over items in my bank inventory or inventory while in other menus (mail, store listing etc) i get them when attached to a mail (inbox or even when i attach to a mail not yet sent), links, on listing featured item and more, but not in the standard right oriented menus, bank, inventory etc. is a little frustrating
Report comment to moderator  
Reply With Quote
Unread 12/16/14, 06:09 AM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
Re: Re: A very interesting outcome!

Originally Posted by spoqster
Thanks dopiate! That really clears things up. I'll look at it again the next time I log on and compare the tooltip info to my intuition so I'll get a better sense of how accurate his approach is.
yea it clears it up for me too -- I truly like what he did there - if you read my first post you can see none of the basic "(a + b) / c" methods hit his number but then when you think about it - that item was trending HIGHER - from 60 gold for 20 to 10 days later having it go for 690 gold for 25 then his PPU is more in line with that price inflation and what people seem to be willing to pay (now) - while all my tries gave the same weigh the first sale as to the last sale. Which if you have ever suffered through college Economics classes, like I had to, should realize is incorrect.

Not to nerd-out too much here but I think he's applying some version of the Time Value of Money! Which is SO COOL - I just wish he had said something, somewhere so we all didn't go around thinking his tool tips were wrong.

But he truly posted 1.0 and vanished. I never even got a reply to my last two emails to him.

He's got me rethinkng how I show my PPU in GSM -- I may offer an option to apply a version of that equation as an alternative to my non-economic based math.

-d
Last edited by dopiate : 12/16/14 at 06:22 AM.
Report comment to moderator  
Reply With Quote
Unread 12/16/14, 04:37 AM  
spoqster

Forum posts: 8
File comments: 129
Uploads: 0
Re: A very interesting outcome!

Originally Posted by dopiate
in his code is this comment.

-- For a weighted average, the latest data gets a weighting of X, where X is the number of
-- days the data covers, thus making newest data worth more.

please notice "thus making newest data worth more"

It's a complicated formula but hes adding data weight over the number of days, with the latest sales being more important than a 10 day old sale.

Given this new information you will have to decide if that is what you want, because his code is clean. I just had no idea what he was going for. (in hindsight I should have started with the code but oh well)

here is the exact code

Code:
  -- Now that we have a price-sorted list, we can use it to compute stats
  if #sortedTable > 0 then
    local timeInterval = newestTime - oldestTime
    local avgPrice = 0
    -- If all sales data covers less than a day, we'll just do a plain average, nothing to weight
    if timeInterval < 86400 then
      for i = 1, #sortedTable do avgPrice = avgPrice + sortedTable[i][1] end
      avgPrice = avgPrice / #sortedTable
      returnData = {["avgPrice"] = avgPrice, ["numSales"] = #sortedTable, ["numDays"]= 1}
    -- For a weighted average, the latest data gets a weighting of X, where X is the number of
    -- days the data covers, thus making newest data worth more.
    else
      local dayInterval = math.floor((GetTimeStamp() - oldestTime) / 86400.0) + 1
      local weightedDiv = 0
      for i = 1, #sortedTable do
        local weightValue = dayInterval - math.floor((GetTimeStamp() - sortedTable[i][2]) / 86400.0)
        local perPrice = sortedTable[i][1]
        if sortedTable[i][3] > 1 then perPrice = perPrice / sortedTable[i][3] end
        weightedDiv = weightedDiv + weightValue
        avgPrice = avgPrice + (perPrice * weightValue)
      end
      if weightedDiv ~= 0 then avgPrice = avgPrice / weightedDiv end
      returnData = {["avgPrice"] = avgPrice, ["numSales"] = #sortedTable, ["numDays"] = dayInterval}
    end
  end
I think his theory is a valid one - he's adding current trends and weighting them more to give you a MORE accurate PPU than the simple equations I was doing.

You can either accept his idea (which I am impressed with) or choose not to but it's not broken and it has nothing to do with stack size.

One thing about Khaibit is that he knew how to code! and I don't know if that formula he is using was of his own creation or if it came out of some economics book but it's not my place to change it.

It's for you to decide if you agree with it. Personally I think it's a hell of a lot more valuable than all the simple stuff I was trying to do to match it.

-d
Thanks dopiate! That really clears things up. I'll look at it again the next time I log on and compare the tooltip info to my intuition so I'll get a better sense of how accurate his approach is.
Report comment to moderator  
Reply With Quote
Unread 12/15/14, 05:47 PM  
dopiate
AddOn Author - Click to view AddOns

Forum posts: 142
File comments: 677
Uploads: 11
A very interesting outcome!

in his code is this comment.

-- For a weighted average, the latest data gets a weighting of X, where X is the number of
-- days the data covers, thus making newest data worth more.

please notice "thus making newest data worth more"

It's a complicated formula but hes adding data weight over the number of days, with the latest sales being more important than a 10 day old sale.

Given this new information you will have to decide if that is what you want, because his code is clean. I just had no idea what he was going for. (in hindsight I should have started with the code but oh well)

here is the exact code

Code:
  -- Now that we have a price-sorted list, we can use it to compute stats
  if #sortedTable > 0 then
    local timeInterval = newestTime - oldestTime
    local avgPrice = 0
    -- If all sales data covers less than a day, we'll just do a plain average, nothing to weight
    if timeInterval < 86400 then
      for i = 1, #sortedTable do avgPrice = avgPrice + sortedTable[i][1] end
      avgPrice = avgPrice / #sortedTable
      returnData = {["avgPrice"] = avgPrice, ["numSales"] = #sortedTable, ["numDays"]= 1}
    -- For a weighted average, the latest data gets a weighting of X, where X is the number of
    -- days the data covers, thus making newest data worth more.
    else
      local dayInterval = math.floor((GetTimeStamp() - oldestTime) / 86400.0) + 1
      local weightedDiv = 0
      for i = 1, #sortedTable do
        local weightValue = dayInterval - math.floor((GetTimeStamp() - sortedTable[i][2]) / 86400.0)
        local perPrice = sortedTable[i][1]
        if sortedTable[i][3] > 1 then perPrice = perPrice / sortedTable[i][3] end
        weightedDiv = weightedDiv + weightValue
        avgPrice = avgPrice + (perPrice * weightValue)
      end
      if weightedDiv ~= 0 then avgPrice = avgPrice / weightedDiv end
      returnData = {["avgPrice"] = avgPrice, ["numSales"] = #sortedTable, ["numDays"] = dayInterval}
    end
  end
I think his theory is a valid one - he's adding current trends and weighting them more to give you a MORE accurate PPU than the simple equations I was doing.

You can either accept his idea (which I am impressed with) or choose not to but it's not broken and it has nothing to do with stack size.

One thing about Khaibit is that he knew how to code! and I don't know if that formula he is using was of his own creation or if it came out of some economics book but it's not my place to change it.

It's for you to decide if you agree with it. Personally I think it's a hell of a lot more valuable than all the simple stuff I was trying to do to match it.

-d
Last edited by dopiate : 12/15/14 at 05:52 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: