wow-addon / FarmIt2

A fork of FarmIt which has not been updated in a little while. Original; https://www.curseforge.com/wow/addons/farmit
9 stars 6 forks source link

Currency bar error #3

Closed rapozab closed 4 years ago

rapozab commented 4 years ago

I"m getting the following when performing /farmit currency. It also happens if the currency bar is already displayed and the mouse hovers over it.

Message: Interface\AddOns\FarmIt2\FarmIt2_Core.lua:715: attempt to concatenate field 'name' (a table value) Time: Sun Nov 1 11:27:59 2020 Count: 1 Stack: Interface\AddOns\FarmIt2\FarmIt2_Core.lua:715: attempt to concatenate field 'name' (a table value) [string "@Interface\AddOns\FarmIt2\FarmIt2_Core.lua"]:715: in function FI_Progress' [string "@Interface\AddOns\FarmIt2\FarmIt2_Currency.lua"]:136: in functionFI_Update_Currency' [string "@Interface\AddOns\FarmIt2\FarmIt2_Config.lua"]:167: in function FI_Toggle_Currency' [string "@Interface\AddOns\FarmIt2\FarmIt2.lua"]:238: in function?' [string "@Interface\FrameXML\ChatFrame.lua"]:5073: in function ChatEdit_ParseText' [string "@Interface\FrameXML\ChatFrame.lua"]:4737: in functionChatEdit_SendText' [string "@Interface\FrameXML\ChatFrame.lua"]:4773: in function `ChatEdit_OnEnterPressed'

Locals: data =

{ name =
{ } count = 762 objective = 0 id = 1 lastcount = 762 icon = 646678 success = false } silent = nil f_name = "FI_Currency_1" database = "Currencies" currencyName = nil status = nil info = nil suffix = nil color = nil sound = nil itemName = nil itemLink = nil (temporary) = "|cFF" (temporary) = "3399FF" (temporary) =
{ currencyTypesID = 1719 quantity = 952 name = "Corrupted Mementos" iconFileID = 646678 } (temporary) = "" (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (*temporary) = "attempt to concatenate field 'name' (a table value)"

karpana commented 4 years ago

I'm getting a similar (if not identical error) ... but I get it on all my toons except for one... I don't know what's different between the one that works and the others (right now 5 that I'm actively running with this addon)

Message: Interface\AddOns\FarmIt2\FarmIt2_Core.lua:715: attempt to concatenate field 'name' (a table value)
Time: Fri Nov 13 11:09:53 2020
Count: 51
Stack: Interface\AddOns\FarmIt2\FarmIt2_Core.lua:715: attempt to concatenate field 'name' (a table value)
[string "=[C]"]: ?
[string "@Interface\AddOns\FarmIt2\FarmIt2_Core.lua"]:715: in function `FI_Progress'
[string "@Interface\AddOns\FarmIt2\FarmIt2_Currency.lua"]:136: in function `FI_Update_Currency'
[string "@Interface\AddOns\FarmIt2\FarmIt2_Core.lua"]:675: in function `FI_Update'
[string "@Interface\AddOns\FarmIt2\FarmIt2.lua"]:98: in function `FI_OnEvent'
[string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1>

Locals: 
karpana commented 4 years ago

I figued out waht's different... my main doesn't have the currency bar turned on. whereas all my alts do.

med0rian commented 4 years ago

Got another Error with the last Update on the Currency Bar - it does not show the Currency Icon. When I Hover the Currency Bar it shows this error: `1x AllTheThings\AllTheThings-2.1.4.lua:5098: Usage: GameTooltip:SetCurrencyToken(index)

[string "@AllTheThings\AllTheThings-2.1.4.lua"]:5098: in function 'SetCurrencyToken' [string "@FarmIt2\FarmIt2_Currency.lua"]:296: in function <FarmIt2\FarmIt2_Currency.lua:283>`

When i rightclick the Number, this error: 1x FI_Currency_1_Editbox: Set bytes attribute on EditBox element instead of child FontString

And it does not Show/Update the Farming goal - when you set it with rightclick -> Enter Number -> Enter. But the Chat says: [FarmIt] Farming objective set: 140 Argentumbelobigung

Last error for me: Farmit shows the Currency Bar BUT say always 0. I think he can not track currencys at the moment :x

jgkg1999 commented 4 years ago

I'm still seeing this error for the currency bar:

Message: Interface\AddOns\FarmIt2\FarmIt2_Currency.lua:25: attempt to index global 'CurrencyInfo' (a nil value) Time: Wed Nov 18 11:05:42 2020 Count: 9 Stack: Interface\AddOns\FarmIt2\FarmIt2_Currency.lua:25: attempt to index global 'CurrencyInfo' (a nil value) [string "@Interface\AddOns\FarmIt2\FarmIt2_Currency.lua"]:25: in function `FI_HasTokens' [string "@Interface\AddOns\FarmIt2\FarmIt2_Currency.lua"]:283: in function <Interface\AddOns\FarmIt2\FarmIt2_Currency.lua:277>

Locals: currency =

{ currencyTypesID = 1754 quantity = 9 name = "Argent Commendation" iconFileID = 236690 } (temporary) = 1 (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (temporary) = nil (*temporary) = "attempt to index global 'CurrencyInfo' (a nil value)"

rapozab commented 4 years ago

Here's a fix (hack) for the line 715 issue:

-- nested name hack
local dname = data.name;
while dname.name do
  dname = dname.name;
end

currencyName = "|cFF"..FI_SV_CONFIG.Colors.currency[4]..dname.."|r";
rapozab commented 4 years ago

Attached are Farmit2_core.lua and Farmit2_currency.lua that fix the above issues.

FarmIt2.zip

rapozab commented 4 years ago

Final update. This includes the other fixes plus a fix for displaying the currency icons.

FarmIt2.zip

jgkg1999 commented 4 years ago

Thank you! Fixed it! Was my last error that was driving me NUTS lol. You saved me!

davidcraig commented 4 years ago

These changes have now been merged into master, thank you @rapozab for uploading the zips