Quantcast
How can I fix this argument in LUA - WoWInterface
Thread Tools Display Modes
07-03-16, 11:27 AM   #1
Bmw309894
A Deviate Faerie Dragon
 
Bmw309894's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2012
Posts: 10
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?
  Reply With Quote
07-03-16, 10:11 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 506
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
BNGetFriendToonInfo -> BNGetFriendGameAccountInfo
BNGetNumFriendToons -> BNGetNumFriendGameAccounts
This was a Blizzard change in 6.2.4. I'm assuming that DoomKitty is using those and since it's a discontinued addon, those functions are probably the old ones.

Last edited by Kanegasi : 07-10-16 at 08:25 PM.
  Reply With Quote
07-04-16, 11:30 AM   #3
Bmw309894
A Deviate Faerie Dragon
 
Bmw309894's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2012
Posts: 10
Originally Posted by Kanegasi View Post
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
BNGetFriendToonInfo -> BNGetFriendGameAccountInfo
BNGetNumFriendToons -> BNGetNumFriendGameAccounts
This was a Blizzard change in 6.2.4. I'm assuming that DoomKitty is using those and since it's a discontinued addon, those functions are probably the old ones.
I changed the things over as you said and it appears to be working fine now. I found another error but I need to get it to appear again before I know what the code problem is. for now I just use bug grabber and its fine but I think it only happen when I receive loot in a dungeon. It may have something to do with the pop up showing I won the loot. I'll check back later when I find out more. Many thanks good sir.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » How can I fix this argument in LUA

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