Thread Tools Display Modes
02/24/16, 02:39 PM   #1
mattymaats
Join Date: Feb 2016
Posts: 3
Exclamation Master Merchant on load Lua error

Hi guys,

I have an issue with MM and I'm not sure where to post it, basically every time I load up the game this error displays on my screen.

user:/AddOns/MasterMerchant/MasterMerchant.lua:2757: table index is nil
stack traceback:
user:/AddOns/MasterMerchant/MasterMerchant.lua:2757: in function 'MasterMerchant:InitPurchaseHistory'
user:/AddOns/MasterMerchant/MasterMerchant.lua:2417: in function 'MasterMerchant:Initialize'
user:/AddOns/MasterMerchant/MasterMerchant.lua:3016: in function 'OnAddOnLoaded'


I have tried to uninstall the mod and do a fresh install and the same issue occurs! So I'm a bit lost at what the problem as I totally deleted my old MM files and reinstalled it manually and through minion. If anyone has any ideas of what the issue is or something else I can try that would be great as I'm actually really stuck without MM

Edit - Tried to install Shissu LUA memory addon as suggested by someone, didn't help.

Last edited by mattymaats : 02/24/16 at 02:53 PM. Reason: Added trail fix
  Reply With Quote
02/24/16, 08:58 PM   #2
BJBSRR
Join Date: Feb 2016
Posts: 4
Having the SAME exact problem as the OP - please help!!!!
  Reply With Quote
02/25/16, 06:00 AM   #3
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
Looks like your savedata got corrupted.
You can try to edit MasterMerchant.lua in the addon directory and modify InitPurchaseHistory (line 2749) to look like this:
Lua Code:
  1. local item = dataList['sales'][i]
  2. if(item.guild) then -- add this
  3.    self.guildPurchases[item.guild] = self.guildPurchases[item.guild] or MMGuild:new(item.guild)
  4.    local guild = self.guildPurchases[item.guild]
  5.    guild:addSaleByDate(item.buyer, item['timestamp'], item.price, item.quant, item.wasKiosk, false)
  6. end -- and this
or if it doesn't help delete all master merchant related save data (SavedVariables/MasterMerchant.lua and all MMxxData.lua).
Either way you will loose parts or all of your trade history and it will have to regenerate it.

Last edited by sirinsidiator : 02/25/16 at 06:02 AM.
  Reply With Quote
02/25/16, 12:34 PM   #4
mattymaats
Join Date: Feb 2016
Posts: 3
I thought it might be which is why I deleted everything and downloaded it again, I'm a bit confused how the new files could still have the same error unless it's stored somewhere else?

I've opened the file in notepad++ and that section looks like this

[i]function MasterMerchant:InitPurchaseHistory()
-- If no guild buyer history then load it up
if self.guildPurchases == nil then
self.guildPurchases = {}
for k, v in pairs(self.salesData) do
for j, dataList in pairs(v) do
for i = 1, #dataList['sales'], 1 do
local item = dataList['sales']
self.guildPurchases[item.guild] = self.guildPurchases[item.guild] or MMGuild:new(item.guild)
local guild = self.guildPurchases[item.guild]
guild:addSaleByDate(item.buyer, item['timestamp'], item.price, item.quant, item.wasKiosk, false)
end
end
end
end

for _, guild in pairs(self.guildPurchases) do
guild:sort()
end
end


Could you confirm exactly what I'm supposed to change it to as I'm not sure what needs to be added.
Thanks for your help with this.
  Reply With Quote
02/25/16, 12:39 PM   #5
mattymaats
Join Date: Feb 2016
Posts: 3
I just ended up deleting the files in the saved variables and now it works at least, I'm not too bothered about having to gather the data again as I can just get someone to send me their files worst case. Thanks for showing me where the data is saved as that's what I was missing.
  Reply With Quote
02/25/16, 02:07 PM   #6
BJBSRR
Join Date: Feb 2016
Posts: 4
Thank you!

After googling for a while last night I found this info:

Change:
if type(dataList['sales'][i]['timestamp']) ~= 'number' or dataList['sales'][i]['timestamp'] < epochBack then


to:
if type(dataList['sales'][i]['timestamp']) ~= 'number' or dataList['sales'][i]['timestamp'] < epochBack or dataList['sales'][i]['guild'] == nil then



in MasterMerchant.lua in the MasterMerchant:TruncateHistory() function.


I made the change last night and it seemed to make the error go away, however I've not actually gone to an auctioneer to test is out. I wish I could code I'll try the above as well!
  Reply With Quote
02/28/16, 06:42 PM   #7
BJBSRR
Join Date: Feb 2016
Posts: 4
How did you delete the items in the saved variables? What did you take out of the lua?
  Reply With Quote
02/28/16, 11:13 PM   #8
QuadroTony
Banned
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 828
look at the variables and you will see

the section started with itemid
  Reply With Quote
02/29/16, 03:51 PM   #9
BJBSRR
Join Date: Feb 2016
Posts: 4
I get what you're saying, but I am so clueless when it comes to any code it hurts. Can you possibly show me? I'd MUCH appreciate it. There is a lot in itemid, and I dont really see anything that has a list of sorts.

Figured it out.. my apologies. Was actually looking in the lua's for savedvars

Last edited by BJBSRR : 03/01/16 at 04:53 PM.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Master Merchant on load Lua error

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