How can I fix this argument in LUA
I am using an old UI but with updated addons and I've only come across one issue and here it is.
Message: ...rface\AddOns\DoomKitty\modules\datatexts\friends.lua:27: bad argument #4 to 'format' (string expected, got nil) Time: 07/03/16 13:07:17 Count: 10 Stack: [C]: in function `format' ...rface\AddOns\DoomKitty\modules\datatexts\friends.lua:27: in function <...rface\AddOns\DoomKitty\modules\datatexts\friends.lua:10> Locals: (*temporary) = "%s | %s (%s)" (*temporary) = "|Kf64|kIronWill|k" (*temporary) = "IronWill#1602" (*temporary) = nil (*temporary) = "string expected, got nil" Here is the set of strings it is referring to: local function CreateTooltip() tool:SetScript("OnEnter", function(this) -------------THIS IS NUMBER 10 GameTooltip:SetOwner(this) GameTooltip:AddLine("Friends Online") GameTooltip:AddLine(" ") for k,v in pairs(friendList) do local name, lvl, class, area, status, note = v[1], v[2], v[3], v[4], v[5], v[6] local lineL = string.format("%s %s %s", lvl, name, status or "") local lineR = string.format("%s", area or "") GameTooltip:AddDoubleLine(lineL, lineR) end GameTooltip:AddLine(" ") for k,v in pairs(BNetList) do local BNid, BNname, battleTag, toonname, client, status, broadcast, note = v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8] local lineL = string.format("|cffecd672%s|r |cffffffff|| |cffecd672%s|r |cffffffff(%s)|r", BNname, battleTag, toonname) ------THIS IS NUMBER 27 local lineR = string.format("|cffffffff%s%s|r", status or "", client or "") GameTooltip:AddDoubleLine(lineL, lineR) end GameTooltip:Show() end) tool:SetScript("OnLeave", function(this) if (GameTooltip:IsShown()) then GameTooltip:Hide() end end) tool:SetScript("OnMouseDown", function(this, button) if (not InCombatLockdown()) then ToggleFriendsFrame(1) end end) end I do not know how to edit the string properly so that it does not mess up when I mouse over it. Any chance for some help fixing this? |
Easy fix: on that line, change toonname to
toonname or "" This fix will make the error go away but you might lose the toonname display of your bnet friends. Difficult fix: since I haven't looked at DoomKitty, I don't know how many files it uses or how involved the code is, so this could be tedious. Find all of the following function names and change them according to the arrows: Code:
BNGetToonInfo -> BNGetGameAccountInfo |
Quote:
|
All times are GMT -6. The time now is 02:35 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI